-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove NtIdent
hack for regressed crates
#74616
Comments
Tests that need to be removed together with the hack are in |
The hack is here: rust/src/librustc_ast/token.rs Lines 814 to 838 in 0301700
|
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Fixes rust-lang#74616 There are still a large number of outstanding regressions, so this PR can't be merged yet. I'm opening it to generate a newer 'try' build for crater authors to test with. Eventually, we'll want to do a crater run for this PR.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Your crate currently depends on an older version of proc-macro-hack which is buggy, and will stop compiling in a future release of Rust. See rust-lang/rust#74616 for more details.
Issue rust-lang#74616 tracks a backwards-compatibility hack for certain macros. This has is implemented by hard-coding the filenames and macro names of certain code that we want to continue to compile. However, the initial implementation of the hack was based on the directory structure when building the crate from its repository (e.g. `js-sys/src/lib.rs`). When the crate is build as a dependency, it will include a version number from the clone from the cargo registry (e.g. `js-sys-0.3.17/src/lib.rs`), which would fail the check. This commit modifies the backwards-compatibility hack to check that desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the proper part of the path. See rust-lang#76070 (comment) for more details.
…t, r=petrochenkov Account for version number in NtIdent hack Issue rust-lang#74616 tracks a backwards-compatibility hack for certain macros. This has is implemented by hard-coding the filenames and macro names of certain code that we want to continue to compile. However, the initial implementation of the hack was based on the directory structure when building the crate from its repository (e.g. `js-sys/src/lib.rs`). When the crate is build as a dependency, it will include a version number from the clone from the cargo registry (e.g. `js-sys-0.3.17/src/lib.rs`), which would fail the check. This commit modifies the backwards-compatibility hack to check that desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the proper part of the path. See rust-lang#76070 (comment) for more details.
…t, r=petrochenkov Account for version number in NtIdent hack Issue rust-lang#74616 tracks a backwards-compatibility hack for certain macros. This has is implemented by hard-coding the filenames and macro names of certain code that we want to continue to compile. However, the initial implementation of the hack was based on the directory structure when building the crate from its repository (e.g. `js-sys/src/lib.rs`). When the crate is build as a dependency, it will include a version number from the clone from the cargo registry (e.g. `js-sys-0.3.17/src/lib.rs`), which would fail the check. This commit modifies the backwards-compatibility hack to check that desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the proper part of the path. See rust-lang#76070 (comment) for more details.
… r=petrochenkov Account for version number in NtIdent hack Issue rust-lang#74616 tracks a backwards-compatibility hack for certain macros. This has is implemented by hard-coding the filenames and macro names of certain code that we want to continue to compile. However, the initial implementation of the hack was based on the directory structure when building the crate from its repository (e.g. `js-sys/src/lib.rs`). When the crate is build as a dependency, it will include a version number from the clone from the cargo registry (e.g. `js-sys-0.3.17/src/lib.rs`), which would fail the check. This commit modifies the backwards-compatibility hack to check that desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the proper part of the path. See rust-lang#76070 (comment) for more details.
Issue rust-lang#74616 tracks a backwards-compatibility hack for certain macros. This has is implemented by hard-coding the filenames and macro names of certain code that we want to continue to compile. However, the initial implementation of the hack was based on the directory structure when building the crate from its repository (e.g. `js-sys/src/lib.rs`). When the crate is build as a dependency, it will include a version number from the clone from the cargo registry (e.g. `js-sys-0.3.17/src/lib.rs`), which would fail the check. This commit modifies the backwards-compatibility hack to check that desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the proper part of the path. See rust-lang#76070 (comment) for more details.
I don't know why I thought that my PR fixed this issue... |
Should we communicate this to users when compiling code with older versions? Give them a special deprecation warning perhaps and a hint like this, to speed things up? |
PR #75534 will give us the first part of the needed infrastructure to do this. Right now, our only option would be to ignore cap-lints and emit the full warning for upstream dependencies, which would break anyone who denys warnings. |
What is this issue?
If you're a crate author who's been linked here, this issue tracks removing a backwards-compatibility hack in Rust.
Rust has a longstanding issue #43081, which causes procedural macros to lose location and hygiene information (known as a "Span") under certain circumstances. Recently, pull request #73084 was merged, which makes progress towards resolving #43081.
Unfortunately, older versions of certain procedural macro crates (such as
proc-macro-hack v0.5.15
andjs-sys v0.3.39
) cannot handle the changes in input caused by the Rust bugfix. To allow these crates to continue to compile, a backward-compatibility hack was added to adjust the input passed toproc-macro-hack
andjs-sys
specifically.Eventually, we would like to remove this backwards-compatibility hack, since the compiler should not have hard-coded exceptions for certain crates. However, removing this hack will break any crates that depend on affected versions of
proc-macro-hack
orjs-sys
.To ensure that your crate continues to work, you'll want to ensure that your
Cargo.lock
referencesproc-macro-hack
v0.5.16 or above, andjs-sys
v0.3.40 or above. This can be done by runningcargo update -p proc-macro-hack
andcargo update -p js-sys
. If you maintain a library crate (without aCargo.lock
, no action is needed on your part).Internal compiler details
In #73084 (comment), I added a hack to change the behavior of
NtIdent
s passed to certain proc-macros. This was done by special-casing certain identifiers, and should be eventually be removed in favor of a proper solution.If we decide to always wrap single identifiers in
None
-delimited groups, then we will need to wait until enough of the ecosystem has bumpedproc-macro-hack
andwasm-bindgen
, to avoid breaking a large number of crates.Crater run: https://crater-reports.s3.amazonaws.com/pr-73084-1/index.html
Triage: https://hackmd.io/O7icbSylRP6uVZyAQ9EDeA
The text was updated successfully, but these errors were encountered: