Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Plugin is passing RUSTC_BOOTSTRAP=1 to build scripts #9700

Closed
null-dev opened this issue Nov 9, 2022 · 0 comments · Fixed by #9901
Closed

Plugin is passing RUSTC_BOOTSTRAP=1 to build scripts #9700

null-dev opened this issue Nov 9, 2022 · 0 comments · Fixed by #9901

Comments

@null-dev
Copy link

null-dev commented Nov 9, 2022

Environment

  • IntelliJ Rust plugin version: 0.4.182.4996-222
  • Rust toolchain version: 1.63.0 (4b91a6ea7 2022-08-08) x86_64-unknown-linux-gnu
  • IDE name and version: CLion 2022.2.4 (CL-222.4345.21)
  • Operating system: Linux 6.0.7-arch1-1
  • Macro expansion: enabled

Problem description

The plugin is passing RUSTC_BOOTSTRAP=1 to build scripts sometimes (seems to only happen when you import a project without the target directory). This breaks build scripts that probe for nightly features, see #9235 for a similar bug.

Steps to reproduce

  1. Create a project with a dependency that has a build script that probes for nightly features (e.g. thiserror)
  2. Close Clion/Intellij
  3. Delete the target directory of the project
  4. Open the project in Clion/Intellij
  5. Wait for background tasks to complete
  6. Attempt to build/run the project
  7. The project fails to build/run.

PR that might be related but I don't think(?) is relevant: #9637

Undin added a commit that referenced this issue Dec 16, 2022
Since #9176 the plugin passes `RUSTC_BOOTSTRAP=1` environment variable to `cargo check` call to compiler and run as much as possible during build script evaluation phase (it's experimental feature of cargo that's why we need `RUSTC_BOOTSTRAP=1` here).
But this variable also is passed to `rustc` calls launched by cargo during compilation. And it may affect compilation. For example, compilation and evaluation of `thiserror` crate produce different results with different value of `RUSTC_BOOTSTRAP`.

Actually, we don't want to provide `RUSTC_BOOTSTRAP` to `rustc` invocations. So now the plugin stores original value of `RUSTC_BOOTSTRAP` in `INTELLIJ_ORIGINAL_RUSTC_BOOTSTRAP` (if it existed) environment variable and native helper passes it to `rustc`. It allows us to avoid some unexpected circumstances of `RUSTC_BOOTSTRAP=1`
@bors bors bot closed this as completed in 9b975c5 Jan 13, 2023
yopox pushed a commit to Kobzol/intellij-rust that referenced this issue Feb 27, 2023
Since intellij-rust#9176 the plugin passes `RUSTC_BOOTSTRAP=1` environment variable to `cargo check` call to compiler and run as much as possible during build script evaluation phase (it's experimental feature of cargo that's why we need `RUSTC_BOOTSTRAP=1` here).
But this variable also is passed to `rustc` calls launched by cargo during compilation. And it may affect compilation. For example, compilation and evaluation of `thiserror` crate produce different results with different value of `RUSTC_BOOTSTRAP`.

Actually, we don't want to provide `RUSTC_BOOTSTRAP` to `rustc` invocations. So now the plugin stores original value of `RUSTC_BOOTSTRAP` in `INTELLIJ_ORIGINAL_RUSTC_BOOTSTRAP` (if it existed) environment variable and native helper passes it to `rustc`. It allows us to avoid some unexpected circumstances of `RUSTC_BOOTSTRAP=1`
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants