Skip to content
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

python x.py check always rebuilds rustc_llvm on Windows #92369

Closed
Milo123459 opened this issue Dec 28, 2021 · 14 comments
Closed

python x.py check always rebuilds rustc_llvm on Windows #92369

Milo123459 opened this issue Dec 28, 2021 · 14 comments

Comments

@Milo123459
Copy link
Contributor

I have forked the rust repository, and I made a change. When running python x.py check, rustc_llvm always rebuilds.

@BGR360
Copy link
Contributor

BGR360 commented Dec 29, 2021

Can you please show your config.toml? And also the output of x.py check?

@Milo123459
Copy link
Contributor Author

This is config.toml:

# Includes one of the default files in src/bootstrap/defaults
profile = "compiler"
changelog-seen = 2

The output of x.py check is what you would expect, except for rustc_llvm(build) starts at 306 and has to go up to 317 in modules.

@BGR360
Copy link
Contributor

BGR360 commented Dec 29, 2021

The output of x.py check is what you would expect

How can you be certain that you and I expect the same thing? :-)

Also, it's apparent to me now that I don't actually know the purpose of rustc_llvm. Does compiling this crate result in compiling all of LLVM from source? Or is it just a small utility crate that doesn't take much time to compile at all?

@Milo123459
Copy link
Contributor Author

How can you be certain that you and I expect the same thing? :-)

Oh, then I'm lost on what you mean.

@BGR360
Copy link
Contributor

BGR360 commented Dec 29, 2021

Oh I was replying to how you said "the output is what you'd expect." I wanted to caution against using that as justification to not show what I requested, since maybe what I'd expect is different from what you'd expect.

@Milo123459
Copy link
Contributor Author

The main thing that's out of the ordinary is that every time it's rebuilt, the only thing that I would say is weird about the output.

@BGR360
Copy link
Contributor

BGR360 commented Dec 29, 2021

And my point is I don't understand why that is weird. This is probably because I don't actually understand what the rustc_llvm crate does exactly (can you answer the question that I asked here?)

And furthermore, there could be things in the output that you don't think are out of the ordinary, but somebody else might see it and be able to say that it explains something. Maybe it's not true in this case, but continuing to go back and forth rather than just providing the output as requested seems counterproductive.

There are also details of your issue that still aren't clear. When you say "every time it's rebuilt," does that mean even when you do ./x.py check twice in a row without changing the code? What did you mean by "starts at 306 and has to go up to 317 in module"?

@Mark-Simulacrum
Copy link
Member

If you can run with CARGO_LOG=cargo::core::compiler::fingerprint=info in the environment, that may help in identifying the cause of the rebuilds -- that should be set on an invocation which rebuilds. Please provide the full log when rebuilding with that env variable set.

@Milo123459
Copy link
Contributor Author

Milo123459 commented Dec 29, 2021

Sorry for all the confusion! Here's the result of that:

Updating only changed submodules
Submodules updated in 0.12 seconds
    Finished dev [unoptimized] target(s) in 0.40s
Checking stage0 std artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
    Finished release [optimized] target(s) in 0.46s
Checking stage0 std test/bench/example targets (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
    Finished release [optimized] target(s) in 0.39s
Checking stage0 compiler artifacts (x86_64-pc-windows-msvc -> x86_64-pc-windows-msvc)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] stale: changed env "CFG_LLVM_ROOT"
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]        Some("c:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe") != Some("C:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe")
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc-main v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc)/Check { test: false }/TargetInner { name: "rustc-main", doc: true, ..: with_path("C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc\\src\\main.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_driver/74659112559a43bc) != old (rustc_driver/97c06cec17f54cc2)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_driver v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_driver)/Check { test: false }/TargetInner { ..: lib_target("rustc_driver", ["dylib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_driver\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_interface/ab6ec758641a91f1) != old (rustc_interface/eb9f92409a57cd3e)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_interface v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_interface)/Check { test: false }/TargetInner { doctest: false, ..: lib_target("rustc_interface", ["lib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_interface\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_codegen_llvm/2a7c1c23e5335c9) != old (rustc_codegen_llvm/18aa118ed0f27aa3)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_codegen_llvm v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_codegen_llvm)/Check { test: false }/TargetInner { tested: false, doctest: false, ..: lib_target("rustc_codegen_llvm", ["lib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_codegen_llvm\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_llvm/547782de7de2eb20) != old (rustc_llvm/e0eead57ef186c39)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_llvm v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_llvm)/Check { test: false }/TargetInner { ..: lib_target("rustc_llvm", ["lib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_llvm\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (build_script_build/9d5278997f5d00cb) != old (build_script_build/166b70ac75843216)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_llvm v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_llvm)/RunCustomBuild/TargetInner { ..: custom_build_target("build-script-build", "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_llvm\\build.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: env var `LLVM_CONFIG` changed: previously Some("c:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe"), now Some("C:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe")
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc-main v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc)/Check { test: true }/TargetInner { name: "rustc-main", doc: true, ..: with_path("C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc\\src\\main.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_driver/74659112559a43bc) != old (rustc_driver/97c06cec17f54cc2)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] stale: changed env "CFG_LLVM_ROOT"
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]        Some("c:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe") != Some("C:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe")
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_codegen_llvm v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_codegen_llvm)/Check { test: true }/TargetInner { tested: false, doctest: false, ..: lib_target("rustc_codegen_llvm", ["lib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_codegen_llvm\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_llvm/547782de7de2eb20) != old (rustc_llvm/e0eead57ef186c39)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_driver v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_driver)/Check { test: true }/TargetInner { ..: lib_target("rustc_driver", ["dylib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_driver\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_interface/ab6ec758641a91f1) != old (rustc_interface/eb9f92409a57cd3e)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_interface v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_interface)/Check { test: true }/TargetInner { doctest: false, ..: lib_target("rustc_interface", ["lib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_interface\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (rustc_codegen_llvm/2a7c1c23e5335c9) != old (rustc_codegen_llvm/18aa118ed0f27aa3)
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rustc_llvm v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_llvm)/Check { test: true }/TargetInner { ..: lib_target("rustc_llvm", ["lib"], "C:\\Users\\milo5\\Desktop\\GitHub\\rust\\compiler\\rustc_llvm\\src\\lib.rs", Edition2021) }
[2021-12-29T03:28:37Z INFO  cargo::core::compiler::fingerprint]     err: unit dependency information changed

    Caused by:
        new (build_script_build/9d5278997f5d00cb) != old (build_script_build/166b70ac75843216)
   Compiling rustc_llvm v0.0.0 (C:\Users\milo5\Desktop\GitHub\rust\compiler\rustc_llvm)

Even with no code changes, I get this every time I rerun the command.

After just re-running and changing some code, it's proving to be flakey, happening every now and then. From what I'm seeing in the error I think that Cargo is thinking a dependency changed when in reality it hasn't.

@Mark-Simulacrum
Copy link
Member

The problem is caused by CFG_LLVM_ROOT changing, but it's not clear why that case change would happen.

-c:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe
+C:\\Users\\milo5\\Desktop\\GitHub\\rust\\build\\x86_64-pc-windows-msvc\\ci-llvm/bin\\llvm-config.exe

That value is parsed from config.toml, I think, so presumably you're running something in the background like rust-analyzer which is using a different config.toml? Or something Windows-specific is happening that causes case changes, which is also possible I suppose.

@Milo123459
Copy link
Contributor Author

This seems to only happen when I have VSCode open... I think rust-analyzer and a combination of Windows being bad is causing this.

@Milo123459
Copy link
Contributor Author

Milo123459 commented Dec 31, 2021

#88310 now that it is in the merge queue could possibly fix this. Not sure though, I'll test when merged.

fee1-dead added a commit to fee1-dead-contrib/rust that referenced this issue Sep 26, 2022
…k-Simulacrum

Don't set RUSTC in the bootstrap build script

We no longer use this for anything since https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781. Remove it, so that we spuriously rebuild bootstrap fewer times on Windows (where PATH changes often).

Helps with rust-lang#92369. cc rust-lang#102266

r? `@Mark-Simulacrum`
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this issue Sep 26, 2022
…k-Simulacrum

Don't set RUSTC in the bootstrap build script

We no longer use this for anything since https://github.com/rust-lang/rust/pull/98483/files#diff-7eddc76f1be9eca2599a9ae58c65ffe247fbdff9b02ef687439894cab9afe749L781. Remove it, so that we spuriously rebuild bootstrap fewer times on Windows (where PATH changes often).

Helps with rust-lang#92369. cc rust-lang#102266

r? ``@Mark-Simulacrum``
@Dylan-DPC
Copy link
Member

@Milo123459 can you confirm if this is fixed?

@Milo123459
Copy link
Contributor Author

Yeah, it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants