Skip to content

libutil: fix linux build on fresh glibc and gcc#15011

Merged
xokdvium merged 1 commit intoNixOS:masterfrom
trofi:lixnu-openat-sysno
Jan 17, 2026
Merged

libutil: fix linux build on fresh glibc and gcc#15011
xokdvium merged 1 commit intoNixOS:masterfrom
trofi:lixnu-openat-sysno

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Jan 16, 2026

Without the change the build fails for me as:

../unix/file-descriptor.cc:404:70: error: 'RESOLVE_BENEATH' was not declared in this scope
  404 |         dirFd, path.rel_c_str(), flags, static_cast<uint64_t>(mode), RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS);
      |                                                                      ^~~~~~~~~~~~~~~

This happens for 2 reasons:

  1. __NR_openat2 constant was not pulled in from the according headers and as a result <linux/openat2.h> was not included.
  2. define HAVE_OPENAT2 0 build is broken: refers to missing RESOLVE_BENEATH normally pulled in from <linux/openat2.h>

This changes fixes both.

Motivation

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@trofi trofi requested a review from edolstra as a code owner January 16, 2026 22:56
@xokdvium xokdvium added the backport 2.33-maintenance Automatically creates a PR against the branch label Jan 16, 2026
@xokdvium
Copy link
Contributor

xokdvium commented Jan 16, 2026

build is broken: refers to missing RESOLVE_BENEATH normally

Hm, I guess the __linux__ ifdef can be replaced with HAVE_OPENAT2 then. Missed this somehow.

Without the change the build fails for me as:

    ../unix/file-descriptor.cc:404:70: error: 'RESOLVE_BENEATH' was not declared in this scope
      404 |         dirFd, path.rel_c_str(), flags, static_cast<uint64_t>(mode), RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS);
          |                                                                      ^~~~~~~~~~~~~~~

This happens for 2 reasons:
1. `__NR_openat2` constant was not pulled in from the according headers
   and as a result `<linux/openat2.h>` was not included.
2. `define HAVE_OPENAT2 0` build is broken: refers to missing
   `RESOLVE_BENEATH` normally pulled in from `<linux/openat2.h>`

This changes fixes both.
@trofi trofi force-pushed the lixnu-openat-sysno branch from c78f70c to 3256aba Compare January 17, 2026 13:01
@trofi
Copy link
Contributor Author

trofi commented Jan 17, 2026

build is broken: refers to missing RESOLVE_BENEATH normally

Hm, I guess the __linux__ ifdef can be replaced with HAVE_OPENAT2 then. Missed this somehow.

Sound good! Amended with the change to #if HAVR_OPENAT2.

@xokdvium
Copy link
Contributor

Also, how fresh of a glibc are we talking about?

@xokdvium xokdvium added this pull request to the merge queue Jan 17, 2026
Merged via the queue into NixOS:master with commit 054de38 Jan 17, 2026
15 checks passed
@internal-nix-ci
Copy link

Successfully created backport PR for 2.33-maintenance:

@trofi
Copy link
Contributor Author

trofi commented Jan 17, 2026

Also, how fresh of a glibc are we talking about?

glibc-2.42 here.

@xokdvium
Copy link
Contributor

xokdvium commented Jan 17, 2026

Oh, so we need to grab the patch on staging staging-next then?

@xokdvium
Copy link
Contributor

Grabbed the backport in NixOS/nixpkgs#481478

github-merge-queue bot pushed a commit to NixOS/nixpkgs that referenced this pull request Jan 19, 2026
Fixes a missing include on newer glibc 2.42 that is currently in
staging-next. See NixOS/nix#15011.
philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Feb 7, 2026
## Bug fixes

- Fix destruction of DerivationBuilder implementations (NixOS/nix#15072)
- Don't report cancelled goals as failures (NixOS/nix#14972)
- Fix `linux` build on fresh `glibc` and `gcc` (NixOS/nix#15011)

## S3 binary cache improvements

- Add AWS SSO support for S3 authentication (NixOS/nix#14645)
- Respect `AWS_PROFILE` environment variable (NixOS/nix#14645)
- Add STS support for default profile (NixOS/nix#14645)
- Skip `Accept-Encoding` header for S3 SigV4 requests (NixOS/nix#15048)
- Restart source before upload retries (NixOS/nix#15047)
- Route AWS CRT logs through Nix logger (NixOS/nix#15059)

The glibc 2.42 build fix patch is dropped as it is now included upstream.

https://github.com/NixOS/nix/releases/tag/2.33.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.33-maintenance Automatically creates a PR against the branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants