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

libapparmor: Fix build with gnumake 4.3 #93288

Merged
merged 1 commit into from Jul 18, 2020
Merged

Conversation

srhb
Copy link
Contributor

@srhb srhb commented Jul 16, 2020

Fixes #93238 -- https://gitlab.com/apparmor/apparmor/-/issues/74

Initially I did a way more ugly quickfix, but I think this is the right solution right now. I am not familiar with apparmor, but the tests pass, and this is true to the upstream fix which will be included in the next version of apparmor.

@ofborg test hardened

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@srhb
Copy link
Contributor Author

srhb commented Jul 16, 2020

hmm, maybe it's not that bad, something like this (untested) could potentially work:

diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix
index afb6799fbaf..609bb409dc8 100644
--- a/pkgs/os-specific/linux/apparmor/default.nix
+++ b/pkgs/os-specific/linux/apparmor/default.nix
@@ -30,7 +30,16 @@ let
     sha256 = "03nislxccnbxld89giak2s8xa4mdbwscfxbdwhmw5qpvgz08dgwh";
   };
 
+  gnumake43Patch = fetchpatch {
+    url = "https://gitlab.com/apparmor/apparmor/-/merge_requests/465.patch";
+    name = "2-23-fix-build-with-make-4.3.patch";
+    sha256 = "0xw028iqp69j9mxv0kbwraplgkj5i5djdlgf0anpkc5cdbsf96r9";
+  };
+
   prePatchCommon = ''
+    patch -p1 < ${gnumake43Patch}
+    chmod a+x ./common/list_capabilities.sh ./common/list_af_names.sh
+    patchShebangs ./common/list_capabilities.sh ./common/list_af_names.sh
     substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${buildPackages.perl}/bin/pod2man"
     substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${buildPackages.perl}/bin/pod2html"
     substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${linuxHeaders}/include/linux/capability.h"

@srhb
Copy link
Contributor Author

srhb commented Jul 16, 2020

Went with the solution mentioned above. The alternative is still possible -- patching Make.rules according to the patch mentioned in the original upstream issue -- but this uses the actual merged patch and seems cleaner. hardened succeeds.

@srhb
Copy link
Contributor Author

srhb commented Jul 16, 2020

@ofborg test hardened

Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

vcunat added a commit that referenced this pull request Jul 18, 2020
@vcunat vcunat merged commit 8da4505 into NixOS:master Jul 18, 2020
@vcunat
Copy link
Member

vcunat commented Jul 18, 2020

I hackily avoided the huge rebuild for now and reverted that hack on staging: 6f8b1ae.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hardened tests started failing, blocking nixos-unstable
2 participants