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

Build failure: fh #331240

Closed
MisileLab opened this issue Jul 31, 2024 · 1 comment · Fixed by #331327
Closed

Build failure: fh #331240

MisileLab opened this issue Jul 31, 2024 · 1 comment · Fixed by #331327
Labels
0.kind: build failure A package fails to build

Comments

@MisileLab
Copy link
Contributor

Steps To Reproduce

Steps to reproduce the behavior:

  1. build fh

Build log

hydra can reproduce

Notify maintainers

@figsoda

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.2, NixOS, 24.11 (Vicuna), 24.11.20240731.c841bb4`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/bah149sa1nz43q8iwa042v5chlh4hqqv-source`

Add a 👍 reaction to issues you find important.

@MisileLab MisileLab added the 0.kind: build failure A package fails to build label Jul 31, 2024
@ghpzin
Copy link
Contributor

ghpzin commented Jul 31, 2024

Hydra builds only fail on linux:
https://hydra.nixos.org/build/267623185 - x86_64-linux
https://hydra.nixos.org/build/267703181 - aarch64-linux
darwin is green:
https://hydra.nixos.org/build/267835084 - aarch64-darwin
https://hydra.nixos.org/build/267731828 - x86_64-darwin

Error:

error[E0425]: cannot find function `parse` in module `crate::ffi`
  --> /build/fh-0.1.10-vendor.tar.gz/nixel/src/parse.rs:23:39
   |
23 |     let parsed = unsafe { crate::ffi::parse(input.as_mut_ptr(), len) };
   |                                       ^^^^^ not found in `crate::ffi`
   |
help: consider importing this function through its public re-export
   |
5  + use crate::parse;
   |
help: if you import `parse`, refer to it directly
   |
23 -     let parsed = unsafe { crate::ffi::parse(input.as_mut_ptr(), len) };
23 +     let parsed = unsafe { parse(input.as_mut_ptr(), len) };
   |

For more information about this error, try `rustc --explain E0425`.
error: could not compile `nixel` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Comes from nixel (somehow there is no 5.2.0 in repo):
https://github.com/kamadorueda/nixel/blob/a4d7ccfd2a5ce28b6ffdc2ed0dd3f6c339b2357f/src/parse.rs#L23
https://github.com/kamadorueda/nixel/blob/a4d7ccfd2a5ce28b6ffdc2ed0dd3f6c339b2357f/src/ffi.rs#L9
which should have bindgen generated bindings:
https://github.com/kamadorueda/nixel/blob/a4d7ccfd2a5ce28b6ffdc2ed0dd3f6c339b2357f/build.rs#L19-L31
Looking at what it generates it from:
https://github.com/kamadorueda/nixel/blob/a4d7ccfd2a5ce28b6ffdc2ed0dd3f6c339b2357f/src/types.hh#L289-L291

extern "C" {
Parsed* parse(unsigned char* input, size_t len);
}

It seems to be this bindgen issue with clang_18 - rust-lang/rust-bindgen#2689

Previous builds on linux used clang_17 (under rust-bindgen-hook in tree):
https://hydra.nixos.org/build/265195107#tabs-build-deps
currently linux uses clang_18, darwin - clang_16

Fix should be in bindgen version 0.69.2+
fh updated Cargo.lock past that version ~18h ago (2024-07-30T18:10:58.000Z) in v0.1.15:
https://github.com/DeterminateSystems/fh/blob/v0.1.15/Cargo.lock#L272
DeterminateSystems/fh@a592ab5

So update to it (or patch to Cargo.lock with bindgen version) in nixpkgs should fix build.


Edit:
v0.1.15 does not pass tests and build fails, log:
https://gist.github.com/ghpzin/507c7936de5e083bc7b18e35a5220cf0

Cargo.lock patch from cargo update bindgen with current version seems to build:

Cargo.lock patch
diff --git a/Cargo.lock b/Cargo.lock
index 5c597e1..a261ce5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -250,16 +250,16 @@ checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2"
 
 [[package]]
 name = "bindgen"
-version = "0.68.1"
+version = "0.69.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078"
+checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
 dependencies = [
  "bitflags 2.4.0",
  "cexpr",
  "clang-sys",
+ "itertools",
  "lazy_static",
  "lazycell",
- "peeking_take_while",
  "proc-macro2",
  "quote",
  "regex",
@@ -538,6 +538,12 @@ version = "1.0.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd"
 
+[[package]]
+name = "either"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
+
 [[package]]
 name = "encode_unicode"
 version = "0.3.6"
@@ -919,6 +925,15 @@ version = "2.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6"
 
+[[package]]
+name = "itertools"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
+dependencies = [
+ "either",
+]
+
 [[package]]
 name = "itoa"
 version = "1.0.9"
@@ -1162,12 +1177,6 @@ dependencies = [
  "windows-targets 0.48.5",
 ]
 
-[[package]]
-name = "peeking_take_while"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
-
 [[package]]
 name = "percent-encoding"
 version = "2.3.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants