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

busybox-sandbox-shell: replace pkgsStatic with useMusl #314845

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
szlend marked this conversation as resolved.
Show resolved Hide resolved

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;
szlend marked this conversation as resolved.
Show resolved Hide resolved
};

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

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

Expand Down