Skip to content

Conversation

@ss2165
Copy link
Member

@ss2165 ss2165 commented Nov 19, 2025

Main change is opaque pointers not supported from llvm17 onwards.
This means passing pointer type around a lot.

Smaller changes:

  • New pass manager not supported by inkwell yet so call "mem2reg" using string run_passes interface
  • Indirect calls have to be handled separately from direct calls

Snap diffs are hard to see because of renaming, see commit update snaps for useful diffs

BREAKING CHANGE: LLVM support upgraded to LLVM20, a number of functions now take a type parameter for pointers.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.68%. Comparing base (ecc8bf0) to head (ffbe031).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2700      +/-   ##
==========================================
+ Coverage   83.53%   83.68%   +0.14%     
==========================================
  Files         266      266              
  Lines       51718    51505     -213     
  Branches    47184    46971     -213     
==========================================
- Hits        43202    43100     -102     
+ Misses       6136     6132       -4     
+ Partials     2380     2273     -107     
Flag Coverage Δ
python 91.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hugrbot
Copy link
Collaborator

hugrbot commented Nov 19, 2025

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary
    Building hugr v0.24.3 (current)
error: running cargo-doc on crate 'hugr' failed with output:
-----
 Compiling proc-macro2 v1.0.103
 Compiling unicode-ident v1.0.22
 Compiling quote v1.0.42
 Compiling libc v0.2.177
 Compiling serde_core v1.0.228
 Compiling shlex v1.3.0
 Compiling find-msvc-tools v0.1.5
 Compiling serde v1.0.228
 Compiling memchr v2.7.6
  Checking once_cell v1.21.3
 Compiling jobserver v0.1.34
 Compiling version_check v0.9.5
 Compiling cc v1.2.46
  Checking either v1.15.0
 Compiling syn v2.0.110
 Compiling autocfg v1.5.0
 Compiling num-traits v0.2.19
 Compiling semver v1.0.27
 Compiling crossbeam-utils v0.8.21
 Compiling hashbrown v0.16.0
 Compiling equivalent v1.0.2
 Compiling serde_derive v1.0.228
 Compiling pkg-config v0.3.32
 Compiling indexmap v2.12.0
 Compiling zstd-sys v2.0.16+zstd.1.5.7
 Compiling thiserror v2.0.17
 Compiling fnv v1.0.7
 Compiling ucd-trie v0.1.7
 Compiling ident_case v1.0.1
 Compiling strsim v0.11.1
 Compiling lazy_static v1.5.0
 Compiling anyhow v1.0.100
 Compiling darling_core v0.21.3
 Compiling pest v2.8.3
 Compiling thiserror-impl v2.0.17
 Compiling typeid v1.0.3
  Checking foldhash v0.1.5
  Checking smallvec v1.15.1
 Compiling radium v0.7.0
  Checking hashbrown v0.15.5
  Checking crossbeam-epoch v0.9.18
 Compiling darling_macro v0.21.3
 Compiling pest_meta v2.8.3
 Compiling slotmap_fork_lmondada v1.0.8
 Compiling paste v1.0.15
  Checking fixedbitset v0.5.7
 Compiling ref-cast v1.0.25
  Checking itoa v1.0.15
  Checking ryu v1.0.20
 Compiling thiserror v1.0.69
 Compiling zstd-safe v7.2.4
  Checking pin-project-lite v0.2.16
 Compiling erased-serde v0.4.9
 Compiling zerocopy v0.8.27
  Checking tap v1.0.1
 Compiling rayon-core v1.13.0
 Compiling unicode-xid v0.2.6
 Compiling serde_json v1.0.145
  Checking cfg-if v1.0.4
  Checking wyz v0.5.1
 Compiling derive_more-impl v2.0.1
  Checking petgraph v0.8.3
 Compiling pest_generator v2.8.3
 Compiling darling v0.21.3
  Checking crossbeam-deque v0.8.6
 Compiling ref-cast-impl v1.0.25
 Compiling thiserror-impl v1.0.69
 Compiling serde_derive_internals v0.29.1
  Checking aho-corasick v1.1.4
  Checking itertools v0.14.0
 Compiling ahash v0.8.12
 Compiling winnow v0.7.13
  Checking rustc-hash v2.1.1
  Checking arrayvec v0.5.2
  Checking unicode-width v0.2.2
 Compiling typetag v0.2.21
 Compiling cgmath v0.18.0
 Compiling convert_case v0.4.0
  Checking typed-arena v2.0.2
 Compiling regex-lite v0.1.8
  Checking regex-syntax v0.8.8
  Checking funty v2.0.0
  Checking byteorder v1.5.0
 Compiling heck v0.5.0
  Checking bitvec v1.0.1
  Checking regex-automata v0.4.13
 Compiling strum_macros v0.27.2
  Checking fxhash v0.2.1
 Compiling llvm-sys v201.0.1
  Checking pretty v0.12.5
 Compiling derive_more v0.99.20
 Compiling toml_parser v1.0.4
  Checking derive_more v2.0.1
 Compiling schemars_derive v1.1.0
 Compiling pest_derive v2.8.3
 Compiling serde_with_macros v3.16.0
  Checking ordered-float v5.1.0
  Checking approx v0.4.0
 Compiling typetag-impl v0.2.21
 Compiling tracing-attributes v0.1.30
 Compiling delegate v0.13.5
 Compiling derive-where v1.6.0
 Compiling rustc_version v0.4.1
  Checking itertools v0.13.0
  Checking tracing-core v0.1.34
  Checking smol_str v0.3.4
  Checking dyn-clone v1.0.20
  Checking bumpalo v3.19.0
  Checking inventory v0.3.21
  Checking base64 v0.22.1
 Compiling toml_datetime v0.7.3
 Compiling parking_lot_core v0.9.12
  Checking utf8-width v0.1.7
  Checking unsafe-libyaml v0.2.11
  Checking capnp v0.23.0
 Compiling enum_dispatch v0.3.13
  Checking serde_yaml v0.9.34+deprecated
  Checking hugr-model v0.24.3 (/home/runner/work/hugr/hugr/PR_BRANCH/hugr-model)
  Checking html-escape v0.2.13
 Compiling toml_edit v0.23.7
  Checking schemars v1.1.0
  Checking relrc v0.5.0
  Checking tracing v0.1.41
 Compiling rstest_macros v0.26.1
  Checking portgraph v0.15.2
  Checking serde_with v3.16.0
  Checking rayon v1.11.0
  Checking strum v0.27.2
  Checking regex v1.12.2
 Compiling pastey v0.1.1
  Checking zstd v0.13.3
 Compiling fixedbitset v0.4.2
  Checking static_assertions v1.1.0
  Checking downcast-rs v2.0.2
  Checking scopeguard v1.2.0
  Checking allocator-api2 v0.2.21
  Checking hugr-core v0.24.3 (/home/runner/work/hugr/hugr/PR_BRANCH/hugr-core)
  Checking lock_api v0.4.14
  Checking hashbrown v0.14.5
 Compiling petgraph v0.6.5
 Compiling proc-macro-crate v3.4.0
 Compiling ascent_base v0.8.0
 Compiling futures-macro v0.3.31
 Compiling derive-syn-parse v0.2.0
  Checking pin-utils v0.1.0
 Compiling glob v0.3.3
  Checking futures-core v0.3.31
  Checking slab v0.4.11
 Compiling duplicate v2.0.1
 Compiling inkwell v0.7.1
  Checking futures-task v0.3.31
 Compiling relative-path v1.9.3
  Checking dashmap v5.5.3
  Checking futures-util v0.3.31
 Compiling ascent_macro v0.8.0
error: No suitable version of LLVM was found system-wide or pointed
            to by LLVM_SYS_201_PREFIX.
     
            Consider using `llvmenv` to compile an appropriate copy of LLVM, and
            refer to the llvm-sys documentation for more information.
     
            llvm-sys: https://crates.io/crates/llvm-sys
            llvmenv: https://crates.io/crates/llvmenv
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/llvm-sys-201.0.1/src/lib.rs:533:1
  |
533 | / std::compile_error!(concat!(
534 | |     "No suitable version of LLVM was found system-wide or pointed
535 | |        to by LLVM_SYS_",
536 | |     env!("CARGO_PKG_VERSION_MAJOR"),
...   |
543 | |        llvmenv: https://crates.io/crates/llvmenv"
544 | | ));
  | |__^

error: could not compile `llvm-sys` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

-----

error: failed to build rustdoc for crate hugr v0.24.3
note: this is usually due to a compilation error in the crate,
    and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the error:
    cargo new --lib example &&
        cd example &&
        echo '[workspace]' >> Cargo.toml &&
        cargo add --path /home/runner/work/hugr/hugr/PR_BRANCH/hugr --features declarative,default,hugr-llvm,hugr-persistent,llvm,llvm-test,persistent_unstable,zstd &&
        cargo check &&
        cargo doc

  Building hugr-cli v0.24.3 (current)
     Built [  21.478s] (current)
   Parsing hugr-cli v0.24.3 (current)
    Parsed [   0.009s] (current)
  Building hugr-cli v0.24.3 (baseline)
     Built [  19.965s] (baseline)
   Parsing hugr-cli v0.24.3 (baseline)
    Parsed [   0.010s] (baseline)
  Checking hugr-cli v0.24.3 -> v0.24.3 (assume minor change)
   Checked [   0.014s] 159 checks: 159 pass, 41 skip
   Summary no semver update required
  Finished [  43.664s] hugr-cli
  Building hugr-core v0.24.3 (current)
     Built [  16.914s] (current)
   Parsing hugr-core v0.24.3 (current)
    Parsed [   0.080s] (current)
  Building hugr-core v0.24.3 (baseline)
     Built [  16.977s] (baseline)
   Parsing hugr-core v0.24.3 (baseline)
    Parsed [   0.075s] (baseline)
  Checking hugr-core v0.24.3 -> v0.24.3 (assume minor change)
   Checked [   0.165s] 159 checks: 159 pass, 41 skip
   Summary no semver update required
  Finished [  35.657s] hugr-core
  Building hugr-llvm v0.24.3 (current)
error: running cargo-doc on crate 'hugr-llvm' failed with output:
-----
 Compiling proc-macro2 v1.0.103
 Compiling unicode-ident v1.0.22
 Compiling quote v1.0.42
 Compiling serde_core v1.0.228
 Compiling serde v1.0.228
 Compiling memchr v2.7.6
 Compiling semver v1.0.27
 Compiling autocfg v1.5.0
 Compiling anyhow v1.0.100
 Compiling find-msvc-tools v0.1.5
 Compiling num-traits v0.2.19
 Compiling shlex v1.3.0
  Checking once_cell v1.21.3
 Compiling cc v1.2.46
 Compiling syn v2.0.110
  Checking either v1.15.0
 Compiling ident_case v1.0.1
  Checking hashbrown v0.16.0
 Compiling fnv v1.0.7
 Compiling thiserror v2.0.17
 Compiling strsim v0.11.1
 Compiling libc v0.2.177
 Compiling ucd-trie v0.1.7
 Compiling serde_derive v1.0.228
  Checking equivalent v1.0.2
 Compiling darling_core v0.21.3
 Compiling pest v2.8.3
  Checking indexmap v2.12.0
 Compiling thiserror-impl v2.0.17
 Compiling version_check v0.9.5
 Compiling winnow v0.7.13
 Compiling radium v0.7.0
 Compiling typeid v1.0.3
  Checking foldhash v0.1.5
 Compiling regex-lite v0.1.8
 Compiling lazy_static v1.5.0
  Checking hashbrown v0.15.5
 Compiling llvm-sys v201.0.1
 Compiling toml_parser v1.0.4
 Compiling slotmap_fork_lmondada v1.0.8
 Compiling pest_meta v2.8.3
 Compiling darling_macro v0.21.3
 Compiling rustc_version v0.4.1
 Compiling aho-corasick v1.1.4
 Compiling erased-serde v0.4.9
 Compiling toml_datetime v0.7.3
 Compiling ref-cast v1.0.25
 Compiling regex-syntax v0.8.8
  Checking pin-project-lite v0.2.16
  Checking fixedbitset v0.5.7
 Compiling unicode-xid v0.2.6
  Checking tap v1.0.1
 Compiling serde_json v1.0.145
 Compiling thiserror v1.0.69
 Compiling derive_more-impl v2.0.1
 Compiling regex-automata v0.4.13
  Checking wyz v0.5.1
  Checking petgraph v0.8.3
 Compiling toml_edit v0.23.7
 Compiling rstest_macros v0.26.1
 Compiling pest_generator v2.8.3
 Compiling darling v0.21.3
 Compiling ref-cast-impl v1.0.25
 Compiling thiserror-impl v1.0.69
 Compiling serde_derive_internals v0.29.1
  Checking itertools v0.14.0
 Compiling typetag v0.2.21
 Compiling cgmath v0.18.0
  Checking itoa v1.0.15
  Checking arrayvec v0.5.2
 Compiling convert_case v0.4.0
  Checking typed-arena v2.0.2
  Checking byteorder v1.5.0
 Compiling heck v0.5.0
  Checking ryu v1.0.20
  Checking funty v2.0.0
  Checking unicode-width v0.2.2
  Checking bitvec v1.0.1
  Checking pretty v0.12.5
  Checking fxhash v0.2.1
 Compiling strum_macros v0.27.2
 Compiling derive_more v0.99.20
  Checking derive_more v2.0.1
 Compiling schemars_derive v1.1.0
 Compiling pest_derive v2.8.3
 Compiling serde_with_macros v3.16.0
 Compiling proc-macro-crate v3.4.0
 Compiling regex v1.12.2
  Checking ordered-float v5.1.0
 Compiling futures-macro v0.3.31
 Compiling derive-where v1.6.0
 Compiling tracing-attributes v0.1.30
 Compiling typetag-impl v0.2.21
 Compiling delegate v0.13.5
  Checking itertools v0.13.0
  Checking approx v0.4.0
  Checking tracing-core v0.1.34
  Checking smol_str v0.3.4
  Checking pin-utils v0.1.0
  Checking inventory v0.3.21
  Checking bumpalo v3.19.0
  Checking smallvec v1.15.1
  Checking capnp v0.23.0
 Compiling cfg-if v1.0.4
  Checking futures-core v0.3.31
  Checking slab v0.4.11
  Checking utf8-width v0.1.7
 Compiling inkwell v0.7.1
  Checking rustc-hash v2.1.1
 Compiling glob v0.3.3
  Checking dyn-clone v1.0.20
  Checking base64 v0.22.1
  Checking futures-task v0.3.31
 Compiling relative-path v1.9.3
  Checking hugr-model v0.24.3 (/home/runner/work/hugr/hugr/PR_BRANCH/hugr-model)
  Checking futures-util v0.3.31
 Compiling enum_dispatch v0.3.13
  Checking schemars v1.1.0
  Checking html-escape v0.2.13
  Checking portgraph v0.15.2
  Checking tracing v0.1.41
  Checking relrc v0.5.0
  Checking serde_with v3.16.0
  Checking strum v0.27.2
  Checking console v0.15.11
error: No suitable version of LLVM was found system-wide or pointed
            to by LLVM_SYS_201_PREFIX.
     
            Consider using `llvmenv` to compile an appropriate copy of LLVM, and
            refer to the llvm-sys documentation for more information.
     
            llvm-sys: https://crates.io/crates/llvm-sys
            llvmenv: https://crates.io/crates/llvmenv
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/llvm-sys-201.0.1/src/lib.rs:533:1
  |
533 | / std::compile_error!(concat!(
534 | |     "No suitable version of LLVM was found system-wide or pointed
535 | |        to by LLVM_SYS_",
536 | |     env!("CARGO_PKG_VERSION_MAJOR"),
...   |
543 | |        llvmenv: https://crates.io/crates/llvmenv"
544 | | ));
  | |__^

error: could not compile `llvm-sys` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

-----

error: failed to build rustdoc for crate hugr-llvm v0.24.3
note: this is usually due to a compilation error in the crate,
    and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the error:
    cargo new --lib example &&
        cd example &&
        echo '[workspace]' >> Cargo.toml &&
        cargo add --path /home/runner/work/hugr/hugr/PR_BRANCH/hugr-llvm --features default,insta,llvm20-1,portgraph,rstest,test-utils &&
        cargo check &&
        cargo doc

  Building hugr-model v0.24.3 (current)
     Built [   5.491s] (current)
   Parsing hugr-model v0.24.3 (current)
    Parsed [   0.015s] (current)
  Building hugr-model v0.24.3 (baseline)
     Built [   5.420s] (baseline)
   Parsing hugr-model v0.24.3 (baseline)
    Parsed [   0.015s] (baseline)
  Checking hugr-model v0.24.3 -> v0.24.3 (assume minor change)
   Checked [   0.025s] 159 checks: 159 pass, 41 skip
   Summary no semver update required
  Finished [  11.951s] hugr-model
  Building hugr-passes v0.24.3 (current)
     Built [  15.635s] (current)
   Parsing hugr-passes v0.24.3 (current)
    Parsed [   0.024s] (current)
  Building hugr-passes v0.24.3 (baseline)
     Built [  15.896s] (baseline)
   Parsing hugr-passes v0.24.3 (baseline)
    Parsed [   0.024s] (baseline)
  Checking hugr-passes v0.24.3 -> v0.24.3 (assume minor change)
   Checked [   0.030s] 159 checks: 159 pass, 41 skip
   Summary no semver update required
  Finished [  33.581s] hugr-passes
  Building hugr-persistent v0.3.4 (current)
     Built [  12.510s] (current)
   Parsing hugr-persistent v0.3.4 (current)
    Parsed [   0.007s] (current)
  Building hugr-persistent v0.3.4 (baseline)
     Built [  12.560s] (baseline)
   Parsing hugr-persistent v0.3.4 (baseline)
    Parsed [   0.007s] (baseline)
  Checking hugr-persistent v0.3.4 -> v0.3.4 (assume minor change)
   Checked [   0.012s] 159 checks: 159 pass, 41 skip
   Summary no semver update required
  Finished [  26.641s] hugr-persistent
error: aborting due to failure to build rustdoc for crate hugr v0.24.3

Main changes are needing to provide types when using opaque pointers


New pass manager is not supported by inkwell yet so have to call 
mem2reg via string interface.
@ss2165 ss2165 force-pushed the ss/push-zxypysnwkrkm branch from d9d35d8 to d7173a3 Compare November 20, 2025 14:34
@ss2165 ss2165 force-pushed the ss/push-zxypysnwkrkm branch from ab9eca4 to ffbe031 Compare November 20, 2025 14:52
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

Successfully merging this pull request may close these issues.

3 participants