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

flake.nix: postInstall on linux fails with "ContextCreate - An error occurred creating the http client: builder error" #659

Open
antifuchs opened this issue Jan 27, 2025 · 1 comment

Comments

@antifuchs
Copy link

I've just updated my flake inputs to the latest rev of dsc on this repo (a873d9b) and it looks like at that revision, the postInstall step for the built binary is failing (this is on my M1 macbook and a rosetta builder, but I've verified it on a real linux machine too):

:;    nix build .#packages.x86_64-linux.dsc
[2/635/638 built, 373 copied (3362.8/3362.9 MiB), 737.4/737.4 MiB DL] building dsc-deps-0.12.0-pre (buildPhase):    Compiling serde_derive v1.0.217^R
error: build of '/nix/store/f4vbjfa5vvcravd2lv0kyz99jr4nwxnl-dsc-0.12.0-pre.drv' on 'ssh-ng://rosetta-builder' failed: builder for '/nix/store/f4vbjfa5vvcravd2lv0kyz99jr4nwxnl-dsc-0.12.0-pre.drv' failed with exit code 2;
       last 25 log lines:
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > [naersk] cargo_version (read): 1.83.0 (5ffbef321 2024-10-29)
       > [naersk] cargo_message_format (set): json-diagnostic-rendered-ansi
       > [naersk] cargo_release: --release
       > [naersk] cargo_options:
       > [naersk] cargo_build_options: $cargo_release -j "$NIX_BUILD_CORES" --message-format=$cargo_message_format
       > [naersk] cargo_test_options: $cargo_release -j "$NIX_BUILD_CORES"
       > [naersk] RUST_TEST_THREADS: 8
       > [naersk] cargo_bins_jq_filter: select(.reason == "compiler-artifact" and .executable != null and .profile.test == false)
       > [naersk] cargo_build_output_json (created): /build/tmp.9Q7OdtLnBH
       > [naersk] RUSTFLAGS:
       > [naersk] CARGO_BUILD_RUSTFLAGS:
       > [naersk] CARGO_BUILD_RUSTFLAGS (updated):  --remap-path-prefix /nix/store/1p8sbpjv32yhhgw6qkrga2rfvpzs77fs-crates-io-dependencies=/sources --remap-path-prefix /nix/store/gx2rmn4950qmmq7ja38p5fkmp4a48544-git-dependencies=/sources
       > [naersk] pre-installing dep /nix/store/bssbj2dln4x9cr9az3s5pw42g6w68qqc-dsc-deps-0.12.0-pre
       > Running phase: buildPhase
       > cargo build $cargo_release -j "$NIX_BUILD_CORES" --message-format=$cargo_message_format
       > warning: `/build/source/.cargo-home/config` is deprecated in favor of `config.toml`
       > note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
       >    Compiling dsc v0.12.0-pre (/build/source)
       >     Finished `release` profile [optimized] target(s) in 20.86s
       > Running phase: installPhase
       > [naersk] Using file /build/tmp.9Q7OdtLnBH to retrieve build (executable) products
       > [naersk] found executable dsc -> /nix/store/43kv2abdmqjlgpkwd0cmkwjjc5rc84w6-dsc-0.12.0-pre/bin/dsc
       > ContextCreate - An error occurred creating the http client: builder error
       For full logs, run 'nix log /nix/store/f4vbjfa5vvcravd2lv0kyz99jr4nwxnl-dsc-0.12.0-pre.drv'.
error: builder for '/nix/store/f4vbjfa5vvcravd2lv0kyz99jr4nwxnl-dsc-0.12.0-pre.drv' failed with exit code 1

With a .overrideAttrs (old: {postInstall = "";}) this error goes away, and the derivation can be built again.

I'm not sure why it's only failing on linux (or what that error even indicates), but looks like something is off there.

@antifuchs antifuchs changed the title flake.nix: installPhase on linux fails with "ContextCreate - An error occurred creating the http client: builder error" flake.nix: postInstall on linux fails with "ContextCreate - An error occurred creating the http client: builder error" Jan 27, 2025
@eikek
Copy link
Member

eikek commented Jan 29, 2025

Thanks for reporting. This seems to be a problem creating the http client. Unfortunately, builder error is not very helpful :-/ I suspect that creating the client does some impure stuff now and this fails in the nix sandbox. outside, the post-install seems to work fine for me. In code it would be:

let client = Client::new(

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

No branches or pull requests

2 participants