From 5d979b038935f0728cdee48072cce8679a56b984 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Wed, 24 Apr 2024 10:19:57 +0200 Subject: [PATCH] Build s390x binaries using musl libc Building using musl until NixOS/nixpkgs#306473 is resolved. Refers to cri-o/cri-o#7911 Signed-off-by: Sascha Grunert --- nix/default-s390x.nix | 5 ++++- nix/derivation.nix | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/nix/default-s390x.nix b/nix/default-s390x.nix index dc80f086..3be20a05 100644 --- a/nix/default-s390x.nix +++ b/nix/default-s390x.nix @@ -1,6 +1,9 @@ (import ./nixpkgs.nix { crossSystem = { - config = "s390x-unknown-linux-gnu"; + # TODO: Switch back to glibc when + # https://github.com/NixOS/nixpkgs/issues/306473 + # is resolved. + config = "s390x-unknown-linux-musl"; }; overlays = [ (import ./overlay.nix) ]; }).callPackage ./derivation.nix diff --git a/nix/derivation.nix b/nix/derivation.nix index c857e711..d8294d06 100644 --- a/nix/derivation.nix +++ b/nix/derivation.nix @@ -1,4 +1,6 @@ -{ pkgs }: +{ stdenv +, pkgs +}: with pkgs; stdenv.mkDerivation rec { name = "conmon"; src = ./..; @@ -12,10 +14,11 @@ with pkgs; stdenv.mkDerivation rec { pkg-config which ]; - buildInputs = [ - glib + buildInputs = lib.optionals (!stdenv.hostPlatform.isMusl) [ glibc glibc.static + ] ++ [ + glib libseccomp pcre2 ];