bash: Make interactive by default (#379368)

K900 f81ec80f f7142288

Changed files
+48 -49
pkgs
by-name
gr
groff
li
libxo
development
interpreters
python
cpython
libraries
gettext
tools
misc
shells
bash
stdenv
darwin
freebsd
generic
linux
tools
compression
top-level
+2 -2
pkgs/by-name/gr/groff/package.nix
···
pkg-config,
texinfo,
bison,
-
bash,
+
bashNonInteractive,
}:
stdenv.mkDerivation rec {
···
buildInputs =
[
perl
-
bash
+
bashNonInteractive
]
++ lib.optionals enableGhostscript [
ghostscript
+2 -2
pkgs/by-name/li/libxo/package.nix
···
{
lib,
autoreconfHook,
-
bash,
+
bashNonInteractive,
libtool,
fetchFromGitHub,
nix-update-script,
···
buildInputs = [
autoreconfHook
# For patchShebangs in postInstall
-
bash
+
bashNonInteractive
perl
];
+4 -4
pkgs/development/interpreters/python/cpython/default.nix
···
, zlib
# platform-specific dependencies
-
, bash
+
, bashNonInteractive
, darwin
, windows
···
inherit nativeBuildInputs;
buildInputs = lib.optionals (!stdenv.hostPlatform.isWindows) [
-
bash # only required for patchShebangs
+
bashNonInteractive # only required for patchShebangs
] ++ buildInputs;
prePatch = optionalString stdenv.hostPlatform.isDarwin ''
···
postPatch = optionalString (!stdenv.hostPlatform.isWindows) ''
substituteInPlace Lib/subprocess.py \
-
--replace-fail "'/bin/sh'" "'${bash}/bin/sh'"
+
--replace-fail "'/bin/sh'" "'${bashNonInteractive}/bin/sh'"
'' + optionalString mimetypesSupport ''
substituteInPlace Lib/mimetypes.py \
--replace-fail "@mime-types@" "${mailcap}"
···
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
# Ensure we don't have references to build-time packages.
# These typically end up in shebangs.
-
pythonOnBuildForHost buildPackages.bash
+
pythonOnBuildForHost buildPackages.bashNonInteractive
];
separateDebugInfo = true;
+2 -2
pkgs/development/libraries/gettext/default.nix
···
lib,
fetchurl,
libiconv,
-
bash,
+
bashNonInteractive,
updateAutotoolsGnuConfigScriptsHook,
}:
···
];
buildInputs =
lib.optionals (!stdenv.hostPlatform.isMinGW) [
-
bash
+
bashNonInteractive
]
++ lib.optionals (!stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isCygwin) [
# HACK, see #10874 (and 14664)
+2 -2
pkgs/development/tools/misc/texinfo/common.nix
···
fetchurl,
perl,
libintl,
-
bash,
+
bashNonInteractive,
updateAutotoolsGnuConfigScriptsHook,
gnulib,
gawk,
···
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs =
[
-
bash
+
bashNonInteractive
libintl
]
++ optionals stdenv.hostPlatform.isSunOS [
+2 -2
pkgs/development/tools/misc/texinfo/packages.nix
···
fetchurl,
perl,
libintl,
-
bash,
+
bashNonInteractive,
updateAutotoolsGnuConfigScriptsHook,
gnulib,
gawk,
···
xz
libintl
libiconv
-
bash
+
bashNonInteractive
gnulib
gawk
freebsd
+5 -5
pkgs/shells/bash/5.nix
···
, bison
, util-linux
-
# patch for cygwin requires readline support
-
, interactive ? stdenv.hostPlatform.isCygwin
+
, interactive ? true
, readline
-
, withDocs ? false
-
, texinfo
+
, withDocs ? null
, forFHSEnv ? false
, pkgsStatic
···
inherit sha256;
});
in
+
lib.warnIf (withDocs != null) ''
+
bash: `.override { withDocs = true; }` is deprecated, the docs are always included.
+
''
stdenv.mkDerivation rec {
pname = "bash${lib.optionalString interactive "-interactive"}";
version = "5.2${patch_suffix}";
···
# Note: Bison is needed because the patches above modify parse.y.
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook bison ]
-
++ lib.optional withDocs texinfo
++ lib.optional stdenv.hostPlatform.isDarwin stdenv.cc.bintools;
buildInputs = lib.optional interactive readline;
+11 -11
pkgs/stdenv/darwin/default.nix
···
runtimeShell = prevStage.ccWrapperStdenv.shell;
};
-
bash = prevStage.bash or bootstrapTools;
+
bashNonInteractive = prevStage.bashNonInteractive or bootstrapTools;
thisStdenv = import ../generic {
name = "${name}-stdenv-darwin";
···
inherit extraNativeBuildInputs;
preHook =
-
lib.optionalString (!isBuiltByNixpkgsCompiler bash) ''
+
lib.optionalString (!isBuiltByNixpkgsCompiler bashNonInteractive) ''
# Don't patch #!/interpreter because it leads to retained
# dependencies on the bootstrapTools in the final stdenv.
dontPatchShebangs=1
···
export PATH_LOCALE=${prevStage.darwin.locale}/share/locale
'';
-
shell = bash + "/bin/bash";
+
shell = bashNonInteractive + "/bin/bash";
initialPath = [
-
bash
+
bashNonInteractive
prevStage.file
bootstrapTools
];
···
# SDK packages include propagated packages and source release packages built during the bootstrap.
sdkPackages = prevStage: {
inherit (prevStage)
-
bash
+
bashNonInteractive
libpng
libxml2
libxo
···
# stage should only access the stage that came before it.
ccWrapperStdenv = self.stdenv;
-
bash = bootstrapTools // {
+
bashNonInteractive = bootstrapTools // {
shellPath = "/bin/bash";
};
···
(llvmLibrariesPackages prevStage)
{
inherit (prevStage)
-
bash
+
bashNonInteractive
cctools
coreutils
cpio
···
inherit (prevStage) ccWrapperStdenv;
# Avoid an infinite recursion due to the SDK’s including ncurses, which depends on bash in its `dev` output.
-
bash = super.bash.override { stdenv = self.darwin.bootstrapStdenv; };
+
bashNonInteractive = super.bashNonInteractive.override { stdenv = self.darwin.bootstrapStdenv; };
# Avoid pulling in a full python and its extra dependencies for the llvm/clang builds.
libxml2 = super.libxml2.override { pythonSupport = false; };
# Use Bash from this stage to avoid propagating Bash from a previous stage to the final stdenv.
ncurses = super.ncurses.override {
-
stdenv = self.darwin.bootstrapStdenv.override { shell = lib.getExe self.bash; };
+
stdenv = self.darwin.bootstrapStdenv.override { shell = lib.getExe self.bashNonInteractive; };
};
darwin = super.darwin.overrideScope (
···
extraAttrs = {
inherit bootstrapTools;
libc = prevStage.darwin.libSystem;
-
shellPackage = prevStage.bash;
+
shellPackage = prevStage.bashNonInteractive;
};
disallowedRequisites = [ bootstrapTools.out ];
···
with prevStage;
apple-sdk
-
bash
+
bashNonInteractive
bzip2.bin
bzip2.out
cc.expand-response-params
+4 -4
pkgs/stdenv/freebsd/default.nix
···
expand-response-params = "";
bsdcp = linkBootstrap { paths = [ "bin/bsdcp" ]; };
patchelf = linkBootstrap { paths = [ "bin/patchelf" ]; };
-
bash = linkBootstrap {
+
bashNonInteractive = linkBootstrap {
paths = [
"bin/bash"
"bin/sh"
···
gawk
diffutils
patch
-
bash
+
bashNonInteractive
xz
gzip
bzip2
bsdcp
];
-
shell = "${prevStage.bash}/bin/bash";
+
shell = "${prevStage.bashNonInteractive}/bin/bash";
stdenvNoCC = import ../generic {
inherit
config
···
# we CAN'T import LLVM because the compiler built here is used to build the final compiler and the final compiler must not be built by the bootstrap compiler
inherit (bootstrapTools)
patchelf
-
bash
+
bashNonInteractive
curl
coreutils
diffutils
+1 -1
pkgs/stdenv/generic/common-path.nix
···
pkgs.gzip
pkgs.bzip2.bin
pkgs.gnumake
-
pkgs.bash
+
pkgs.bashNonInteractive
pkgs.patch
pkgs.xz.bin
+3 -3
pkgs/stdenv/linux/default.nix
···
bzip2
xz
zlib
-
bash
+
bashNonInteractive
binutils
coreutils
diffutils
···
gzip
bzip2
xz
-
bash
+
bashNonInteractive
binutils.bintools
coreutils
diffutils
···
gzip
bzip2
xz
-
bash
+
bashNonInteractive
coreutils
diffutils
findutils
+2 -2
pkgs/tools/compression/zstd/default.nix
···
stdenv,
fetchFromGitHub,
cmake,
-
bash,
+
bashNonInteractive,
gnugrep,
fixDarwinDylibNames,
file,
···
};
nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
buildInputs = lib.optional stdenv.hostPlatform.isUnix bash;
+
buildInputs = lib.optional stdenv.hostPlatform.isUnix bashNonInteractive;
patches = [
# This patches makes sure we do not attempt to use the MD5 implementation
+8 -9
pkgs/top-level/all-packages.nix
···
### SHELLS
runtimeShell = "${runtimeShellPackage}${runtimeShellPackage.shellPath}";
-
runtimeShellPackage = bash;
+
runtimeShellPackage = bashNonInteractive;
-
bash = lowPrio (callPackage ../shells/bash/5.nix { });
+
bash = callPackage ../shells/bash/5.nix { };
+
bashNonInteractive = lowPrio (callPackage ../shells/bash/5.nix {
+
interactive = false;
+
});
# WARNING: this attribute is used by nix-shell so it shouldn't be removed/renamed
-
bashInteractive = callPackage ../shells/bash/5.nix {
-
interactive = true;
-
withDocs = true;
-
};
-
bashInteractiveFHS = callPackage ../shells/bash/5.nix {
-
interactive = true;
-
withDocs = true;
+
bashInteractive = bash;
+
bashFHS = callPackage ../shells/bash/5.nix {
forFHSEnv = true;
};
+
bashInteractiveFHS = bashFHS;
carapace = callPackage ../shells/carapace {
buildGoModule = buildGo123Module;