Repository navigation
Closed
Labels
0.kind: bugSomething is broken0.kind: build failureA package fails to build0.kind: regressionSomething that worked before working no longer
Description
Nixpkgs version
- Unstable (26.05)
Steps to reproduce
nix-build -A tests.wrapBinaryPackage.combination at an appropriate commit.
Can Hydra reproduce this build failure?
Yes, Hydra can reproduce this build failure.
Link to Hydra build job
Relevant log output
6d5
< #include <string.h>
10,31d8
< int is_surrounded_by_sep(char *env, char *ptr, unsigned long len, char *sep) {
< unsigned long sep_len = strlen(sep);
<
< // Check left side (if not at start)
< if (env != ptr) {
< if (ptr - env < sep_len)
< return 0;
< if (strncmp(sep, ptr - sep_len, sep_len) != 0) {
< return 0;
< }
< }
< // Check right side (if not at end)
< char *end_ptr = ptr + len;
< if (*end_ptr != '\0') {
< if (strncmp(sep, ptr + len, sep_len) != 0) {
< return 0;
< }
< }
<
< return 1;
< }
<
33,50c10,15
< char *existing_env = getenv(env);
< if (existing_env) {
< char *val;
<
< char *existing_suffix = strstr(existing_env, suffix);
< unsigned long suffix_len = strlen(suffix);
< // If the suffix already exists, remove the original
< if (existing_suffix && is_surrounded_by_sep(existing_env, existing_suffix, suffix_len, sep)) {
< char *end_ptr = existing_suffix + suffix_len;
< if (*end_ptr == '\0') {
< return;
< }
< unsigned long sep_len = strlen(sep);
< int n_before = existing_suffix - existing_env;
< assert_success(asprintf(&val, "%.*s%s%s%s",
< n_before, existing_env,
< existing_suffix + suffix_len + sep_len,
< sep, suffix));
---
> char *existing = getenv(env);
> if (existing) {
> char *val;
> assert_success(asprintf(&val, "%s%s%s", existing, sep, suffix));
> assert_success(setenv(env, val, 1));
> free(val);
52c17
< assert_success(asprintf(&val, "%s%s%s", existing_env, sep, suffix));
---
> assert_success(setenv(env, suffix, 1));
54,58d18
< assert_success(setenv(env, val, 1));
< free(val);
< } else {
< assert_success(setenv(env, suffix, 1));
< }Additional context
git bisect plus some manual digging indicates the failures are introduced by #451031.
System metadata
- system:
"aarch64-linux" - host os:
Linux 6.18.16, NixOS, 26.05 (Yarara), 26.05.20260328.8110df5 - multi-user?:
yes - sandbox:
relaxed - version:
nix-env (Nix) 2.31.3 - nixpkgs:
/nix/store/dj9rm8vy5k06wsy0793xa5q9whlf1rv5-source
Notify maintainers
Doesn't look like there are any maintainers :(
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this is a bug and not a support request.
- I assert that this is not a duplicate of an existing issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is broken0.kind: build failureA package fails to build0.kind: regressionSomething that worked before working no longer
Activity
me-and commentedon Mar 31, 2026
Got it: failure was introduced in #451031. Tagging the folk involved in that commit: @SuperSamus @K900
tests.makeBinaryWrapper: fix broken tests