Commit Graph

281 Commits

Author SHA1 Message Date
John Ericson 6a6c4961a2 bash: Fix FreeBSD cross build
See code comment for details on this hacky fix.
2026-01-02 15:24:25 -05:00
David McFarland 8a3548925c bash: fix cygwin build
Co-authored-by: Brian McKenna <brian@brianmckenna.org>
2025-12-05 13:55:26 -04:00
Pol Dellaiera e6de6e6025 bash: minor reformating
- Replace `lib.optional` with `lib.optionals` when dealing with lists
- Remove `with lib;` from `meta`
2025-11-09 12:24:54 +01:00
Pol Dellaiera 151aa96218 bash: replace util-linux with util-linuxMinimal 2025-11-09 12:24:54 +01:00
Pol Dellaiera 7ac1c1c203 bash: fix usage of finalAttrs pattern
Issue introduced in #435033 in 305c5f1f12
2025-11-09 12:24:54 +01:00
Aliaksandr 80f12557f5 treewide: replace "yes" else "no" usages to lib.boolToYesNo 2025-10-21 16:04:34 +03:00
Silvan Mosberger b5cadfdf0e bash: Add tests.withChecks passthru to run tests (#435033) 2025-10-10 18:22:13 +00:00
Silvan Mosberger 6d5da10473 bash: Add myself to maintainers 2025-10-08 00:35:15 +02:00
Silvan Mosberger 305c5f1f12 bash: Add tests.withChecks passthru to run tests
Co-Authored-By: Alexander Bantyev <alexander.bantyev@tweag.io>
2025-10-08 00:35:13 +02:00
Yuriy Taraday dd12290517 Reapply "stdenv: Add CPE fields to meta"
This reverts commit de74f9caf0.
2025-09-15 17:25:11 +02:00
K900 de74f9caf0 Revert "stdenv: Add CPE fields to meta" 2025-08-30 09:29:43 +03:00
Yuriy Taraday b0ce3dc09f stdenv: Add CPE fields to meta
Add `identifiers` attr to `meta` attribute with following attrs:
* `cpe` with the full CPE string when available
* `possibleCPEs` with the list of potential CPEs when not all
  information is provided
* `cpeParts` with the destructured CPE string, allowing to override it
  whenever needed
* `v1` attribute set with `cpe` and `cpeParts` from above and a
  guarantee of a backwards-compatible interface

Related issue: https://github.com/NixOS/nixpkgs/issues/354012
2025-08-29 15:40:03 +02:00
Philip Taron 5a220bb7a7 bash: 5.3p0 -> 5.3p3 (#427862) 2025-08-05 12:32:48 -07:00
Sergei Trofimovich 33a086ac03 bash: update hash following upstream re-release
In https://github.com/NixOS/nixpkgs/pull/427862#issuecomment-3141489866
we found out that `bash` did a re-release to regenerate `.gmo` files.
Let's update the hash.

Closes: https://github.com/NixOS/nixpkgs/issues/429953
2025-08-01 07:08:57 +01:00
Wolfgang Walther 535b720589 Merge branch 'master' into staging-next 2025-07-24 14:27:50 +02:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Sergei Trofimovich d2ee711249 bash: 5.3p0 -> 5.3p3 2025-07-23 21:52:14 +01:00
nixpkgs-ci[bot] e5eafe4042 Merge master into staging-next 2025-07-23 18:05:04 +00:00
Silvan Mosberger 0caffc0c07 bash: Generate patch list to conform to the Nix format 2025-07-23 00:56:53 +02:00
Silvan Mosberger 1b2369a80e bash: Improve patch signing key fetching and verification
Get it from a more directly trusted source and update md5 -> sha256

Running the script still works with all signature verifications
succeeding
2025-07-23 00:55:37 +02:00
Silvan Mosberger 8a6390ee11 bash: Add a comment to a patch
With this, all (non-upstream) patches are commented
2025-07-23 00:55:31 +02:00
Sergei Trofimovich a69b606940 bash: 5.2.p37 -> 5.3p0
Changes: https://lists.gnu.org/archive/html/bug-bash/2025-06/msg00004.html
2025-07-13 20:57:30 +01:00
Sergei Trofimovich 27347f2adb readline: 8.2p13 -> 8.3p1 2025-07-13 20:57:29 +01:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Silvan Mosberger e3491c9e40 bash: Make interactive the default
The status quo of `bash` not being interactive is frustrating for many users,
because trying to use it interactively is just messed up, and
`bashInteractive` is not intuitive and barely discoverable.

This was brought to my (and many others) attention by @stahnma in his
[talk at CfgMgmtCamp 2025](https://cfp.cfgmgmtcamp.org/ghent2025/talk/YUVUTN/),
where he highlighted this as one of the frustrations he ran into when
learning Nix.

Why this is fine:
- No reason for not making interactive the default was given in the original commit (6c6ff6f36f), but probably it was due to the increase in closure size
- The closure size only increases by 6.9MiB (19.5%) today, with the
  added dependency on the store paths for readline and ncurses, which
  are needed on systems in almost all cases anyways
- If somebody really needs to get a more minimal system, they can use
  the newly-introduced `bashNonInteractive` instead now
- Though to apply it consistently, they'll need to do that in an
  overlay like
  ```
  final: prev: {
    bash = self.bashNonInteractive;
  }
  ```

  Or alternatively using the `system.replaceDependencies.replacements`
  NixOS option approach.

While there's also other such `*Interactive` packages that could use the
same treatment, `bash` is a great start.

This was already attempted before in
https://github.com/NixOS/nixpkgs/pull/151227, but was not continued for
unknown reason.

To avoid stdenv becoming bigger, all uses of bash in the (working)
stdenv's are changed to the explicitly non-interactive version here.

This commit will however still cause a mass rebuild for all packages (and reverse deps)
making use of the default bash.
2025-02-05 00:31:46 +01:00
Silvan Mosberger 10053c5dfd bash: Deprecate unnecessary withDocs flag
Bash is distributing the rendered docs with the source,
so no build tools are used or needed anymore.

This was not the case originally, see dd91141a06
2025-02-05 00:31:46 +01:00
misuzu 0f47cd38c9 bash: define DEFAULT_LOADABLE_BUILTINS_PATH for non-FHS builds (#290165) 2024-12-14 14:17:54 +02:00
Silvan Mosberger 667d42c00d treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev 57b193d8dd
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:27:17 +01:00
Colin 4eb1020650 bash: define DEFAULT_LOADABLE_BUILTINS_PATH for non-FHS builds
this compile-time constant becomes the runtime value for
BASH_LOADABLES_PATH when otherwise not set. it was added in bash 4.4,
with an upstream default of:
"/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:."
(see: <https://git.savannah.gnu.org/cgit/bash.git/tree/config-top.h?h=bash-5.2#n83>)
and is documented here:
<https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#index-enable>

nixpkgs' bash already builds these loadables: this patch simply improves
the ergonomics, from:

```
bash -i
$ BASH_LOADABLES_PATH="$(dirname $(which bash))/../lib/bash"
$ enable -f realpath realpath
$ realpath ...
```

to:

```
bash -i
$ enable -f realpath realpath
$ realpath ...
```

Co-authored-by: Arne Keller <2012gdwu+github@posteo.de>
2024-12-02 23:15:54 +00:00
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00
Audrey Dutcher 928b4da58e bash: add FreeBSD to static cross compilation special case 2024-11-04 03:13:32 +00:00
Sergei Trofimovich 7c4e9bcab4 bash: 5.2p32 -> 5.2p37 2024-09-27 09:16:23 +01:00
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Artturin 8c116c6112 bash: badPlatforms mingw
`bash` doesn't compile for `mingw`

https://www.github.com/NixOS/nixpkgs/issues/333338
2024-09-12 08:23:58 +02:00
Emily b62cfa99c3 bash: add upstream fix for pop_var_context error
Closes: #214822
2024-08-01 15:35:34 +01:00
Emily a76707e813 bash: 5.2p26 -> 5.2p32
Replace one patch with its upstream version.
2024-08-01 15:35:17 +01:00
Jörg Thalheim 5356420466 treewide: remove unused with statements from maintainer lists
$ find -type f -name '*.nix' -print0 | xargs -P "$(nproc)" -0 sed -i \
  -e 's!with lib.maintainers; \[ *\];![ ];!' \
  -e 's!with maintainers; \[ *\];![ ];!'
2024-07-29 10:06:20 +08:00
Anderson Torres c5aa149ef9 bash-5: remove dtzWill as maintainer [orphan]
Since theey is not active in a long span of time.
2024-07-17 12:12:56 -03:00
John Ericson 97550cd031 bash: Fix OpenBSD build
See added code comment for details
2024-06-29 13:14:51 -04:00
Philip Taron 718545000e bash-completion: add philiptaron as maintainer 2024-06-25 17:12:22 -07:00
Audrey Dutcher 846de80d1c various: Enable updateAutotoolsGnuConfigScriptsHook
Prior to August 2023, any config.guess generated by autoconf will
include a hardcoded /usr/bin/uname invocation for FreeBSD on any
architecture other than arm. This clearly doesn't work under nix.
We must then update or otherwise patch each old config.guess.
2024-05-27 11:09:28 -04:00
Sandro b6a0d866b7 Merge pull request #310322 from r-ryantm/auto-update/bash-completion
bash-completion: 2.13.0 -> 2.14.0
2024-05-19 16:24:39 +02:00
R. Ryantm 7e5879ff42 bash-completion: 2.13.0 -> 2.14.0 2024-05-18 21:57:03 +02:00
Audrey Dutcher fc246ead19 bash: Fix build on FreeBSD cross 2024-05-18 10:04:17 +02:00
Kamila Borowska 0d3b34f45a maintainers: remove KamilaBorowska 2024-04-21 22:26:12 +02:00
R. Ryantm d1001631bc bash-completion: 2.11 -> 2.13.0 2024-04-06 21:14:36 +00:00
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00
github-actions[bot] 03dd2b9470 Merge master into staging-next 2024-02-07 12:01:11 +00:00
Naïm Favier 6a6529ace1 nix-bash-completions: fix improper escaping 2024-01-31 16:09:35 +01:00
Sergei Trofimovich 4181c1f587 bash: 5.2p21 -> 5.2p26
While at it exposed patch suffix as a `version` attribute.
2024-01-17 11:08:09 +00:00