Skip to content

Comments

chore: bump nix inputs and implement tikv-jemalloc-sys build fix#9848

Closed
jyap808 wants to merge 1 commit intofoundry-rs:masterfrom
jyap808:nix-update-fix
Closed

chore: bump nix inputs and implement tikv-jemalloc-sys build fix#9848
jyap808 wants to merge 1 commit intofoundry-rs:masterfrom
jyap808:nix-update-fix

Conversation

@jyap808
Copy link

@jyap808 jyap808 commented Feb 10, 2025

Motivation

This PR fixes building on Nix/NixOS.

Bump inputs to the latest Rust toolchain.

Error:

$ cargo build
error: rustc 1.79.0 is not supported by the following packages:
  alloy-chains@0.1.59 requires rustc 1.81
  alloy-consensus@0.11.0 requires rustc 1.81
  alloy-consensus-any@0.11.0 requires rustc 1.81
  alloy-contract@0.11.0 requires rustc 1.81
  alloy-dyn-abi@0.8.20 requires rustc 1.81
  alloy-eip2124@0.1.0 requires rustc 1.81
<SNIP>

tikv-jemalloc-sys fails to build:

  --- stderr
  In file included from /nix/store/6aci60gk5wj4bjj1rygzbkc6ximmsm17-glibc-2.40-66-dev/include/bits/libc-header-start.h:33,
                   from /nix/store/6aci60gk5wj4bjj1rygzbkc6ximmsm17-glibc-2.40-66-dev/include/math.h:27,
                   from include/jemalloc/internal/jemalloc_internal_decls.h:4,
                   from include/jemalloc/internal/jemalloc_preamble.h:5,
                   from src/background_thread.c:1:
  /nix/store/6aci60gk5wj4bjj1rygzbkc6ximmsm17-glibc-2.40-66-dev/include/features.h:422:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
    422 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
        |    ^~~~~~~
  In file included from /nix/store/6aci60gk5wj4bjj1rygzbkc6ximmsm17-glibc-2.40-66-dev/include/bits/libc-header-start.h:33,
                   from /nix/store/6aci60gk5wj4bjj1rygzbkc6ximmsm17-glibc-2.40-66-dev/include/math.h:27,
                   from include/jemalloc/internal/jemalloc_internal_decls.h:4,
                   from include/jemalloc/internal/jemalloc_preamble.h:5,
                   from src/base.c:1:
  /nix/store/6aci60gk5wj4bjj1rygzbkc6ximmsm17-glibc-2.40-66-dev/include/features.h:422:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
<SNIP>

Solution

Bump Nix inputs to upgrade to latest Rust 1.84.1.

Implement CFLAGS workaround NixOS/nixpkgs#370494 (comment) which is an upstream build issue for tikv-jemalloc-sys.

Builds successfully now.

@zerosnacks
Copy link
Member

Hi @jyap808

Thanks for your PR 👍

I would like to aggregate the proposed changes into #10485 and, as expressed in #10316 (comment), this will supersede this PR.

Please join the conversation in #10485

@zerosnacks zerosnacks closed this May 13, 2025
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Foundry May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants