-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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: pkgsCross.armv7l-hf-multiplatform.fail2ban
#243132
Comments
Shouldn't be necessary. At least one issue is that the cross target error: builder for '/nix/store/q64zvj2kvkznw7js6p22x7q8qlg9vnnk-fail2ban-1.0.2-armv7l-unknown-linux-gnueabihf.drv' failed with exit code 1;
last 10 log lines:
> updateAutotoolsGnuConfigScriptsPhase
> configuring
> patching script interpreter paths in fail2ban-2to3
> fail2ban-2to3: interpreter directive changed from "#!/bin/bash" to "/nix/store/8fv91097mbh5049i9rglc73dx6kjg3qk-bash-5.2-p15/bin/bash"
> /nix/store/gmp0lbjab6x4vsc3cc6fjb5j2d4772ga-python3-armv7l-unknown-linux-gnueabihf-3.10.12/bin/2to3: line 2: import: command not found
> /nix/store/gmp0lbjab6x4vsc3cc6fjb5j2d4772ga-python3-armv7l-unknown-linux-gnueabihf-3.10.12/bin/2to3: line 3: from: command not found I don't know how this should be fixed though. Maybe related: #211340 |
Fix in #228139
|
Even after applying commit b7b911530adf8df23b8d323eb417fbef234a1a2e
Author: Artturin <[email protected]>
Date: Tue Jul 25 00:33:24 2023 +0300
fail2ban: Fix cross
diff --git a/pkgs/tools/security/fail2ban/default.nix b/pkgs/tools/security/fail2ban/default.nix
index 780f1b4dfb0c..a3ebec571e0d 100644
--- a/pkgs/tools/security/fail2ban/default.nix
+++ b/pkgs/tools/security/fail2ban/default.nix
@@ -25,7 +25,7 @@ python3.pkgs.buildPythonApplication rec {
];
preConfigure = ''
- patchShebangs fail2ban-2to3
+ patchShebangs --build fail2ban-2to3
./fail2ban-2to3
for i in config/action.d/sendmail*.conf; do
@@ -43,7 +43,7 @@ python3.pkgs.buildPythonApplication rec {
substituteInPlace setup.py --replace /usr/share/doc/ share/doc/
# see https://github.com/NixOS/nixpkgs/issues/4968
- ${python3.interpreter} setup.py install_data --install-dir=$out --root=$out
+ ${python3.pythonForBuild.interpreter} setup.py install_data --install-dir=$out --root=$out
'';
postInstall = it fails with
applying diff --git a/pkgs/tools/security/fail2ban/default.nix b/pkgs/tools/security/fail2ban/default.nix
index 780f1b4dfb0c..c661e507e58f 100644
--- a/pkgs/tools/security/fail2ban/default.nix
+++ b/pkgs/tools/security/fail2ban/default.nix
@@ -25,7 +25,9 @@ python3.pkgs.buildPythonApplication rec {
];
preConfigure = ''
- patchShebangs fail2ban-2to3
+ substituteInPlace fail2ban-2to3 \
+ --replace "2to3" "${python3.pythonForBuild}/bin/2to3"
+ patchShebangs --build fail2ban-2to3
./fail2ban-2to3
for i in config/action.d/sendmail*.conf; do
@@ -43,7 +45,7 @@ python3.pkgs.buildPythonApplication rec {
substituteInPlace setup.py --replace /usr/share/doc/ share/doc/
# see https://github.com/NixOS/nixpkgs/issues/4968
- ${python3.interpreter} setup.py install_data --install-dir=$out --root=$out
+ ${python3.pythonForBuild.interpreter} setup.py install_data --install-dir=$out --root=$out
'';
postInstall = Fails with the same error, So my PR does not cause it. Building with
|
Steps To Reproduce
Steps to reproduce the behavior:
nix-build <nixpkgs> -A pkgsCross.armv7l-hf-multiplatform.fail2ban
(qemu binfmt emulation must be enabled for armv7l-linux, otherwise a different error occurs when cross-compiling)Build log
Additional context
I originally came upon this error when trying to build a NixOS SD card image with the fail2ban service enabled. The issue is related to cross-compilation. I'm not an expert, but it looks like the cross-compiled
fail2ban
package tries to interact in some way with the host's x86_64 python package, which understandably isn't allowed, as that wouldn't work on the target system.Metadata
The text was updated successfully, but these errors were encountered: