Skip to content

autodiff: fix sysroot candidates in libEnzyme not found error - #163028

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
sgasho:enzyme-wrapper-cleanup
Oct 8, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
sgasho:enzyme-wrapper-cleanup

Conversation

@sgasho

@sgasho sgasho commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

fix: #160335 (comment)

Before

RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future

After: points out the right candidate dir

RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4

@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

cc @ZuseZ4

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-autodiff `#![feature(autodiff)]` 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 Sep 19, 2026
@ZuseZ4

ZuseZ4 commented Oct 7, 2026

Copy link
Copy Markdown
Member

@bors try jobs=dist-x86_64-linux,optional-test-x86_64-gnu-autodiff

rust-bors Bot pushed a commit that referenced this pull request Oct 7, 2026
autodiff: fix sysroot candidates in libEnzyme not found error


try-job: dist-x86_64-linux
try-job: optional-test-x86_64-gnu-autodiff
@rust-bors

This comment has been minimized.

@ZuseZ4

ZuseZ4 commented Oct 7, 2026

Copy link
Copy Markdown
Member

@bors r=me if try comes out green

@rust-bors

rust-bors Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 38d5ee3 has been approved by me

It is now in the queue for this repository.

⚠️ The following reviewer(s) could not be found: me

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 7, 2026
@ZuseZ4

ZuseZ4 commented Oct 7, 2026

Copy link
Copy Markdown
Member

@bors r-

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 7, 2026
@rust-bors

rust-bors Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

View changes since this unapproval

@rust-bors

rust-bors Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: d038b84 (d038b84a4ac3122b4d1086c8aaf430b4d3191850)
Base parent: 8d1a764 (8d1a76430406c877b35d0b627e7f796dcf0dfeca)

@ZuseZ4

ZuseZ4 commented Oct 7, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 38d5ee3 has been approved by ZuseZ4

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 7, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 8, 2026
…useZ4

autodiff: fix sysroot candidates in libEnzyme not found error

fix: rust-lang#160335 (comment)

Before

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future
```

After: points out the right candidate dir

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future
```

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…useZ4

autodiff: fix sysroot candidates in libEnzyme not found error

fix: rust-lang#160335 (comment)

Before

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future
```

After: points out the right candidate dir

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future
```

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 8, 2026
…useZ4

autodiff: fix sysroot candidates in libEnzyme not found error

fix: rust-lang#160335 (comment)

Before

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future
```

After: points out the right candidate dir

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future
```

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #162741 (codegen: tell LLVM that the discriminant is a power of two)
 - #162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - #163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - #163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - #163538 (Add `rustc::missing_generic_type_visitable` lint)
 - #163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - #163908 (Update Enzyme submodule)
 - #163935 (Use BasicBlock::start_location and Location::START)
 - #163949 (disable next-solver with higher-ranked-assumptions)
 - #163951 (relax_elf_relocations is x86-only)
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #162741 (codegen: tell LLVM that the discriminant is a power of two)
 - #162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - #163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - #163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - #163257 (abby DSL: sanity checks on forall where clauses)
 - #163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - #163908 (Update Enzyme submodule)
 - #163935 (Use BasicBlock::start_location and Location::START)
 - #163949 (disable next-solver with higher-ranked-assumptions)
 - #163951 (relax_elf_relocations is x86-only)
 - #163968 (Remove needs-triage label from relnotes issues)
@rust-bors
rust-bors Bot merged commit 69e3c1e into rust-lang:main Oct 8, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 8, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 8, 2026
Rollup merge of #163028 - sgasho:enzyme-wrapper-cleanup, r=ZuseZ4

autodiff: fix sysroot candidates in libEnzyme not found error

fix: #160335 (comment)

Before

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23` folder in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib
    |
    = note: it will be distributed via rustup in the future
```

After: points out the right candidate dir

```shell
RUSTFLAGS="-Zautodiff=Enable" cargo +enzyme run --release
info: `cargo` is unavailable for the active toolchain
info: falling back to "/home/gh-sgasho/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo"
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-sgasho/.rustup/toolchains/enzyme/bin/rustc - --crate-name ___ --print=file-names -Zautodiff=Enable --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stderr
  error: autodiff backend not found in the sysroot: failed to find a `libEnzyme-23.so` in the sysroot candidates:
         * /home/gh-sgasho/rust-worktrees/enzyme-wrapper-cleanup/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib
    |
    = note: it will be distributed via rustup in the future
```

I also verified that sample autodiff code ran successfully using local build, without breaking anything.

r? @ZuseZ4
makai410 pushed a commit to makai410/rustc_public that referenced this pull request Oct 9, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#162741 (codegen: tell LLVM that the discriminant is a power of two)
 - rust-lang/rust#162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - rust-lang/rust#163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - rust-lang/rust#163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - rust-lang/rust#163257 (abby DSL: sanity checks on forall where clauses)
 - rust-lang/rust#163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - rust-lang/rust#163908 (Update Enzyme submodule)
 - rust-lang/rust#163935 (Use BasicBlock::start_location and Location::START)
 - rust-lang/rust#163949 (disable next-solver with higher-ranked-assumptions)
 - rust-lang/rust#163951 (relax_elf_relocations is x86-only)
 - rust-lang/rust#163968 (Remove needs-triage label from relnotes issues)
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Oct 12, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#162741 (codegen: tell LLVM that the discriminant is a power of two)
 - rust-lang/rust#162758 (Split PassMode::IndirectUnsized out of PassMode::Indirect)
 - rust-lang/rust#163931 (Move `loop_hint_attrs` from `Terminator` into `TerminatorKind::Goto`)
 - rust-lang/rust#163028 (autodiff: fix sysroot candidates in libEnzyme not found error)
 - rust-lang/rust#163257 (abby DSL: sanity checks on forall where clauses)
 - rust-lang/rust#163841 ([rustdoc] Fix more `incoherent_impl` linking)
 - rust-lang/rust#163908 (Update Enzyme submodule)
 - rust-lang/rust#163935 (Use BasicBlock::start_location and Location::START)
 - rust-lang/rust#163949 (disable next-solver with higher-ranked-assumptions)
 - rust-lang/rust#163951 (relax_elf_relocations is x86-only)
 - rust-lang/rust#163968 (Remove needs-triage label from relnotes issues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. F-autodiff `#![feature(autodiff)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

3 participants