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

Fix build err autodiff libs #138553

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vayunbiyani
Copy link
Contributor

@vayunbiyani vayunbiyani commented Mar 16, 2025

Fixed build errors generated in #137570. Still a work in progress to implement ThinLTO

@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 16, 2025
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#20 exporting to docker image format
#20 sending tarball 19.7s done
#20 DONE 25.7s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---

error[E0433]: failed to resolve: use of undeclared type `SimpleCx`
   --> compiler/rustc_codegen_llvm/src/lib.rs:119:13
    |
119 |             SimpleCx::new(module_llvm.llmod(), &module_llvm.llcx, tcx.data_layout.pointer_size);
    |             ^^^^^^^^ use of undeclared type `SimpleCx`
    |
help: consider importing this type alias
    |
24  + use crate::context::SimpleCx;
    |

   Compiling rustc_passes v0.0.0 (/checkout/compiler/rustc_passes)
[RUSTC-TIMING] rustc_sanitizers test:false 6.220
error[E0560]: struct `GenericCx<'_, SCx<'_>>` has no field named `llmod`
   --> compiler/rustc_codegen_llvm/src/builder/autodiff.rs:289:25
    |
289 |     let cx = SimpleCx { llmod: module_llvm.llmod(), llcx: module_llvm.llcx };
    |                         ^^^^^ field does not exist
    |
   ::: compiler/rustc_codegen_llvm/src/context.rs:67:19
    |
67  | pub(crate) struct GenericCx<'ll, T: Borrow<SCx<'ll>>>(T, PhantomData<SCx<'ll>>);
    |                   --------- `GenericCx<'_, SCx<'_>>` defined here
    |
help: `GenericCx<'_, SCx<'_>>` is a tuple struct, use the appropriate syntax
    |
289 -     let cx = SimpleCx { llmod: module_llvm.llmod(), llcx: module_llvm.llcx };
289 +     let cx = GenericCx<'_, SCx<'_>>(/* T */, /* std::marker::PhantomData<SCx<'ll>> */);
    |

error[E0560]: struct `GenericCx<'_, SCx<'_>>` has no field named `llcx`
   --> compiler/rustc_codegen_llvm/src/builder/autodiff.rs:289:53
    |
289 |     let cx = SimpleCx { llmod: module_llvm.llmod(), llcx: module_llvm.llcx };
    |                                                     ^^^^ field does not exist
    |
   ::: compiler/rustc_codegen_llvm/src/context.rs:67:19
    |
67  | pub(crate) struct GenericCx<'ll, T: Borrow<SCx<'ll>>>(T, PhantomData<SCx<'ll>>);
    |                   --------- `GenericCx<'_, SCx<'_>>` defined here
    |
help: `GenericCx<'_, SCx<'_>>` is a tuple struct, use the appropriate syntax
    |
289 -     let cx = SimpleCx { llmod: module_llvm.llmod(), llcx: module_llvm.llcx };
289 +     let cx = GenericCx<'_, SCx<'_>>(/* T */, /* std::marker::PhantomData<SCx<'ll>> */);
    |

Some errors have detailed explanations: E0432, E0433, E0560.
For more information about an error, try `rustc --explain E0432`.
[RUSTC-TIMING] rustc_codegen_llvm test:false 3.841

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 16, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Mar 17, 2025

r? @ZuseZ4

@bors delegate=ZuseZ4

@rustbot
Copy link
Collaborator

rustbot commented Mar 17, 2025

Failed to set assignee to ZuseZ4: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@bors
Copy link
Contributor

bors commented Mar 17, 2025

✌️ @ZuseZ4, you can now approve this pull request!

If @oli-obk told you to "r=me" after making some further change, please make that change, then do @bors r=@oli-obk

@ZuseZ4 ZuseZ4 added the F-autodiff `#![feature(autodiff)]` label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-autodiff `#![feature(autodiff)]` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants