1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
Commit graph

19028 commits

Author SHA1 Message Date
Siddarth Kumar
fd053fdcad
scripts/install-multi-user: fix typo 2025-01-13 14:12:41 +05:30
Jörg Thalheim
140aee33a3
Merge pull request #12235 from martinetd/add_multi_uaf
libutil: thread-pool: ensure threads finished on error
2025-01-13 09:01:43 +01:00
Robert Hensing
01f5cf2c02
Merge pull request #12237 from NixOS/reject-conflicts
Reject merge conflicts
2025-01-12 22:21:10 +01:00
Robert Hensing
29a1a21ce4 Reject merge conflicts
They're usually found by other checks, but docs would remain
susceptible.
2025-01-12 13:53:21 +01:00
Dominique Martinet
afac093b34 libutil: thread-pool: ensure threads finished on error
This fixes segfaults with nix copy when there was an error processing
addMultipleToStore.

Running with ASAN/TSAN pointed at an use-after-free with threads from
the pool accessing the graph declared in processGraph after the function
was exiting and destructing the variables.

It turns out that if there is an error before pool.process() is called,
for example while we are still enqueuing tasks, then pool.process()
isn't called and threads are still left to run.

By creating the pool last we ensure that it is stopped first before
running other destructors even if an exception happens early.

[ lix porting note: nix does not name threads so the patch has been
adapted to not pass thread name ]

Link: https://git.lix.systems/lix-project/lix/issues/618
Link: https://gerrit.lix.systems/c/lix/+/2355
2025-01-12 15:11:13 +09:00
mergify[bot]
a44ae8b5a9
Merge pull request #12152 from Mic92/dscl
scripts/install-darwin-multi-user: workaround dscl failing sometimes
2025-01-11 21:11:13 +00:00
mergify[bot]
84f116e3cf
Merge pull request #12167 from RossComputerGuy/fix/unsupported-type-docker
nix flake: clarify error message when file is an unknown type
2025-01-11 20:44:06 +00:00
mergify[bot]
d155e349fc
Merge pull request #12166 from DeterminateSystems/upgrade-nix-error-msg
nix upgrade-nix: Give a better error message if the profile is using 'nix profile'
2025-01-11 20:03:17 +00:00
Tristan Ross
22adffec34
nix flake: clarify error message when file is an unknown type 2025-01-10 08:07:51 -08:00
Eelco Dolstra
fccfdbea57 nix upgrade-nix: Give a better error message if the profile is using 'nix profile' 2025-01-09 20:44:25 +01:00
Jörg Thalheim
2d9b213cc2
Merge pull request #12157 from DeterminateSystems/fix-path-flakeref-query-without-fragment
parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment
2025-01-09 17:40:04 +01:00
Eelco Dolstra
9b9e416836
Merge pull request #12160 from Mic92/deadlock
derivation-goal: unlock output lock to avoid deadlock
2025-01-09 16:54:23 +01:00
Eelco Dolstra
3ad0f45e79 Attempt to make the FlakeRef test succeed on macOS 2025-01-09 16:42:37 +01:00
Eelco Dolstra
1a38e62a09 Remove unused variable 2025-01-09 16:38:33 +01:00
Eelco Dolstra
5f7b535b81 parsePathFlakeRefWithFragment(): Add unit tests 2025-01-09 12:18:16 +01:00
Eelco Dolstra
83ff523865 parsePathFlakeRefWithFragment(): Handle query params in the non-git case
Backported from lazy-trees.
2025-01-09 12:17:09 +01:00
Jörg Thalheim
3d877ecae4 derivation-goal: unlock output lock to avoid deadlock
guix discovered in their code base. Maybe we should do the same.
2025-01-08 22:15:51 +01:00
Eelco Dolstra
28caa35a97 parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment
Commands like `nix flake metadata '.?submodules=1'` ignored the query
part of the URL, while `nix build '.?submodules=1#foo'` did work
correctly because of the presence of the fragment part.
2025-01-08 18:38:53 +01:00
Jörg Thalheim
ed4f2c3204 scripts/install-darwin-multi-user: workaround dscl failing sometimes 2025-01-08 18:03:50 +01:00
Domagoj Mišković
5230d3ecc4
Document --max-freed for nix-collect-garbage (#12155)
* Update nix-collect-garbage.md

Referencing issue at: https://github.com/NixOS/nix/issues/12132

Copied the description of `--max-freed` option from 442a2623e4/doc/manual/source/command-ref/nix-store/gc.md (L39-L44)
2025-01-08 14:20:44 +01:00
Valentin Gagarin
8bec777c9d
Merge pull request #12154 from allrealmsoflife/patch-1 2025-01-08 10:55:23 +01:00
Domagoj Mišković
3a5fccc418
outdated building instructions, update documentation.md
The current instructions for building the Nix manual include a command that doesn't work as described. Specifically:

```
nix build .#nix^doc
```

Running this command results in the error:

```
error: derivation '/nix/store/hddqxzfqgx2fhj8q66ss3idym7pk7aj1-nix-2.26.0pre20250107_383ab87.drv' does not have wanted outputs 'doc'
```

However, this command works if you specify the Nix version explicitly, such as:

```
nix build nix/2.24.11#nix^doc
```

Additionally, these commands are run within the Nix root directory. 

However, the nix build .#nix^doc command does work when run from the nixpkgs directory and generates the NixOS manual.

I'm not sure if I'm missing something. Is the `nix^doc` supposed to be added somehow to flake outputs?

The incremental build section does not work since as make has been decommissioned in favor of Meson. Should this be simply deleted?
2025-01-08 09:42:26 +01:00
mergify[bot]
2f3bc6c015
Merge pull request #12149 from DeterminateSystems/remove-url-field
ParsedURL: Remove 'url' and 'base' fields
2025-01-07 19:16:07 +00:00
Eelco Dolstra
4077aa43a8 ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
Eelco Dolstra
f705ce7f9a ParsedURL: Remove url field
This prevents a 'url' field that is out of sync with the other
fields. You can use to_string() to get the full URL.
2025-01-07 14:46:03 +01:00
Eelco Dolstra
a0901e5588
Merge pull request #12143 from Mic92/installer-test-name
mergify: fix installer test name
2025-01-07 11:54:37 +01:00
Jörg Thalheim
383ab87da3
Merge pull request #12046 from roberth/cli-symlink-fixes
CLI symlink fixes
2025-01-07 07:01:59 +01:00
Robert Hensing
4c74d679b6 test: Avoid regressing accidental use of weakly_canonical instead of makeParentCanonical
I'd messed up a rebase in my previous iteration, causing `weakly_canonical` to reappear,
but not trigger a test failure.

These two functions behave similarly when the argument is a path that points to a broken
symlink. `weakly_canonical` would not resolve it because the target doesn't exist, and
`makeParentCanonical` would not resolve it, because it never resolves the final path
element.
This new test case now also tests a valid symlink, "differentiating" the two.
2025-01-07 05:42:04 +00:00
Jörg Thalheim
5a5a86949a makeParentCanonical: test case where parent is empty 2025-01-07 05:42:04 +00:00
Robert Hensing
628c11d237 test: Add hydraJobs.tests.functional_symlinked-home 2025-01-07 05:42:04 +00:00
Robert Hensing
ddbbf53767 fix: Resolve CLI parent symlinks before adding to store
Fixes https://github.com/NixOS/nix/issues/11941
2025-01-07 05:42:03 +00:00
Robert Hensing
c0b64f3377 refactor: Don't re-construct SourcePath unnecessarily 2025-01-07 05:42:03 +00:00
Robert Hensing
91e91f62fa doc: Document nix-store --add-fixed symlink behavior
Tested with

    nix run nix/2.3-maintenance#nix-store -- --add some_symlink
    nix run nix/2.3-maintenance#nix-store -- --add-fixed sha256 --recursive some_symlink
2025-01-07 05:42:03 +00:00
Robert Hensing
36563c69a4 fix: Handle symlinks and FIFOs in nix hash where possible
Fixes https://github.com/NixOS/nix/issues/11756
Fixes https://github.com/NixOS/nix/issues/11681
2025-01-07 05:42:03 +00:00
Robert Hensing
69853c067c Add makeParentCanonical() 2025-01-07 05:42:03 +00:00
Jörg Thalheim
438a20427f mergify: fix installer test name 2025-01-06 22:53:49 +01:00
Jörg Thalheim
6827768807
Merge pull request #12135 from NaN-git/parse-nul
correctly parse strings with null bytes and throw error
2025-01-06 22:53:02 +01:00
John Ericson
daab4d18ac
Merge pull request #12137 from Mic92/windows
windows: fix conditional compilation variable
2025-01-05 19:18:49 -05:00
Jörg Thalheim
1eba904b79 nix/flake: fix build on windows 2025-01-05 20:16:12 +01:00
Jörg Thalheim
98d75de1ea windows: fix conditional compilation variable 2025-01-05 20:15:49 +01:00
Philipp Otterbein
a44e9dd1ea correctly parse strings with null bytes and throw error 2025-01-04 16:14:06 +01:00
John Ericson
442a2623e4
Merge pull request #12097 from ConnorBaker/feat/meson-O3-LTO
packaging: use release builds and LTO by default
2025-01-02 11:10:56 -05:00
Connor Baker
359a0840e2 packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
Jörg Thalheim
deb3533eab
Merge pull request #12126 from NixOS/workflow-name
Workflow name + #12109
2025-01-02 00:20:47 +01:00
Jörg Thalheim
5ebc8d4960
Merge pull request #12109 from trueNAHO/workflows-lock-ubuntu-and-macos-runners-and-update-ubuntu-runner
ci: lock Ubuntu and macOS runners and update Ubuntu runner
2025-01-02 00:20:32 +01:00
Robert Hensing
4f3960ea26
Merge pull request #12127 from NaN-git/json-ser
toJSON: re-throw serialization exception
2024-12-31 21:41:38 +01:00
Philipp Otterbein
4a2310a3a0 toJSON: re-throw serialization exception 2024-12-31 20:33:28 +01:00
mergify[bot]
18f077035a
Merge pull request #12119 from not-my-profile/nix-instantiate-raw
Implement --raw for nix-instantiate --eval
2024-12-31 16:55:15 +00:00
Robert Hensing
5e21bdc623 .github/ci: Use fixed names
This lets us update "runs-on" without creating a mismatch with the
required checks that are configured for the repo in the github ui.
2024-12-31 17:35:07 +01:00
Martin Fischer
7a8a28629c feat(nix-instantiate): add --raw flag
The experimental `nix eval` command already supports a `--raw` flag.
This commit implements the same flag for the stable nix-instantiate command.

Until now instructions and scripts that didn't want to rely on experimental
features had to use workarounds such as:

    nix-instantiate --eval <something> | tr -d \"

(which also undesirably also removes double quotation marks within the string), or

    nix-instantiate --eval <something> | jq -j

(which undesirably depends on another package).

Co-authored-by: Silvan Mosberger <silvan.mosberger@tweag.io>
2024-12-31 16:36:49 +01:00