NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.17k forks source link

Build failure: drbd-utils #277921

Closed birkb closed 10 months ago

birkb commented 10 months ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. clone and checkout https://github.com/birkb/nixpkgs/tree/drbd-kernel-module
  2. export NIXPKGS=/home/user/nixpkgs
  3. nix-build $NIXPKGS -A drbd-utils

Build log

these 3 derivations will be built:
  /nix/store/2a4v0gvj65c6rjn89bgm6xlb8wm8hgz2-drbd-utils-9.27.0.drv
  /nix/store/djsmrl37m7qs2j9cac87wjrnd8mj591d-ocf-resource-agents.drv
  /nix/store/sanl8fjfnc1qwqwxzjqc030jxn58hizr-drbd-utils-9.27.0.drv
building '/nix/store/2a4v0gvj65c6rjn89bgm6xlb8wm8hgz2-drbd-utils-9.27.0.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/m6qc3bxh9kibdw9k6knp6bfdw1iqgq79-drbd-utils-9.27.0.tar.gz
source root is drbd-utils-9.27.0
setting SOURCE_DATE_EPOCH to timestamp 1703246308 of file drbd-utils-9.27.0/drbd-utils.spdx
Running phase: patchPhase
patching script interpreter paths in .
./scripts/drbd-overview.pl: interpreter directive changed from "#!/usr/bin/perl" to "/nix/store/fx9hkrym88ahxkibcqnkl8907vakbqvg-perl-5.38.2/bin/perl"
./scripts/stonith_admin-fence-peer.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/notify.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbd-service-shim.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbd: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/VCS/DRBDConfigure/offline: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/VCS/DRBDConfigure/monitor: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/VCS/DRBDConfigure/online: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/VCS/DRBDPrimary/offline: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/VCS/DRBDPrimary/monitor: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/VCS/DRBDPrimary/online: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./scripts/crm-fence-peer.9.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbddisk: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/ocf.ra.wrapper.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbd.sh.rhcs: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/crm-fence-peer.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/block-drbd: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/outdate-peer.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbd.ocf: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbd-wait-promotable.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/drbd-attr: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./scripts/snapshot-resync-target-lvm.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./tests/run.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./autogen.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
./user/shared/drbd_buildtag.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
substituteStream(): WARNING: pattern 'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd' doesn't match anything in file 'documentation/ra2refentry.xsl'
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
build flags: -j4 SHELL=/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash SOURCE_DATE_EPOCH=1 WANT_DRBD_REPRODUCIBLE_BUILD=1
make: *** No targets specified and no makefile found.  Stop.
error: builder for '/nix/store/2a4v0gvj65c6rjn89bgm6xlb8wm8hgz2-drbd-utils-9.27.0.drv' failed with exit code 2;
       last 10 log lines:
       > ./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
       > ./autogen.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh"
       > ./user/shared/drbd_buildtag.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash"
       > substituteStream(): WARNING: pattern 'http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd' doesn't match anything in file 'documentation/ra2refentry.xsl'
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > build flags: -j4 SHELL=/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash SOURCE_DATE_EPOCH=1 WANT_DRBD_REPRODUCIBLE_BUILD=1
       > make: *** No targets specified and no makefile found.  Stop.
       For full logs, run 'nix-store -l /nix/store/2a4v0gvj65c6rjn89bgm6xlb8wm8hgz2-drbd-utils-9.27.0.drv'.
error: 1 dependencies of derivation '/nix/store/djsmrl37m7qs2j9cac87wjrnd8mj591d-ocf-resource-agents.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sanl8fjfnc1qwqwxzjqc030jxn58hizr-drbd-utils-9.27.0.drv' failed to build

Additional context

Notify maintainers

@astro @ryantm

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.69, NixOS, 23.11 (Tapir), 23.11.2321.5ddac5872d39`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

birkb commented 10 months ago

I have added

ls -l configure
./configure --help

to the preConfigure variable and it returns this:

-rwxr-xr-x 1 nixbld nixbld 238402 Dec 22 09:45 configure
/nix/store/d4jf1cbbk494zwgbqz31pxgigpsbh6w2-stdenv-linux/setup: line 116: ./configure: Permission denied
/nix/store/d4jf1cbbk494zwgbqz31pxgigpsbh6w2-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context

This also does not happen in a manual nix-shell interactive test.

birkb commented 10 months ago
/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/sh ./configure --help

works properly within nix-build. Is something wrong with the bash version 5.2-p21 in the master branch compared with 5.2.15 used for 23.11?

astro commented 10 months ago

This would build for me:

diff --git pkgs/os-specific/linux/drbd/default.nix pkgs/os-specific/linux/drbd/default.nix
index 0c5acd0ac064..783a852dd4f4 100644
--- pkgs/os-specific/linux/drbd/default.nix
+++ pkgs/os-specific/linux/drbd/default.nix
@@ -11,6 +11,7 @@
 , nixosTests
 , perl
 , systemd
+, keyutils

 # drbd-utils are compiled twice, once with forOCF = true to extract
 # its OCF definitions for use in the ocf-resource-agents derivation,
@@ -22,11 +23,11 @@

 stdenv.mkDerivation rec {
   pname = "drbd";
-  version = "9.19.1";
+  version = "9.27.0";

   src = fetchurl {
     url = "https://pkg.linbit.com/downloads/drbd/utils/${pname}-utils-${version}.tar.gz";
-    sha256 = "1l99kcrb0j85wxxmrdihpx9bk1a4sdi7wlp5m1x5l24k8ck1m5cf";
+    sha256 = "sha256-WJE9JPhFcUJsAC/6YBr2XH6mcGa9IGbYRh9p9bLMjeM=";
   };

   nativeBuildInputs = [
@@ -34,6 +35,7 @@ stdenv.mkDerivation rec {
     libxslt
     docbook_xsl
     asciidoctor
+    keyutils
   ];

   buildInputs = [

I am not sure renaming the package isn't going to break anyone's usecase. :shrug:

birkb commented 10 months ago

Have you used the master branch or 23.11 to test that? Which bash version was used for the build?

I am not sure renaming the package isn't going to break anyone's usecase. 🤷

True that is a risk. I have only found the ocf-resource-agents package using drbd and i have updated it, but i would still break the configs of the users. Let's see if i can find a better way to have utils and optionally the driver.

astro commented 10 months ago

Branch master as of 3349a3d56d59

birkb commented 10 months ago

Thanks! I will check my build environment...

birkb commented 10 months ago

I had /tmp mounted with the noexec option. After disabling it the build works as expected.