Skip to content

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

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

Closed
wants to merge 1 commit into from

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:
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.81
  [email protected] 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