1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00
Commit graph

18388 commits

Author SHA1 Message Date
Robert Hensing
fa3fd41063 Add makeParentCanonical()
(cherry picked from commit 69853c067c)
2025-01-07 07:20:55 +01:00
Marian Hammer
e79d66ceef nix/tests: run test help.sh only if nix is built with documentation
tests/functional/help.sh calls nix-* commands with option --help
if nix is built without documentation the option --help throws an error
because the man page it wants to display is missing

(cherry picked from commit 85b0cd320a)
2025-01-07 05:55:13 +00:00
Jack Wilsdon
e144f61ec0 Filter OSC 8 correctly
This allows Nix to use lowdown 1.2.0 which outputs OSC-8 links.

(cherry picked from commit 1301f8434d)
2025-01-07 05:33:19 +00:00
Jörg Thalheim
2c89c38fa1
Merge pull request #12074 from NixOS/mergify/bp/2.24-maintenance/pr-12059
installer: make sure we can always test the installer in ci and locally (backport #12059)
2025-01-07 00:27:16 +01:00
Robert Hensing
1a710e54dc .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.
2025-01-07 00:04:32 +01:00
NAHO
365e0a9ab1 ci: lock macOS runner to macos-14 2025-01-07 00:04:32 +01:00
NAHO
b3ea1e9b19 ci: update Ubuntu runner to ubuntu-24.04
Link: https://github.com/actions/runner-images/issues/10636
2025-01-07 00:04:32 +01:00
NAHO
c78b818a0c ci: lock Ubuntu runner to ubuntu-22.04
Lock the Ubuntu runner to ubuntu-22.04 to avoid accidental updates [1]
and increase reproducibility.

[1]: https://github.com/actions/runner-images/issues/10636
2025-01-07 00:04:32 +01:00
Jörg Thalheim
3109250faf mergify: updated required tests
(cherry picked from commit df3eb4f3f6)
2025-01-07 00:04:32 +01:00
Jörg Thalheim
2fbd0a943c installer: make sure we can always test the installer in ci and locally
Just now there is a dependency on cachix, which means we cannot test
the installer in CI if forks do not have the necessary secrets set up.
We replace this with a simple http server that serves the installer and
can be both used in CI and locally.

(cherry picked from commit 6162e1220e)
2025-01-07 00:04:32 +01:00
mergify[bot]
bda59dee55
Merge pull request #12077 from NixOS/mergify/bp/2.24-maintenance/pr-12045
EvalState::realiseContext(): Allow access to the entire closure (backport #12045)
2024-12-31 15:33:23 +00:00
Robert Hensing
000db53f8f tests/functional: Add $config_nix 2024-12-31 15:14:56 +01:00
mergify[bot]
e40d0352b2
Merge pull request #12118 from NixOS/mergify/bp/2.24-maintenance/pr-12115
libcmd: update to support lowdown-1.4 API (backport #12115)
2024-12-30 20:26:40 +00:00
Sergei Trofimovich
c530b13321 libcmd: update to support lowdown-1.4 API
Upstream change
bab1d75079
moved a few fields from `lowdown_opts` toa  new `lowdown_opts_term`
struct. As a result the build started failing as:

    nix-cmd> [2/17] Compiling C++ object libnixcmd.so.p/markdown.cc.o
    nix-cmd> FAILED: libnixcmd.so.p/markdown.cc.o
    nix-cmd> g++ -Ilibnixcmd.so.p -I. -I.. -I/nix/store/b0bnrk5lacxbpgxgnc28r8q3wcazrgxj-nix-util-2.26.0pre-dev/include/nix -I/nix/store/cxnynq9ykyj4xxv6wf6dw7r0aw5x6n9k-libarchive-3.7.7-dev/include -I/nix/store/bfgjwkcb8snkizx578rzdahi75m8zyh4-nlohmann_json-3.11.3/include -I/nix/store/3sx8bq3sip6j2nv1m5xx4gbdp33v7iy6-nix-store-2.26.0pre-dev/include/nix -I/nix/store/sih2dgqzvsbv7p510lkfmas7s7wbsl4j-nix-fetchers-2.26.0pre-dev/include/nix -I/nix/store/68p8s20fsiiakj7nys7grbaixfnhsdzs-nix-expr-2.26.0pre-dev/include/nix -I/nix/store/gw7wknhzhfzzj9zww2kyi5xrzgf1ndki-boehm-gc-8.2.8-dev/include -I/nix/store/3jwb9j4vnsk5saq3wfyyp9il3mhs41l9-nix-flake-2.26.0pre-dev/include/nix -I/nix/store/8nwjvmq7m48v8g646jrxkikv6x47bc3m-nix-main-2.26.0pre-dev/include/nix -I/nix/store/rb0hzsw5wc1a7daizhpj824mbxlvijrq-lowdown-1.4.0-dev/include -I/nix/store/m388ywpk53fsp8r98brfd7nf1f5sskv0-editline-1.17.1-dev/include -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++2a -include config-util.hh -include config-store.hh -include config-expr.hh -include config-main.hh -include config-cmd.hh -Wdeprecated-copy -Werror=suggest-override -Werror=switch -Werror=switch-enum -Werror=unused-result -Wignored-qualifiers -Wimplicit-fallthrough -Wno-deprecated-declarations -O3 -fPIC -pthread -std=c++2a -std=c++2a -std=c++2a -std=c++2a -std=c++2a -std=c++2a -MD -MQ libnixcmd.so.p/markdown.cc.o -MF libnixcmd.so.p/markdown.cc.o.d -o libnixcmd.so.p/markdown.cc.o -c ../markdown.cc
    nix-cmd> ../markdown.cc: In function 'std::string nix::doRenderMarkdownToTerminal(std::string_view)':
    nix-cmd> ../markdown.cc:28:5: error: 'lowdown_opts' has no non-static data member named 'cols'
    nix-cmd>    28 |     };
    nix-cmd>       |     ^

The change adds version-based conditional to support both pre-1.4 and
1.4 forms of the initialization.

Closes: https://github.com/NixOS/nix/issues/12113
(cherry picked from commit edbfe863ce)
2024-12-30 19:16:43 +00:00
Eelco Dolstra
a924db7d0b
Resolve merge conflict 2024-12-16 18:01:52 +01:00
Eelco Dolstra
f986f7e89b EvalState::realiseContext(): Allow access to the entire closure
Fixes #11030.

(cherry picked from commit 08361f031d)

# Conflicts:
#	src/libexpr/eval.cc
#	tests/functional/import-from-derivation.nix
#	tests/functional/import-from-derivation.sh
2024-12-16 15:36:40 +00:00
Jörg Thalheim
6a791e946f
Merge pull request #11904 from NixOS/mergify/bp/2.24-maintenance/pr-11902
Fix issue #11892 (backport #11902)
2024-12-16 13:22:30 +01:00
mergify[bot]
aa22f98b25
Merge pull request #12054 from NixOS/mergify/bp/2.24-maintenance/pr-12050
speed up ci by splitting off eval and build + fix ci with restricted namespaces (backport #12050)
2024-12-14 15:46:25 +00:00
Jörg Thalheim
b3dc855569 ci: disable apparmor restrictions
For our tests we need to map the root user for some tests.
However ubuntu no longer allows this by default:
https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces

(cherry picked from commit 9f2b9256b6)
2024-12-14 15:24:48 +00:00
Jörg Thalheim
7bafbfd50e binary-tarball: create tarball without listing files
This is producing quite a bit of log output in CI.

(cherry picked from commit 31b3a34e5b)
2024-12-14 15:24:48 +00:00
Jörg Thalheim
578f185daf speed up ci by splitting off eval and build
- This speeds up macOS builds from 30 minutes to 11 minutes (3x faster).
- Also improve error reporting e.g. printing out what actually failed to build.
- As a result we also no longer need swap.

(cherry picked from commit 691b1ea237)
2024-12-14 15:24:48 +00:00
Eelco Dolstra
628961d136 Bump version 2024-12-10 17:11:49 +01:00
Jörg Thalheim
a4f978bd9b
Merge pull request #12034 from NixOS/mergify/bp/2.24-maintenance/pr-11921
Make @nix json structured build log parsing warn instead of fail (backport #11921)
2024-12-10 05:37:28 +01:00
Robert Hensing
180031fb5a tests: Make unusual logging test conditional on fixed daemon version
(cherry picked from commit c783cd22ac)
2024-12-10 00:12:19 +01:00
Robert Hensing
29d91db99c Remove redundant warning: prefix from structured build log warning
(cherry picked from commit f3c722cab2)
2024-12-09 21:40:12 +00:00
Robert Hensing
6b2722fc84 test: Move unusual-logging to run only in logging test case
(cherry picked from commit 1421420e86)
2024-12-09 21:40:07 +00:00
Robert Hensing
c951bb0689 Push log source description out of libutil and report build hook @nix warning correctly
(cherry picked from commit 03d4bfd852)
2024-12-09 21:40:04 +00:00
Robert Hensing
60eadfac7f tests/functional/dependencies.nix: Check that we tolerate syntax and type errors
(cherry picked from commit 1485937b89)
2024-12-09 21:40:00 +00:00
Linus Heckemann
9fed865d1d libutil: handle json builder log messages with unexpected format
Before this change, expressions like:

with import <nixpkgs> {};
runCommand "foo" {} ''
  echo '@nix {}' >&$NIX_LOG_FD
''

would result in Lix crashing, because accessing nonexistent fields of
a JSON object throws an exception.

Rather than handling each field individually, we just catch JSON
exceptions wholesale. Since these log messages are an unusual
circumstance, log a warning when this happens.

Fixes #544.

Change-Id: Idc2d8acf6e37046b3ec212f42e29269163dca893
(cherry picked from commit e55cd3beea710db727fd966f265a1b715b7285f3)
(cherry picked from commit ee03fd478e)
2024-12-09 21:39:58 +00:00
Robert Hensing
3cd4e9de1e tests/functional/dependencies.nix: Refactor, replace arcane let
(cherry picked from commit e82ff51726)
2024-12-09 21:39:55 +00:00
Eelco Dolstra
0f8fef49c3
Merge pull request #12017 from NixOS/mergify/bp/2.24-maintenance/pr-12013
nix hash convert: Support SRI hashes that lack trailing '=' characters (backport #12013)
2024-12-09 13:14:14 +01:00
Eelco Dolstra
bd1b11ec66
Resolve conflict 2024-12-06 12:13:12 +01:00
Eelco Dolstra
6a8e9736e0 nix hash: Don't print 'nix hash' deprecation message
Fixes #11997.

(cherry picked from commit 408c2faf93)

# Conflicts:
#	src/nix/hash.cc
2024-12-05 22:30:24 +00:00
Eelco Dolstra
dd79a490bf nix hash convert: Don't fail on uppercase base-16 hashes
(cherry picked from commit 33b645cedf)
2024-12-05 22:30:24 +00:00
Eelco Dolstra
00d0e63c61 nix hash convert: Support SRI hashes that lack trailing '=' characters
Fixes #11996.

(cherry picked from commit 52f1cd0595)
2024-12-05 22:30:24 +00:00
Jörg Thalheim
fc11659148
Merge pull request #11932 from NixOS/mergify/bp/2.24-maintenance/pr-11915
Bump fetcher cache version (backport #11915)
2024-11-23 09:31:55 +01:00
Robert Hensing
bf67741ff1 Bump fetcher cache version
We're getting more reports in https://github.com/NixOS/nix/issues/10985

It appears that something hasn't gone right process-wise.
I find this mistake not to be worth investigating, but rather something
to pay attention to going forward.

Let's nip this in the bud.

Closes https://github.com/NixOS/nix/issues/10985

(cherry picked from commit e948c8e033)

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2024-11-23 09:05:52 +01:00
Robert Hensing
403f388fdb Fix issue 11892
It seems that I copied the expression for baseDir thoughtlessly and
did not come back to it.

- `baseDir` was only used in the `fromArgs` branch.
- `fromArgs` is true when `packages` is true.

(cherry picked from commit c4b95dbdd1)
2024-11-18 21:21:13 +00:00
Eelco Dolstra
8e8a572d37
Merge pull request #11889 from NixOS/mergify/bp/2.24-maintenance/pr-11884
nix path-info: Don't write to std::cout directly (backport #11884)
2024-11-15 16:29:29 +01:00
Eelco Dolstra
3bfc35ba74 nix path-info: Don't write to std::cout directly
This interferes with the progress bar, resulting in output like

  evaluating derivation 'git+file:///home/eelco/Dev/nix-master#packages.x86_64-linux.default'/nix/store/zz8v96j5md952x0mxfix12xqnvq5qv5x-nix-2.26.0pre20241114_a95f6ea.drv

(cherry picked from commit 33a0fa882f)
2024-11-15 14:08:22 +00:00
Eelco Dolstra
aaeaa4e133
Merge pull request #11879 from NixOS/mergify/bp/2.24-maintenance/pr-11878
Remove warning that interpretation of .drv has changed (backport #11878)
2024-11-13 18:23:23 +01:00
Robert Hensing
22e1613814 Remove warning that interpretation of .drv has changed
This was first tagged as 2.15.0, 1½ years ago; plenty of time for
everyone to catch up.

By now, the warning is causing more confusion than that it is helpful,
because passing a `.drv` or `drvPath` has legitimate use cases.

(cherry picked from commit f534a7a524)
2024-11-13 16:12:58 +00:00
Jörg Thalheim
ef21dfa221
Merge pull request #11838 from NixOS/mergify/bp/2.24-maintenance/pr-11837
fix(libutil/posix-source-accessor.cc): get rid of use-after-move bug (backport #11837)
2024-11-08 16:02:45 +01:00
Sergei Zimmerman
c556c205a9 fix(libutil/posix-source-accessor.cc): get rid of use-after-move bug
Naming class member variables the same as constructor arguments is a very
slippery slope because of how member variable names get resolved. Compiler
is not very helpful here and we need static analysis to forbid this kind of
stuff.

The following example illustrates the cause quite well:

```cpp

struct B {
    B(int) {}
};

struct A {
    A(int b): b([&](){
        return b;
        static_assert(std::is_same_v<decltype(b), int>);
    }()) {
       static_assert(std::is_same_v<decltype(b), int>);
    }
    void member() {
        static_assert(std::is_same_v<decltype(b), B>);
    }
    B b;
};

int main() {
    A(1).member();
}
```

From N4861 6.5.1 Unqualified name lookup:

> In all the cases listed in [basic.lookup.unqual], the scopes are searched
> for a declaration in the order listed in each of the respective categories;
> name lookup ends as soon as a declaration is found for the name.
> If no declaration is found, the program is ill-formed.

In the affected code there was a use-after-move for all accesses in the constructor
body, but this UB wasn't triggered.

These types of errors are trivial to catch via clang-tidy's [clang-analyzer-cplusplus.Move].

(cherry picked from commit 3e0129ce3b)
2024-11-08 13:58:17 +00:00
Jörg Thalheim
6e095ddef9
Merge pull request #11823 from NixOS/mergify/bp/2.24-maintenance/pr-11821
initRepoAtomically: Catch directory_not_empty (backport #11821)
2024-11-07 08:03:52 +01:00
Robert Hensing
c3e2419e73 initRepoAtomically: Catch directory_not_empty
(cherry picked from commit 388271e8ec)
2024-11-07 06:23:15 +00:00
Eelco Dolstra
960c288fa0
Merge pull request #11777 from NixOS/mergify/bp/2.24-maintenance/pr-11759
fix: make sure directory exists before using `ln` (backport #11759)
2024-11-01 16:56:25 +01:00
Valentin Gagarin
d14b46f9ba
Merge pull request #11783 from NixOS/mergify/bp/2.24-maintenance/pr-11775
doc/rl-2.19: add entry for always-allow-substitutes option (backport #11775)
2024-11-01 13:12:58 +01:00
Bjørn Forsman
c9325fe343 doc/rl-2.19: add entry for always-allow-substitutes option (#11775)
* doc/rl-2.19: add entry for always-allow-substitutes option

Fixes https://github.com/NixOS/nix/issues/9427.

(cherry picked from commit 020dbac0e0)
2024-11-01 10:57:56 +00:00
Pol Dellaiera
2a2d484986 fix: make sure directory exists before using ln
(cherry picked from commit 5f71ebb956)
2024-11-01 10:19:42 +00:00