Linus Heckemann
ee03fd478e
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)
2024-12-09 15:59:59 +01:00
Robert Hensing
e82ff51726
tests/functional/dependencies.nix: Refactor, replace arcane let
2024-12-09 15:59:59 +01:00
Eelco Dolstra
8b9e0f86e4
nix flake lock: Fail if there is an unlocked input
...
Since the only purpose of `nix flake lock` is to write a new lock
file, it should be a fatal error if we can't write the lock file.
2024-12-09 14:03:12 +01:00
Eelco Dolstra
3081e7ce90
Merge pull request #12025 from NaN-git/strlen
...
optimize string concat
2024-12-09 13:02:16 +01:00
Philipp Otterbein
ad3a67a2a0
optimize string concat
2024-12-07 04:42:04 +01:00
Shahar "Dawn" Or
ad296eae2a
Test: more specific error message for head
...
Sorry, I'm not sure how to implement this. So just a test change.
And hopefully will be picked up by someone who is paying attention.
A hero.
2024-12-07 06:37:30 +07:00
Jörg Thalheim
ab5a9cf2db
Merge pull request #12016 from grahamc/patch-2
...
Disable suid and atime on the /nix mount point on Darwin
2024-12-06 01:37:39 +01:00
Robert Hensing
a7cdb55b44
Merge pull request #12013 from DeterminateSystems/fix-11996
...
nix hash convert: Support SRI hashes that lack trailing '=' characters
2024-12-05 23:29:30 +01:00
rekcäH nitraM
49fa31fb4c
Fix typo ( #12015 )
2024-12-05 19:10:59 +00:00
Graham Christensen
4137ead7a1
Disable suid and atime on the /nix mount point on Darwin
...
The Determinate Nix Installer has set nosuid and noatime in https://github.com/DeterminateSystems/nix-installer/pull/1338 , and figured this perf and security improvement is worthy of upstreaming.
The /nix volume shouldn't have setuid binaries anyway, and filesystems seem to generally be noatime on macOS.
Further, the garbage collector doesn't use atime.
2024-12-05 14:01:00 -05:00
Eelco Dolstra
408c2faf93
nix hash: Don't print 'nix hash' deprecation message
...
Fixes #11997 .
2024-12-05 16:25:05 +01:00
Eelco Dolstra
33b645cedf
nix hash convert: Don't fail on uppercase base-16 hashes
2024-12-05 16:19:21 +01:00
Eelco Dolstra
52f1cd0595
nix hash convert: Support SRI hashes that lack trailing '=' characters
...
Fixes #11996 .
2024-12-05 16:02:35 +01:00
wh0
d1894f3456
tests: derivation-advanced-attributes unset NIX_STORE
...
when built by nix, NIX_STORE is set, which breaks $got when it
is not the default /nix/store
2024-12-04 23:21:07 -08:00
Eelco Dolstra
3b21ea40cc
HttpBinaryCacheStore: Improve error message for unauthorized caches
...
Instead of the unhelpful
warning: 'https://cache.flakehub.com ' does not appear to be a binary cache
you now get
warning: unable to download 'https://cache.flakehub.com/nix-cache-info ': HTTP error 401
response body:
{"code":401,"error":"Unauthorized","message":"Unauthorized."}
2024-12-04 16:52:30 +01:00
Leandro Reina
65f78f70d2
Fix format
2024-12-04 16:42:33 +01:00
Leandro Reina
9a7b14c233
Fix flake path in test
2024-12-04 16:39:57 +01:00
Eelco Dolstra
a8a572b11b
Merge pull request #12007 from mupdt/s3-binary-cache-error-request-id
...
s3-binary-cache: show the error's request ID
2024-12-04 16:23:41 +01:00
mupdt
abcfdb4bda
s3-binary-cache: show the error's request ID
...
The request ID is essential for traceability and debugging purposes.
It allows us to connect client-side to server-side events.
2024-12-04 05:49:21 -05:00
Jörg Thalheim
ff00eebb16
Merge pull request #12000 from NixOS/fix-men
...
fix: Add missing manpages to meson.build and more
2024-12-03 19:41:24 +01:00
Robert Hensing
63c0f0dcd2
Install init system configs only when relevant
2024-12-03 16:51:01 +01:00
Robert Hensing
038ab46d7a
Restore org.nixos.nix-daemon.plist installation
2024-12-03 16:37:07 +01:00
Brian Camacho
169d62a382
Merge branch 'master' into lfs
2024-12-02 15:06:28 -05:00
Brian Camacho
79a6438c68
fix sizeCallback
2024-12-02 14:53:19 -05:00
Brian Camacho
85d6efb40d
trim storepath in test
2024-12-02 14:52:51 -05:00
Robert Hensing
d67e24afec
fix: Add missing manpages to meson.build
2024-12-02 17:42:11 +01:00
Eelco Dolstra
8e0913b84a
Merge pull request #11820 from hercules-ci/fix-cross-manual
...
Fix cross build (was: fix manual)
2024-12-02 16:51:59 +01:00
Robert Hensing
747cf4e50f
fix: Add splicing to fix the manual in cross
...
We *could* use a "native" manual instead - ie reusing a native
`nixpkgsFor.${buildPlatform}`, but this works, and also
works for possible cases where we have a custom or patched build tool.
2024-12-02 15:55:18 +01:00
Anatoli Babenia
e83481f5a8
Allow sudo
alternatives when installing from tarball
2024-12-01 14:36:58 +03:00
Anatoli Babenia
04975f7c32
install: Allow to specify alternative sudo
command
2024-11-30 10:07:29 +03:00
Robert Hensing
6400048116
Merge pull request #11977 from Mic92/installer
...
mergify: drop installer test
2024-11-29 15:54:50 +01:00
Eelco Dolstra
10c578ec4b
Merge pull request #11980 from h0nIg/patch-1
...
docker: Fix command "nix profile install", Don't require --impure
2024-11-29 13:13:28 +01:00
Eelco Dolstra
daa8ceb022
Merge pull request #11986 from DeterminateSystems/fix-warning
...
Work around gcc warning
2024-11-28 16:13:30 +01:00
Eelco Dolstra
e5e09006f9
Work around gcc warning
...
Same as 57fea81f8a
.
2024-11-28 15:25:51 +01:00
Jörg Thalheim
5756caf1c3
Merge pull request #11294 from rhendric/rhendric/fix-11268
...
parser-state: fix attribute merging
2024-11-27 22:23:34 +01:00
Jörg Thalheim
2d5a9f064a
Merge pull request #11982 from abitrolly/tarball-clean-script
...
shellcheck: simplify install-nix-from-tarball.sh
2024-11-27 21:53:09 +01:00
Ryan Hendrickson
8034589d7e
parser-state: fix attribute merging
2024-11-27 21:41:47 +01:00
Eelco Dolstra
985b2f9df3
Remove FIXME
2024-11-27 15:23:56 +01:00
Anatoli Babenia
37fd80588f
shellcheck: simplify install-nix-from-tarball.sh
2024-11-27 17:11:36 +03:00
h0nIg
a5c7709f97
docker: Fix command "nix profile install", Don't require --impure
2024-11-27 13:24:46 +01:00
Jörg Thalheim
21ddd2022e
mergify: drop installer test
2024-11-27 07:40:23 +01:00
Jörg Thalheim
d467f7a019
Merge pull request #11976 from trofi/coreutils-by-ls
...
tests/functional/meson.build: always look up `ls` as a `coreutils` proxy
2024-11-27 07:23:15 +01:00
Sergei Trofimovich
2679e55232
tests/functional/meson.build: always look up ls
as a coreutils
proxy
...
Without the change `meson setup` fails on `Gentoo or Debian as those
don't use multicall binary:
$ meson setup ..
...
Executing subproject nix-functional-tests
...
../src/nix-functional-tests/meson.build:24:14: ERROR: Program 'coreutils' not found or not executable
The change always uses `ls` to look `coreutils` up.
Closes: https://github.com/NixOS/nix/issues/11975
2024-11-26 23:08:10 +00:00
John Ericson
ad7e83855c
Merge pull request #11974 from trofi/nix-bz2-fallback
...
src/perl/meson.build: fall back to 'bz2' library lookup
2024-11-26 16:37:55 -05:00
Sergei Trofimovich
d67aa03414
src/perl/meson.build: fall back to 'bz2' library lookup
...
Upstream `bzip2` does not provide `pkg-config` files. As a result an
attempt to build `nix` on some distributions like Gentoo failos the
configure as:
$ meson setup ..
...
Executing subproject perl
...
perl| Run-time dependency bzip2 found: NO (tried pkgconfig and cmake)
../src/perl/meson.build:68:12: ERROR: Dependency "bzip2" not found, tried pkgconfig and cmake
The change falls back to `bz2` library for such cases.
2024-11-26 18:37:53 +00:00
Eelco Dolstra
d0f84fd2a5
Merge pull request #11959 from Mic92/better-errors
...
more readable errors if symlinks cannot be created
2024-11-26 18:06:27 +01:00
Eelco Dolstra
4f50b1d178
Merge pull request #11944 from xokdvium/dev/remove-unnecessary-copies
...
fix(treewide): remove unnecessary copying in range for loops
2024-11-26 12:56:51 +01:00
Jörg Thalheim
5b8728d393
more readable errors if symlinks cannot be created
...
Before:
filesystem error: cannot create symlink: Permission denied [/nix/store/1s2p3a4rs172336hj2l8n20nz74hf71j-nix-eval-jobs-2.24.1.drv] [/1s2p3a4rs172336hj2l8n20nz74hf71j-nix-eval-jobs-2.24.1.drv.tmp-2772352-1316231068]
Now:
creating symlink '/wfxz2q489c811n08cdqj7ywxm3n4z6m5-nix-eval-jobs-2.24.1.drv.tmp-2971297-324653080' -> '/nix/store/wfxz2q489c811n08cdqj7ywxm3n4z6m5-nix-eval-jobs-2.24.1.drv': Permission denied
2024-11-26 09:35:40 +01:00
Leandro Reina
6778d24a27
Add (currently failing) test for flake inputs
2024-11-25 23:56:32 +01:00
Leandro Reina
2bb2dc1ede
Fix lint
2024-11-25 23:35:29 +01:00