Skip to content

Commit

Permalink
busybox-sandbox-shell: replace pkgsStatic with useMusl
Browse files Browse the repository at this point in the history
  • Loading branch information
szlend committed May 26, 2024
1 parent 3f99d04 commit 49eb8bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 8 additions & 1 deletion pkgs/os-specific/linux/busybox/sandbox-shell.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{ busybox}:
{ lib, stdenv, busybox, musl }:

# Minimal shell for use as basic /bin/sh in sandbox builds
busybox.override {
enableStatic = true;
enableMinimal = true;

useMusl =
# We could probably switch to `glibc.static` for GNU hosts. But historically
# we've linked it against `musl` and it has the added benefit of significantly
# bringing down the binary size.
stdenv.hostPlatform.isGnu && lib.meta.availableOn stdenv.hostPlatform musl;

extraConfig = ''
CONFIG_FEATURE_FANCY_ECHO y
CONFIG_FEATURE_SH_MATH y
Expand Down
8 changes: 2 additions & 6 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26891,12 +26891,8 @@ with pkgs;
bridge-utils = callPackage ../os-specific/linux/bridge-utils { };

busybox = callPackage ../os-specific/linux/busybox { };
busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix {
# musl roadmap has RISC-V support projected for 1.1.20
busybox = if !stdenv.hostPlatform.isRiscV && !stdenv.hostPlatform.isLoongArch64 && stdenv.hostPlatform.libc != "bionic"
then pkgsStatic.busybox
else busybox;
};

busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix { };

cachefilesd = callPackage ../os-specific/linux/cachefilesd { };

Expand Down

0 comments on commit 49eb8bd

Please sign in to comment.