Commit graph

17230 commits

Author SHA1 Message Date
Eelco Dolstra
3026613893
Merge pull request #10675 from edolstra/zip-symlinks
Handle zip files containing symlinks
2024-05-15 22:07:22 +02:00
Daniel Ramírez
50bbe22a51
reword nix-env documentation (#10718)
* reword `nix-env` documentation

- added links
- added an overview of package sources
- clarified parsing and matching of package names

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-05-15 19:42:14 +00:00
Cole Helbling
39a269657e libutil/args: warn on unknown settings after parsing all flags 2024-05-15 12:25:03 -07:00
Cole Helbling
06e13465c5 tests/functional: test both clis warn on unknown settings 2024-05-15 12:25:03 -07:00
John Ericson
bbe780b137
Merge pull request #10712 from fricklerhandwerk/reword-nix-store-import-docs
reword documentation on `nix-store --import`
2024-05-15 13:17:36 -04:00
Eelco Dolstra
45c83cd430
Merge pull request #10716 from fricklerhandwerk/documentation-labels
labeler: capture all docs files
2024-05-15 15:13:40 +02:00
Valentin Gagarin
6907eaad4f reword documentation on nix-store --import
- add links to definitions of terms
- one sentence per line
- be more specific about which store is used for the import
- clearly distinguish store paths and store objects
- make a recommendation to use `nix-copy-closure` for efficient SSH transfers
2024-05-15 01:59:07 +02:00
Valentin Gagarin
0c2c260180 labeler: capture all docs files 2024-05-15 01:40:25 +02:00
Valentin Gagarin
7c7aa79ebe redirect "Copying Closures via SSH" guide to nix-copy-closure
the individual commands' documentation should provide enough examples to
make sense of the options and judge what to use and when. proper guides,
which would require a more elaborate setup to show off Nix's
capabilities are out of scope for the reference manual.
2024-05-15 01:29:10 +02:00
Valentin Gagarin
dcc2a51bac add example to nix-store --import
this also features specifying `--store` to give more pointers for
discoverability
2024-05-15 01:11:14 +02:00
Valentin Gagarin
49bd408c10
remove link to relocated manual page (#10703)
fix old anchor redirects to point to the correct location
2024-05-14 21:18:40 +00:00
Eli Flanagan
05ad4e8806
doc: convention improvements for copying closure (#10702)
* doc: convention improvements for copying closure

   use -P, which only considers executables but not shell builtins

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-05-14 20:38:54 +00:00
Valentin Gagarin
2f0031aedc
Revert "manual: fold sidebar sections" (#10698)
The original change arguably reduced ergonomics of navigation, since menu items weren't ctrl+f searchable any more.
2024-05-14 19:23:29 +00:00
Eelco Dolstra
52200474e1
Merge pull request #10697 from edolstra/fix-test-root-removal
tests/functional/common/init.sh: Make $TEST_ROOT writable before removing it
2024-05-14 16:47:21 +02:00
Eelco Dolstra
1da18e85ba tests/functional/common/init.sh: Make $TEST_ROOT writable before removing it
$TEST_ROOT typically contains read-only files/directories (e.g. the
Nix store). So we have to make it writable first.
2024-05-14 16:23:08 +02:00
Eelco Dolstra
d352c52111
Merge pull request #10696 from edolstra/remove-verbose
tests/nixos/containers/containers.nix: Remove superfluous -v
2024-05-14 14:50:38 +02:00
Eelco Dolstra
9a58d90c73 tests/nixos/containers/containers.nix: Remove superfluous -v 2024-05-14 14:27:09 +02:00
Eelco Dolstra
39f7cbdc7c
Merge pull request #10691 from DeterminateSystems/commit-lock-file-summary
Rename commit-lockfile-summary to commit-lock-file-summary for consistency
2024-05-14 10:06:48 +02:00
Eelco Dolstra
1623249745
Merge pull request #10684 from siddhantk232/rm-readDirectory
Inline the usage of `nix::readDirectory` and remove it
2024-05-13 15:41:59 +02:00
Graham Christensen
e1e041ed8f Rename commit-lockfile-summary to commit-lock-file-summary for consistency 2024-05-13 09:23:59 -04:00
Valentin Gagarin
7822ecbadf tests: always clean the test directory
previously the test directory could have been left untouched before executing
a test when `init.sh` was not run - and sometimes it isn't
supposed to be run - which made the test suite highly stateful and thus
behaving surprisingly on multiple runs.
2024-05-13 15:19:49 +02:00
Valentin Gagarin
33ca905cdb tests: simplify initialisation and wiring
pararameterisation is not actually needed the way things are currently
set up, and it confused me when trying to understand what the code does.

all but one test sources vars-and-functions.sh, which nominally only
defines variables, but in practice is always coupled with the actual
initialisation. while the cleaner way of making this more legible would
be to source variables and initialisation separately, this would produce
a huge diff.

the change requires a few small fixes to keep the tests working:

- only create test home directory during initialisation

  that vars-and-functions.sh wrote to the file system seems not write

- fix creation of the test directory

  due to statefulness, the test home directory was implicitly creating
  the test root, too. decoupling that made it apparent that this was
  probably not intentional, and certainly confusing.

- only source vars-and-functions.sh if init.sh is not needed

  there is one test case that only needs a helper function but no
  initialisation side effects

- remove some unnecessary cleanups and split parts of re-used test code

  there were confusing bits in how initialisation code was repurposed,
  which break if trying to refactor the outer layers naively...
2024-05-13 15:19:49 +02:00
siddhantCodes
39e8aad446 Merge branch 'master' of github.com:NixOS/nix 2024-05-13 18:43:12 +05:30
Eelco Dolstra
56abd341bb
Merge pull request #10685 from siddhantk232/fs-cleanup
inline the usage of `nix::renameFile`, `nix::getFileType` and `nix::copyFile`
2024-05-13 14:12:10 +02:00
siddhantCodes
62e1ea2f4b use path for from arg in nix::copyFile 2024-05-13 16:10:21 +05:30
siddhantCodes
4d0777ca69 fix: copy fileName before calling std::distance 2024-05-13 15:36:00 +05:30
Eelco Dolstra
d8559cad8d
Merge pull request #10686 from DeterminateSystems/long-commit-message
git putFile: support flake maximalists
2024-05-13 10:22:57 +02:00
Hraban Luyat
6bf7edb18b fix: don’t expand aliases in develop stdenv setup
This fixes https://github.com/NixOS/nixpkgs/pull/290775 by not expanding aliases
when sourcing the stdenv setup script. The way bash handles aliases is to expand
them when a function is defined, not when it is used. I.e.:

    $ alias echo="echo bar "
    $ echo foo
    bar foo
    $ xyzzy() { echo foo; }
    $ shopt -u expand_aliases
    $ xyzzy
    bar foo
    $ xyzzy2() { echo foo; }
    $ xyzzy2
    foo

The problem is that ~/.bashrc is sourced before the stdenv setup, and bashrc
commonly sets aliases for ‘cp’, ‘mv’ and ‘rm’ which you don’t want to take
effect in the stdenv derivation builders. The original commit introducing this
feature (5fd8cf7667) even mentioned this very
alias.

The only way to avoid this is to disable aliases entirely while sourcing the
stdenv setup, and reenable them afterwards.
2024-05-12 21:57:55 -04:00
Graham Christensen
8b5e8f4fba git putFile: support flake maximalists
Passing the commit message as an argument causes update failures on repositories with lots of flake inputs. In some cases, the commit message is over 250,000 bytes.
2024-05-12 16:42:43 -04:00
Robert Hensing
c940d11fb0
Merge pull request #10666 from tie/derivation-outputs-drv-path
Forbid drvPath in strictDerivation outputs attribute
2024-05-12 21:14:32 +02:00
siddhantCodes
ccf94545db rename copy -> copyFile and remove old copyFile
the old `copyFile` was just a wrapper that was calling the `copy`
function. This wrapper function is removed and the `copy` function is
renamed to `copyFile`.
2024-05-12 19:20:17 +05:30
siddhantCodes
d3b7367c80 inline usage of nix::getFileType and remove it 2024-05-12 18:58:05 +05:30
siddhantCodes
4537663740 inline the usage of nix::renameFile
use `std::filesystem::rename` everywhere and remove `nix::renameFile`
2024-05-12 18:40:16 +05:30
siddhantCodes
1db7d1b840 inline the usage of nix::readDirectory
`nix::readDirectory` is removed. `std::filesystem::directory_iterator`
is used directly in places that used this util.
2024-05-12 17:42:18 +05:30
John Ericson
87ab3c0ea4
Merge pull request #10674 from nix-windows/local-store-on-windows
Build the local store on Windows
2024-05-10 13:26:17 -04:00
John Ericson
e0ff8da9d5 Build the local store on Windows
Fixes #10558

Co-Authored-By: Eugene Butler <eugene@eugene4.com>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2024-05-10 13:05:23 -04:00
John Ericson
0998a3ac01 Remove LocalStore::OptimiseStats::blocksFreed as it is dead code 2024-05-10 12:55:21 -04:00
Eelco Dolstra
cb7224a8c2
Merge pull request #10676 from edolstra/require-docker-images
Die rather than warn if a Docker image is missing
2024-05-10 11:55:46 +02:00
Eelco Dolstra
6df07f3e81 Die rather than warn if a Docker image is missing
The warning was done to handle older Nix releases that didn't have
Docker images (091f232896), but this was
a bad idea because it causes us to silently skip uploading Docker
images if e.g. Hydra hasn't finished building them yet.

Issue #10648.
2024-05-10 11:31:36 +02:00
Eelco Dolstra
9951e14ae0 Handle zip files containing symlinks
In streaming mode, libarchive doesn't handle symlinks in zip files
correctly. So write the entire file to disk so libarchive can access
it in random-access mode.

Fixes #10649. This was broken in cabee98152.
2024-05-09 19:33:09 +02:00
Eelco Dolstra
de8c3c034c
Merge pull request #10668 from edolstra/unit-prefixes
Support unit prefixes in configuration settings
2024-05-09 19:29:36 +02:00
John Ericson
b5605217ae
Document string context (#8595)
* Document string context

Now what we have enough primops, we can document how string contexts
work.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Felix Uhl <iFreilicht@users.noreply.github.com>
2024-05-08 23:14:00 +02:00
Eelco Dolstra
77a406a5a6 Fix warning 2024-05-08 21:16:53 +02:00
Eelco Dolstra
79c7d6205c Support unit prefixes in configuration settings
E.g. you can now say `--min-free 1G`.
2024-05-08 21:11:09 +02:00
John Ericson
d8d20307a8
Merge pull request #10620 from nh2/patch-2
manual: language: Explain that `with` does not shadow
2024-05-08 11:41:21 -04:00
Ivan Trubach
081faeda8c Forbid drvPath in strictDerivation outputs attribute
builtins.strictDerivation returns an attribute set with drvPath and
output paths. For some reason, current implementation forbids drv
instead of drvPath.
2024-05-08 18:20:37 +03:00
John Ericson
a5252c9979
doc: Reword scoping section
"dynamic scope" is not accurate, so reword. The underlying idea is good however.
2024-05-08 11:18:17 -04:00
John Ericson
0930058189
Merge pull request #10665 from siddhantk232/stdfs
Remove `isLink` in favor of `std::filesystem::is_link`

This is one step closer to eventually getting rid of most of our file system utils (in `file-system.cc`) in favor of the `std::filesystem`.
2024-05-08 10:55:19 -04:00
siddhantCodes
ddea4c6deb rm isLink
isLink util is removed in favour of std::filesystem::is_symlink
2024-05-08 19:59:37 +05:30
Valentin Gagarin
52ccaf7971
maintainers: update information on team meetings (#10663)
- specify meeting times in terms of a time zone rather than standard
  time (the first encompasses standard time changes)
- add information on who can participate and how
- unrelated but still important: add GitHub handle to contact the team
2024-05-08 11:29:27 +02:00