Commit Graph

15563 Commits

Author SHA1 Message Date
Eelco Dolstra
6af94c431b Make some more threads receive interrupts
Shouldn't hurt to do this. In particular, this should speed up
shutting down the PathSubstitutionGoal thread if it's copying from a
remote store.

(cherry picked from commit 295a2ff8bd)
2024-01-04 16:06:41 +00:00
Eelco Dolstra
4b38ebb009 withFramedSink(): Receive interrupts on the stderr thread
Otherwise Nix deadlocks when Ctrl-C is received in withFramedSink():
the parent thread will wait forever for the stderr thread to shut
down.

Fixes the hang reported in https://github.com/NixOS/nix/issues/7245#issuecomment-1770560923.

(cherry picked from commit 24e70489e5)
2024-01-04 16:06:41 +00:00
Robert Hensing
b38e5a665e
Merge pull request #9609 from NixOS/backport-9547-to-2.19-maintenance
[Backport 2.19-maintenance] `allowed-uris`: match whole schemes without slashes #9547
2023-12-14 00:38:30 +01:00
Robert Hensing
01cf57703a Revert "Add nix::isASCII*, locale-independent"
This reverts commit 79eb2920bb.

Not used at this time.

(cherry picked from commit 0b87ba50c0)
2023-12-13 21:09:33 +01:00
Robert Hensing
ebdb6926fd isValidSchemeName: Use regex
As requested by Eelco Dolstra. I think it used to be simpler.

(cherry picked from commit 4eaeda6604)
2023-12-13 21:09:31 +01:00
Robert Hensing
598b0e2317 schemeRegex -> schemeNameRegex
Scheme could be understood to include the typical `:` separator.

(cherry picked from commit 2e451a663e)
2023-12-13 21:09:22 +01:00
Robert Hensing
ffb6246650 allowed-uris: Match whole schemes also when scheme is not followed by slashes
(cherry picked from commit a05bc9eb92)
2023-12-13 21:09:20 +01:00
Robert Hensing
2116ee2454 isValidSchemeName: Add function
(cherry picked from commit d3a85b6834)
2023-12-13 21:08:13 +01:00
Robert Hensing
772a8efff4 Add nix::isASCII*, locale-independent
(cherry picked from commit 79eb2920bb)
2023-12-13 21:07:54 +01:00
Robert Hensing
4795569bf7 isAllowedURI: Format
(cherry picked from commit 1fa958dda1)
2023-12-13 21:07:54 +01:00
Robert Hensing
ec5e4041ba isAllowedURI: Remove incorrect note
(cherry picked from commit 6cbba914a7)
2023-12-13 21:07:54 +01:00
Robert Hensing
90c7904abf isAllowedURI: Extract function and test
(cherry picked from commit 91ba7b2307)
2023-12-13 21:07:50 +01:00
John Ericson
2b0ce229aa
Merge pull request #9599 from NixOS/backport-9593-to-2.19-maintenance
[Backport 2.19-maintenance] Fix query parsing for path-like flakes
2023-12-12 15:00:53 -05:00
Fabian Möller
1e92097ce3 Add test cases for flake urls with fragments
(cherry picked from commit 994f1b5c0d)
2023-12-12 18:08:08 +00:00
Fabian Möller
f72b0b5b00 Fix query parsing for path-like flakes
(cherry picked from commit f45d2ee2b7)
2023-12-12 18:08:08 +00:00
Robert Hensing
ae451e2247
Merge pull request #9595 from NixOS/backport-9588-to-2.19-maintenance
[Backport 2.19-maintenance] Give `Store::queryDerivationOutputMap` and `evalStore` argument
2023-12-11 18:13:58 +01:00
Robert Hensing
0fad9ad5b7
Merge pull request #9594 from obsidiansystems/backport-9563-to-2.19-maintenance
[Backport 2.19-maintenance] [PARTIAL] Give `Derivation::tryResolve` an `evalStore` argument
2023-12-11 17:30:53 +01:00
John Ericson
5fc116a620 Give Store::queryDerivationOutputMap and evalStore argument
Picking up where https://github.com/NixOS/nix/pull/9563 left off.

(cherry picked from commit 5f30c8acc7)
2023-12-11 16:16:40 +00:00
John Ericson
e6a03920ad Give Derivation::tryResolve an evalStore argument
*N.B. Backport is modified not to change any call sites / behavior.*

This is needed for building CA deriations with a src store / dest store
split. In particular it is needed for Hydra.

https://github.com/NixOS/hydra/issues/838 currently puts realizations,
and thus build outputs, in the local store, but it should not.

(cherry picked with modifications from commit 96dd757b0c)
2023-12-11 10:42:06 -05:00
John Ericson
43d55dd15f
Merge pull request #9544 from NixOS/backport-9542-to-2.19-maintenance
[Backport 2.19-maintenance] Add missing `-pthread` for test support libraries
2023-12-05 19:26:08 -05:00
John Ericson
45cde5a343 Add missing -pthread for test support libraries
This is good in general (see how the other libraries also have long had
it, since 49fe9592a4) but in particular
needed to fix the NetBSD build.

(cherry picked from commit b23273f6a2)
2023-12-05 23:44:44 +00:00
Valentin Gagarin
aaeab00401 fix up release note
(cherry picked from commit 2ece9d5b92)
2023-12-04 16:56:46 +01:00
Valentin Gagarin
9c42b2c954 reword description for the fetch-tree experimental feature
without knowing a lot of context, it's not clear who "we" are in that
text. I'm also strongly opposed to adding procedural notes into
a reference manual; it just won't age well.

this change leaves a factual description of the experimental feature and
its purpose.

(cherry picked from commit 3c6244b55e)
2023-12-04 16:56:46 +01:00
Robert Hensing
175d598674
Merge pull request #9516 from NixOS/2.19-flatten-tests
[Backport 2.19-maintanence] Move tests to separate directories, and document
2023-12-01 19:31:45 +01:00
John Ericson
a61e42adb5 Move tests to separate directories, and document
Today, with the tests inside a `tests` intermingled with the
corresponding library's source code, we have a few problems:

- We have to be careful that wildcards don't end up with tests being
  built as part of Nix proper, or test headers being installed as part
  of Nix proper.

- Tests in libraries but not executables is not right:

  - It means each executable runs the previous unit tests again, because
    it needs the libraries.

  - It doesn't work right on Windows, which doesn't want you to load a
    DLL just for the side global variable . It could be made to work
    with the dlopen equivalent, but that's gross!

This reorg solves these problems.

There is a remaining problem which is that sibbling headers (like
`hash.hh` the test header vs `hash.hh` the main `libnixutil` header) end
up shadowing each other. This PR doesn't solve that. That is left as
future work for a future PR.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>

(cherry picked from commit 91b6833686)
2023-12-01 11:37:01 -05:00
Eelco Dolstra
5e265bc140
Merge pull request #9513 from NixOS/2.19-nixpkgs-bumps
[Backport 2.19-maintainence] nixpkgs bumps
2023-12-01 17:10:25 +01:00
Robert Hensing
5656f8c8c7 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/decdf666c833a325cb4417041a90681499e06a41' (2023-11-18)
  → 'github:NixOS/nixpkgs/9ba29e2346bc542e9909d1021e8fd7d4b3f64db0' (2023-11-23)

(cherry picked from commit c5d49ec7ab)
2023-12-01 11:01:20 -05:00
Robert Hensing
f01baf5f06 flake.nix: Update nixpkgs: release-23.05 -> nixos-23.05-small
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/9eb24edd6a0027fed010ccfe300a9734d029983c' (2023-11-01)
  → 'github:NixOS/nixpkgs/decdf666c833a325cb4417041a90681499e06a41' (2023-11-18)

(cherry picked from commit fe4f573d49)
2023-12-01 11:00:01 -05:00
Eelco Dolstra
94a7f91236 Bump version 2023-11-29 17:18:00 +01:00
John Ericson
50f8f1c8bc
Merge pull request #9473 from NixOS/backport-9462-to-2.19-maintenance
[Backport 2.19-maintenance] libexpr: add missing dependency on 'flake/call-flake.nix.gen.hh'
2023-11-27 17:02:47 -05:00
Robert Hensing
28f0322307 libexpr/local.mk: Make eval compile deps regular
Dependency is now entirely through the eval.cc rule.
All gen.hh deps are now there.

(cherry picked from commit 68c48756fe)
2023-11-27 16:26:12 +00:00
Sergei Trofimovich
94b2401138 libexpr: add missing dependency on 'flake/call-flake.nix.gen.hh'
Without the change build for `eval.o` fails occasionally as:

    $ make src/libexpr/eval.o
      GEN    Makefile.config
      GEN    src/libexpr/primops/derivation.nix.gen.hh
      GEN    src/libexpr/fetchurl.nix.gen.hh
      GEN    src/libexpr/parser-tab.cc
      GEN    src/libexpr/lexer-tab.cc
    src/libexpr/lexer.l:314: warning, -s option given but default rule can be matched
      CXX    src/libexpr/eval.o
    src/libexpr/eval.cc:519:18: fatal error: flake/call-flake.nix.gen.hh: No such file or directory
      519 |         #include "flake/call-flake.nix.gen.hh"
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [mk/patterns.mk:3: src/libexpr/eval.o] Error 1

Noticed in https://github.com/NixOS/nixpkgs/pull/269439

(cherry picked from commit 75134b7513)
2023-11-27 16:26:12 +00:00
Robert Hensing
9a8b6ea118
Merge pull request #9472 from NixOS/backport-9459-to-2.19-maintenance
[Backport 2.19-maintenance] add path based redirects
2023-11-27 15:15:57 +01:00
Valentin Gagarin
6dfb06d4a3 add path based redirects
up to now, those were managed outside of this repo, which as
unsurprisingly a real hassle to deal with if one wanted to prevent URLs
from breaking when moving pages around. this change removes a large part
of the friction involved in moving content in the Nix manual.

possible next steps for further automation:
- check for content that moved and warn if it's not reachable from
  links that were valid prior to a change
- create redirect rules automatically based on this information

(cherry picked from commit 2b7016cc56)
2023-11-27 13:29:03 +00:00
Valentin Gagarin
92f3598a16 add deprecation warnings in documentation
this is hacky, but can serve as a stopgap until we can do it
programmatically.

(cherry picked from commit 7e08bdefcc)
2023-11-27 14:08:16 +01:00
Moritz Angermann
819eda4615 nix flake update add deprecation warnings.
This builds on #8817, to add additional UX help for people with existing
muscle memory (or shell history) with --update-input and tries to gently
guide them towards the newly evolved CLI UI.

Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
(cherry picked from commit af00298587)
2023-11-27 14:07:26 +01:00
Eelco Dolstra
33bacbe220
Merge pull request #9437 from NixOS/backport-9431-to-2.19-maintenance
[Backport 2.19-maintenance] Add missing `-lrapidcheck` fixing build with shared lib
2023-11-22 11:45:57 +01:00
John Ericson
914309c35d Add missing -lrapidcheck fixing build with shared lib
https://github.com/NixOS/nixpkgs/pull/269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 46131567da)
2023-11-22 04:48:14 +00:00
Eelco Dolstra
c27f9777f8 Bump version 2023-11-21 17:30:26 +01:00
Théophane Hufschmitt
455aca36e4
Merge pull request #9426 from NixOS/backport-9425-to-2.19-maintenance
[Backport 2.19-maintenance] Fix "unbound variable" errors in bash
2023-11-21 15:30:20 +01:00
Felix Uhl
e011d94813 Fix "unbound variable" errors in bash
Fixes #9414

(cherry picked from commit 64827360be)
2023-11-21 14:12:50 +00:00
Eelco Dolstra
2a1d549af4
Merge pull request #9409 from NixOS/backport-9408-to-2.19-maintenance
[Backport 2.19-maintenance] Fix bad_format_string error when builder stdout contains %
2023-11-20 17:41:03 +01:00
roblabla
a5c6ba3edc Fix bad_format_string error when builder stdout contains %
(cherry picked from commit e2b6821ca0)
2023-11-20 16:22:58 +00:00
Théophane Hufschmitt
911828a655
Merge pull request #9407 from NixOS/backport-9390-to-2.19-maintenance
[Backport 2.19-maintenance] fetchTree: clarify docs for shallow flag
2023-11-20 15:38:29 +01:00
DavHau
2778b218c3 fetchTree: clarify docs for shallow flag
(cherry picked from commit 796a7eb92d)
2023-11-20 14:16:08 +00:00
Eelco Dolstra
4cc65f3dd5 Bump version 2023-11-20 15:06:04 +01:00
Eelco Dolstra
5b99c823ef Mark official release 2023-11-20 14:09:49 +01:00
Robert Hensing
6832d18ac7
Merge pull request #9399 from edolstra/revert-vlas
Revert use of boost::container::small_vector in the evaluator
2023-11-20 13:37:50 +01:00
Eelco Dolstra
1d6abec993 Revert use of boost::container::small_vector in the evaluator
It caused random crashes (https://hydra.nixos.org/build/241514506,
https://hydra.nixos.org/build/241443330) because the heap allocation
done by small_vector in the not-small case is not scanned for GC
roots.
2023-11-20 12:35:35 +01:00
tomberek
fb68699456
Merge pull request #9370 from hercules-ci/add-value-types
refactor: Add `Value` types, use `std::span` for list iteration
2023-11-20 01:32:32 -05:00