Skip to content

Fix project building with clang 23.1.4 - #882

Merged
yogthos merged 9 commits into
dirge-code:mainfrom
cycl1st:main
Nov 3, 2026
Merged

yogthos merged 9 commits into
dirge-code:mainfrom
cycl1st:main

Conversation

@cycl1st

@cycl1st cycl1st commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Hello. In my Arch Linux setup with:

$ clang --version
clang version 23.1.4
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ llvm-config --version
23.1.4

$ cat /etc/os-release | head -4
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling

$ rustc --version
rustc 1.99.1 (58cf8f9c3 2026-10-13)

building of dirge was failed with a lot of errors like this:

Compiling html2text v0.17.4
   Compiling janetrs v0.8.0
error[E0560]: struct `evil_janet::JanetRegExt` has no field named `name`
   --> /home/agent/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/janetrs-0.8.0/src/env.rs:144:17
    |
144 |                 name,
    |                 ^^^^ `evil_janet::JanetRegExt` does not have this field
    |
    = note: available fields are: `_address`

error[E0560]: struct `evil_janet::JanetRegExt` has no field named `cfun`
   --> /home/agent/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/janetrs-0.8.0/src/env.rs:145:17
    |
145 |                 cfun: Some(cfun_opt.value),
    |                 ^^^^ `evil_janet::JanetRegExt` does not have this field
    |
    = note: available fields are: `_address`

error[E0560]: struct `evil_janet::JanetRegExt` has no field named `documentation`
   --> /home/agent/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/janetrs-0.8.0/src/env.rs:146:17
    |
146 |                 documentation: doc,
    |                 ^^^^^^^^^^^^^ `evil_janet::JanetRegExt` does not have this field
    |
    = note: available fields are: `_address`

error[E0560]: struct `evil_janet::JanetRegExt` has no field named `source_file`
   --> /home/agent/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/janetrs-0.8.0/src/env.rs:147:17
    |
147 |                 source_file,
    |                 ^^^^^^^^^^^ `evil_janet::JanetRegExt` does not have this field
    |
    = note: available fields are: `_address`
...

After some testing I found that bindgen v0.70.0 works incorrectly (at least with clang 23.1.4):

bindgen csrc/janet.h --allowlist-type 'JanetReg.*' | grep -A5 'pub struct JanetReg'
pub struct JanetReg {
    pub _address: u8,
}
...

bindgen v0.73.2 works propertly:

bindgen csrc/janet.h --allowlist-type 'JanetReg.*' | head -30
/* automatically generated by rust-bindgen 0.73.2 */

#[repr(C)]
#[derive(Copy, Clone)]
pub union Janet {
    pub u64_: u64,
    pub i64_: i64,
    pub number: f64,
    pub pointer: *mut ::std::os::raw::c_void,
}
...

So this PR just update bindgen version and little fix for eliminating message about deprecated constant usage. Changes in Cargo.lock generated by command cargo update -p bindgen -p prettyplease.

@yogthos

yogthos commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks looks good.

cycl1st and others added 5 commits November 3, 2026 18:45
Keep main's getrandom 0.4.3 / windows-core 0.62.2 / pageant 0.2.3 pins
from dirge-code#868/dirge-code#879; only bindgen's own subtree moves.
bindgen 0.73 resolves syn >=2,<4 to syn 3, whose parse_quote output
only prettyplease 0.3 can unparse.
@yogthos

yogthos commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the diagnosis — confirming the bindgen 0.70 opaque-struct bug against clang 23 and moving to 0.73 is the right fix.

I pushed a few adjustments on top (same branch):

  • Rebuilt Cargo.lock minimally so only bindgen's subtree moves: the previous cargo update also downgraded getrandom (0.4.3→0.3.4), windows-core (0.62.2→0.61.2) and reverted pageant to 0.2.3 — silently undoing main's advisory pins from fix(deps): russh 0.63.3 and pageant 0.2.3 for the OSV advisories #868/Add Cheaper Inference provider #879.
  • Kept your russh 0.65.1 bump (fixes the 4 OSV GHSAs) and restored pulldown-cmark 0.13.6 (RUSTSEC-2026-0433), plus pageant 0.2.5 (GHSA-662x-8wvj-2276).
  • Bumped prettyplease to 0.3.0: bindgen 0.73 resolves its syn >=2,<4 range to syn 3, and prettyplease 0.2 can't unparse syn-3 token streams.

Verified locally: full build (default, plugin, sandbox-microvm), fmt, clippy, 5972 bin + 498 lib tests, cargo audit + osv-scanner clean. CI green including windows-default, sandbox-microvm and Nix.

@yogthos
yogthos merged commit 95188e4 into dirge-code:main Nov 3, 2026
17 checks passed
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.

2 participants