1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
Commit graph

151 commits

Author SHA1 Message Date
Bernardo Meurer Costa
9295c14a35
refactor(libstore): replace AWS SDK with curl-based S3 implementation
This commit replaces the AWS C++ SDK with a lighter curl-based approach
for S3 binary cache operations.

- Removed dependency on the heavy aws-cpp-sdk-s3 and aws-cpp-sdk-transfer
- Added lightweight aws-crt-cpp for credential resolution only
- Leverages curl's native AWS SigV4 authentication (requires curl >= 7.75.0)
- S3BinaryCacheStore now delegates to HttpBinaryCacheStore
- Function s3ToHttpsUrl converts ParsedS3URL to ParsedURL
- Multipart uploads are no longer supported (may be reimplemented later)
- Build now requires curl >= 7.75.0 for AWS SigV4 support

Fixes: #13084, #12671, #11748, #12403, #5947
2025-10-15 18:23:55 +00:00
John Ericson
606eb1dfb5
Merge pull request #14250 from fzakaria/patch-1
Remove duplicate shellcheck in dev-shell.nix
2025-10-15 05:03:19 +00:00
Farid Zakaria
7bc3d9b9a9 First attempt at uwyu for libflake 2025-10-14 22:53:13 -04:00
Farid Zakaria
092639709f
Remove duplicate shellcheck in dev-shell.nix 2025-10-14 19:25:06 -07:00
Sergei Zimmerman
89b35ec0dc
packaging/hydra: buildNoGC is the same as buildWithSanitizers
This will reduce the load on hydra. It doesn't make sense to
build 2 slightly different variations where the difference
is only in the nix-perl-bindings and additional sanitizers.
2025-10-12 22:10:35 +03:00
Sergei Zimmerman
de75a180cb
packaging: Add buildWithSanitizers to hydraJobs 2025-10-12 19:38:01 +03:00
Sergei Zimmerman
a491173369
packaging: Add withASan,withUBSan options to the scope 2025-10-12 19:16:08 +03:00
Sergei Zimmerman
47705139c9
packaging: Remove no longer necessary libgit2 patches
25.05 already has 1.9.0 and we don't support older nixpkgs versions.
2025-10-11 16:30:55 +03:00
Seth Flynn
0f016f9bf5
packaging: only override toml11 when necessary
v4.4.0 hit Nixpkgs in https://github.com/NixOS/nixpkgs/pull/442682.
Ideally we'd just use that, but this keeps the fallback behavior until
it's more widespread
2025-10-09 03:24:57 -04:00
Sergei Zimmerman
c5b88c22fa
dev-shell: Disable separateDebugInfo
This breaks gdb pretty-printers inserted into .debug_gdb_scripts section,
because it implies --compress-debug-sections=zlib, -Wa,--compress-debug-sections.
This is very unfortunate, because then gdb can't use pretty printers for
Boost.Unordered (which are very useful, since boost::unoredred_flat_map is
impossible to debug). This seems perfectly fine to disable in the dev-shell for
the time being.

See [1-3] for further references.

With this change I'm able to use boost's pretty-printers out-of-the box:

```
p *importResolutionCache
$2 = boost::concurrent_flat_map with 1 elements = {[{accessor = {p = std::shared_ptr<nix::SourceAccessor> (use count 5, weak count 1) = {
        get() = 0x555555d830a8}}, path = {static root = {static root = <same as static member of an already seen type>, path = "/"},
      path = "/derivation-internal.nix"}}] = {accessor = {p = std::shared_ptr<nix::SourceAccessor> (use count 5, weak count 1) = {
        get() = 0x555555d830a8}}, path = {static root = {static root = <same as static member of an already seen type>, path = "/"},
      path = "/derivation-internal.nix"}}}
```

When combined with a simple `add-auto-load-safe-path ~/code` in .gdbinit

[1]: https://gerrit.lix.systems/c/lix/+/3880
[2]: https://git.lix.systems/lix-project/lix/issues/1003
[3]: https://sourceware.org/pipermail/gdb-patches/2025-October/221398.html
2025-10-08 00:57:34 +03:00
Sergei Zimmerman
c1f805b856
packaging: Build without symbolic interposition on GCC
This turns out to be a big problem for performance of Bison
generated code, that for whatever reason cannot be made internal
to the shared library. This causes GCC to make a bunch of function
calls go through PLT. Ideally these hot functions (like move/copy ctor) could become
inline in upstream Bison. That will make sure that GCC can do interprocedular
optimizations without -fno-semantic-interposition [^]. Considering that
LLVM already does inlining and whatnot is a good motivation for this change.
I don't know of any case where Nix relies on LD_PRELOAD tricks for the shared
libraries in production use-cases.

[^]: https://maskray.me/blog/2021-05-09-fno-semantic-interposition
2025-09-29 01:46:40 +03:00
Robert Hensing
df23f2b3c1 packaging/dev-shell: Add shellcheck
It was already in the closure for the pre-commit hook installation
script.
2025-09-22 19:09:35 +02:00
Sergei Zimmerman
20b532eab0
packaging: Drop legacy apple sdk pattern
This has been dropped on unstable an nix no longer
compiled with overridden nixpkgs input. On 25.05 these
overrides already do nothing.

Tested with:

nix build .#packages.x86_64-darwin.nix-cli -L --override-input nixpkgs https://releases.nixos.org/nixos/unstable/nixos-25.11pre859555.ab0f3607a6c7/nixexprs.tar.xz

Default deployment target on 25.05 is 11.3, so 10.13
sdk override doesn't have to be updated at all as evident
from the fact that we didn't observe any issues with it.
2025-09-13 01:07:42 +03:00
Sergei Zimmerman
8251305aff
Reapply "Merge pull request #13741 from xokdvium/toml-timestamps"
This reverts commit 75740fbd75.
2025-09-01 01:26:14 +03:00
Sergei Zimmerman
1d943f5819
flake: Apply nixfmt 1.0.0 2025-08-18 20:29:45 +03:00
Sergei Zimmerman
0216775ab7
packaging: Fix lowdown cross
Stupid mistake on my part. `binaryTarballCross.x86_64-linux.x86_64-unknown-freebsd` now
builds as expected.
2025-08-18 12:57:04 +03:00
Sergei Zimmerman
3ffeed497a
packaging: Update lowdown to 2.0.2
Nixpkgs has been updated with this version and seems
like next stable nixos release will ship with lowdown 2.0.
2025-08-17 20:49:50 +03:00
Sergei Zimmerman
0348030ae2
dev-shell: Add gdb
It's about time we added debuggers to the dev-shell. Having it in build inputs
does some magic so pretty printers for standard library types work better.
2025-08-16 18:27:39 +03:00
Jörg Thalheim
75740fbd75 Revert "Merge pull request #13741 from xokdvium/toml-timestamps"
This reverts commit 53ac49f72c, reversing
changes made to 8e5ca787f4.

This broke nixpkgs eval test that was depending overflowing integers...
2025-08-13 22:46:09 +02:00
Sergei Zimmerman
320b2c74ef
packaging: Build with toml11 4.4.0 2025-08-12 22:22:12 +03:00
John Ericson
bd9ce27df0
Merge pull request #13713 from Mic92/freebsd-installer
add freebsd multi-user installer
2025-08-08 11:53:02 -04:00
Sergei Zimmerman
51c0e6bc63
hydra: Restore coverage job
Sometime ago we lost the coverage job in the midst of
meson migration. Until we have something like codecov
it'd be very useful to restore this job with the html
reports and historical metrics.

As a bonus we get more coverage metrics by switching to
LLVM tooling from LCOV.
2025-08-08 12:05:06 +03:00
Jörg Thalheim
11d03893f8 add freebsd multi-user installer 2025-08-08 09:10:35 +02:00
Eelco Dolstra
0d559f0c13 Increase the initial Boehm GC mark stack size
If the mark stack size is too small, it greatly inhibits parallel
marking, which is very bad for performance on multi-core systems.
2025-08-07 11:45:06 +02:00
Jörg Thalheim
c7af923865
Merge pull request #13445 from xokdvium/simplify-util-url
libutil: Use Boost.URL for URI parsing
2025-08-04 19:46:58 +02:00
John Ericson
b062730665
Merge pull request #13569 from Mic92/benchmark
add derivation parser benchmark
2025-07-29 14:41:10 -04:00
Jörg Thalheim
1989dd7bf9 add derivation parser benchmark
the current identified bottlenecks are parseString in derivations.cc and dirOf (because of std::filessystem creation).
2025-07-29 16:51:55 +02:00
Sergei Zimmerman
1c9e11a11f
tests/nixos: Parametrize on the system
All of the existing tests only run on x86_64-linux and
the whole `nixpkgsFor` makes it hard to reuse those for
e.g. running the nixos tests with a sanitizer build of nix.
This rips off the bandaid and removes the `nixpkgsFor` parameter
in favor of a single instance of nixpkgs with a separate `nixComponents`.
2025-07-29 01:24:03 +03:00
Robert Hensing
e70dac8244 doc: Add brief comments to the components
Users can access these through the `lib.makeComponents` return value,
so it's helpful to briefly explain some of them.

This doesn't replace `meta.description`, but supplements it.
(TODO: improve `meta.description`)
2025-07-19 16:27:55 +03:00
Sergei Zimmerman
ad449c0288
libutil: Refactor percentDecode,percentEncode to use Boost.URL
The myriad of hand-rolled URL parsing and validation code
is a constant source of problems. Regexes are not a great way
of writing parsers and there's a history of getting them wrong.
Boost.URL is a good library we can outsource most of the heavy
lifting to.
2025-07-18 21:23:40 +03:00
Graham Christensen
6896761d79 Add sed 2025-07-18 12:46:51 -04:00
Tristan Ross
d07852b5f3
Remove propagated-build-inputs when static 2025-05-26 21:54:19 -07:00
Jörg Thalheim
e7078d4de1
Merge pull request #13142 from xokdvium/gc-root-boost-regex
libstore: Use `boost::regex` for GC root discovery
2025-05-18 21:44:41 +02:00
Sergei Zimmerman
67535263a5
dev-shell: Drop bear dependency
Since the autotools-based build system has been removed
and meson already generates compile database there's no
need to have it in the devshell.
2025-05-15 21:13:13 +00:00
Robert Hensing
132c20872f doc/manual: Render unreleased release notes on master
This renders the rl-next notes when `officialRelease = false`, which
corresponds to the case where we're not on a release branch.

Previously we had disabled this behavior because changelog-d is
somewhat of a heavy dependency, being the only Haskell package.
However, we now have new circumstances that topple the tradeoff.

- We render `master` docs to https://nix.dev/manual/nix/development/release-notes/rl-next.html

- `.#manual` is a separate build now, so `nix build nix/foo` is
  not affected by the increased closure of build input outputs.

Because of these factors, I believe adding this functionality back
is more valuable, as we can use it to

- Previous release notes

- Showcase the upcoming release to the community
2025-05-14 23:03:33 +02:00
Sergei Zimmerman
f3090ef703
packaging/dependencies: Use boost without enableIcu
This reduces the closure size on master by 40MiB.

```
$ nix build github:nixos/nix/1e822bd4149a8bce1da81ee2ad9404986b07914c#nix-store --out-link closure-on-master
$ nix build .#nix-store -L --out-link closure-without-icu
$ nix path-info --closure-size -h ./closure-on-master
/nix/store/8gwr38m5h6p7245ji9jv28a2a11w1isx-nix-store-2.29.0pre  124.4 MiB
$ nix path-info --closure-size -h ./closure-without-icu
/nix/store/k0gwfykjqpnmaqbwh23nk55lhanc9g24-nix-store-2.29.0pre   86.6 MiB
```
2025-05-13 08:47:24 +00:00
silvanshade
b1783ff615
Implement memory-mapped IO for Sinks 2025-05-02 15:29:22 -06:00
Robert Hensing
b257ea94e3 Fix pkgs.nixVersions and installTests
... by moving our stuff out of the way from upstream's
`nixComponents` and `nixDependencies` attrsets.

(I prefer not to use overlays, but let's make it work this way
first)
2025-04-20 22:20:52 +02:00
Dean De Leo
51073607ea S3: opt-in the STSProfileCredentialsProvider
The STSProfileCredentialsProviders allows to assume a specific IAM role
when accessing an S3 repository. Sometimes this is needed to obtain the
permissions to operate on the bucket.
2025-04-11 23:47:56 +02:00
Robert Hensing
e76bbe413e
Merge pull request #12877 from roberth/c-api-libflake-override-input
C API: Flake loading, input overriding
2025-04-08 09:01:51 +02:00
Robert Hensing
4be92e7b82 packaging/dependency: Clarify darwinMinVersion 2025-04-03 23:22:33 +02:00
Robert Hensing
5c4a4aeed7 Revert "remove obsolete stdenv darwinMinVersion override"
This reverts commit d91310bb32.

> Some packages require setting a non-default deployment target
> (or minimum version) to gain access to certain APIs. You do
> that using the darwinMinVersionHook, which takes the deployment
> target version as a parameter.

-- 60b54c7aee/doc/stdenv/platform-notes.chapter.md (what-is-a-deployment-target-or-minimum-version-sec-darwin-troubleshooting-using-deployment-targets)

This will again solve error:

    ../nix_api_expr.cc:38:18: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer

-- https://hydra.nixos.org/build/294088946
2025-04-03 23:22:19 +02:00
Robert Hensing
33e638dc1d
Merge pull request #12863 from Mic92/libgit2
libgit2: use upstream version if possible
2025-04-02 22:44:42 +02:00
Robert Hensing
60bffbd41b nix-fetchers-c: Init with settings object
Also make it a dependency of nix-flake-c; we'll need that.
2025-04-02 18:29:42 +02:00
Jörg Thalheim
d91310bb32 remove obsolete stdenv darwinMinVersion override
we are more up-to-date now:

nix-repl> stdenv.hostPlatform.darwinMinVersion
"11.3"
2025-04-01 19:20:43 +02:00
Jörg Thalheim
0b61b758fb libgit2: use upstream version if possible
we don't seem to use libgit2 for fetching via ssh, hence it shouldn't
matter if it's using libssh or the ssh binary.
2025-04-01 19:09:21 +02:00
Robert Hensing
1172e49a3a packaging: Various improvements
Co-authored-by: Mic92 <Mic92@users.noreply.github.com>
2025-04-01 18:51:09 +02:00
Jörg Thalheim
cfeb9404a8 remove deprecated gold linker
Binutils deprecated the gold linker, so do we.
For development we now use mold instead,
we can potentially also use it for release builds later.
2025-04-01 12:52:29 +02:00
silvanshade
3546e574ca
Use mold instead of GNU ld for faster builds 2025-03-31 10:38:11 -06:00
John Ericson
459fb59493 Remove boost env vars
https://github.com/NixOS/nixpkgs/issues/86131 is now fixed!
2025-03-28 10:45:27 -04:00