Skip to content

[Bug]: toxic proc-macro2 version #428

@gutenfries

Description

@gutenfries

Description

Hi folks,
As you may or may not be aware, there was recently a push to prod made by the Rust dev team (see rust-lang/rust#113152) that depreciated several nightly APIs.

Furthermore, proc-macro2 actually depended on one of these APIs.

This was all very promptly addressed and fixed in proc-macro2 versions >=1.0.60 (see dtolnay/proc-macro2#391 )

Attempting to consume corrosion with rust nightly toolchain >=nightly-2023-06-28 will result in an breaking error something like the following:

error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/gutenfries/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.52/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error
error: failed to compile `corrosion-generator v0.1.0 (/home/gutenfries/Desktop/mille/build/linux/x64/release/_deps/corrosion-src/generator)`, intermediate artifacts can be found at `/home/gutenfries/Desktop/mille/build/linux/x64/release/_deps/corrosion-src/generator/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
CMake Error at /home/gutenfries/Desktop/mille/build/linux/x64/release/_deps/corrosion-src/cmake/Corrosion.cmake:594 (message):
  Building CMake Generator for Corrosion - failed
Call Stack (most recent call first):
  /home/gutenfries/Desktop/mille/build/linux/x64/release/_deps/corrosion-src/CMakeLists.txt:73 (include)

Additional Context

My CMake call looks like this: (Note that this is NOT the issue)

# We include Corrosion inline here, but ideally in a project with many
# dependencies we would need to install Corrosion on the system. See
# instructions on https://github.com/AndrewGaspar/corrosion#cmake-install Once
# done, uncomment this line: find_package(Corrosion REQUIRED)

include(FetchContent)

FetchContent_Declare(
  Corrosion
  GIT_REPOSITORY https://github.com/AndrewGaspar/corrosion.git
  GIT_TAG origin/master # Optionally specify a version tag or branch here
)

FetchContent_MakeAvailable(Corrosion)

corrosion_import_crate(MANIFEST_PATH ../native/Cargo.toml)

# Flutter-specific

set(CRATE_NAME "native")

target_link_libraries(${BINARY_NAME} PRIVATE ${CRATE_NAME})

list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${CRATE_NAME}-shared>)

Environment

tool version
OS Like Ubuntu 20.04
CMake 3.16.3
clang++ 10.0.0-4ubuntu1

Expected Behavior

Not to throw a compile error 😄

Steps To Reproduce

Consume Corrorsion in any environment using rust toolchain nightly-2023-06-28 or higher

Proposed fix(es)

the issue has been resolved within proc-macro2, and versions >=1.0.60 appropriately address this.

simply bumping this ASAP should be adequate to address this.

I will open a PR in a minute with the changes.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions