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: glibcLocales with trivial replaceStdenv #358004

Open
dylex opened this issue Nov 21, 2024 · 0 comments
Open

Build failure: glibcLocales with trivial replaceStdenv #358004

dylex opened this issue Nov 21, 2024 · 0 comments
Labels
0.kind: build failure A package fails to build

Comments

@dylex
Copy link
Contributor

dylex commented Nov 21, 2024

Steps To Reproduce

We've been using a simple formula to modify glibc in stdenv for a while, that looks like this:

nixpkgs {
  config = {
    replaceStdenv = { pkgs }: pkgs.stdenv.override {
      overrides = self: super: {
        #glibc = ...
      };
    };
  };
} 

This was working in 24.05 but now in 24.11 and master, it fails in building glibcLocales. We modify various other things in this override, but even with the simplest empty overrides above it fails.

Build log

Build Log
make  -C localedata install-locales
make[2]: Entering directory '/dev/shm/nix-build-glibc-locales-2.40-36.drv-1/glibc-2.40/localedata'
Makefile:567: target 'install-archive-C.UTF-8/UTF-8' given more than once in the same rule
Makefile:571: target 'install-files-C.UTF-8/UTF-8' given more than once in the same rule
.././scripts/mkinstalldirs /mnt/sw/nix/store/62n1s3m08x41zs9jpf64nm3kxvfcgqsr-glibc-locales-2.40-36/lib/locale
mkdir -p -- /mnt/sw/nix/store/62n1s3m08x41zs9jpf64nm3kxvfcgqsr-glibc-locales-2.40-36/lib/locale
aa_DJ.UTF-8...cannot create temporary file: /dev/shm/nix-build-glibc-locales-2.40-36.drv-1/mnt/sw/nix/store/x06immnwbfpr7cgl8msn8m273i90b43v-glibc-2.40-36/lib/locale/locale-archive.moyDRP: No such file or directory
make[2]: *** [Makefile:568: install-archive-aa_DJ.UTF-8/UTF-8] Error 1

Additional context

pkgs/development/libraries/glibc/locales.nix does this:

 42       preBuild =
 43         (previousAttrs.preBuild or "")
 44         + ''
 45           # Awful hack: `localedef' doesn't allow the path to `locale-archive'
 46           # to be overriden, but you *can* specify a prefix, i.e. it will use
 47           # <prefix>/<path-to-glibc>/lib/locale/locale-archive.  So we use
 48           # $TMPDIR as a prefix, meaning that the locale-archive is placed in
 49           # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
 50           LOCALEDEF_FLAGS+=" --prefix=$TMPDIR"
 51
 52           mkdir -p $TMPDIR/"${buildPackages.glibc.out}/lib/locale"

The buildPackages.glibc.out here ends up being a different glibc at some point than this package install is using. I don't qite unedrstand the details, but the temporary install directory does exist, but with a different hash than the one it's trying to use above.

This is not new code, so something must have changed about how the custom stdenv works. Do we need to use replaceStdenv differently?

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.97.1.fi, Rocky Linux, 8.10 (Green Obsidian), nobuild`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`

Notify maintainers

@dylex dylex added the 0.kind: build failure A package fails to build label Nov 21, 2024
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

No branches or pull requests

1 participant