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

13 commits

Author SHA1 Message Date
Eelco Dolstra
02e5588bf9 Give unit tests access to a $HOME directory
Also, don't try to access cache.nixos.org in the libstore unit tests.
2025-06-17 11:12:58 +02:00
John Ericson
7a7fe350d5 Get rid of raw -D defines, always use private config files
Now that we have the private vs public distinction, we can do this
without leaking information downstream.
2025-04-06 18:53:42 -04:00
John Ericson
3294b22a68 Clean some header related things.
Revert most of "Hack together a fix for the public headers"

- The `libmain` change is kept, and one more libmain change is made.
  (Need to update Meson and Nix per the package alike).

- The S3 situation is fixed in a different way: the variable is public
  now, used in the header, and fixed accordingly.

- Fix TODO for `HAVE_EMBEDDED_SANDBOX_SHELL`

This reverts commit 2b51250534.
2025-04-06 18:53:38 -04:00
Robert Hensing
2b51250534 Hack together a fix for the public headers
Please fix this.
2025-04-05 00:59:58 +02:00
John Ericson
c204e307ac Cleanup config headers
There are two big changes:

1. Public and private config is now separated. Configuration variables
   that are only used internally do not go in a header which is
   installed.

   (Additionally, libutil has a unix-specific private config header,
   which should only be used in unix-specific code. This keeps things a
   bit more organized, in a purely private implementation-internal way.)

2. Secondly, there is no more `-include`. There are very few config
   items that need to be publically exposed, so now it is feasible to
   just make the headers that need them just including the (public)
   configuration header.

And there are also a few more small cleanups on top of those:

- The configuration files have better names.

- The few CPP variables that remain exposed in the public headers are
  now also renamed to always start with `NIX_`. This ensures they should
  not conflict with variables defined elsewhere.

- We now always use `#if` and not `#ifdef`/`#ifndef` for our
  configuration variables, which helps avoid bugs by requiring that
  variables must be defined in all cases.
2025-03-31 23:28:36 -04:00
John Ericson
f3e1c47f47 Separate headers from source files
The short answer for why we need to do this is so we can consistently do
`#include "nix/..."`. Without this change, there are ways to still make
that work, but they are hacky, and they have downsides such as making it
harder to make sure headers from the wrong Nix library (e..g.
`libnixexpr` headers in `libnixutil`) aren't being used.

The C API alraedy used `nix_api_*`, so its headers are *not* put in
subdirectories accordingly.

Progress on #7876

We resisted doing this for a while because it would be annoying to not
have the header source file pairs close by / easy to change file
path/name from one to the other. But I am ameliorating that with
symlinks in the next commit.
2025-03-31 12:20:25 -04:00
Robert Hensing
b86a76044e Unexpose config headers (low hanging fruit only)
- Some headers were completely redundant and have been removed.
- Other headers have been turned private.
- Unnecessary meson.build code has been removed.
- libutil-tests now has a private config header, where previously
  it had none. This removes the need to expose a package version
  macro publicly.
2025-03-28 15:17:54 +00:00
Connor Baker
359a0840e2 packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
Robert Hensing
472912f7ca C API: Add nix_store_get_storedir 2024-12-14 17:25:41 +00:00
Robert Hensing
d0b4db924a rename: build-utils-meson -> nix-meson-build-support
Fix a footgun. In my case, I had a couple of build ("output")
directories sitting around.

    rm -rf build-*

Was confused for a bit why a meson.build file was missing.

Probably also helps with autocompletion.

I tried meson-build-support first, but I had to add something like
a nix- prefix, in order to make meson happy. They've reserved the
meson- prefix.
2024-12-09 16:54:42 +01:00
Eelco Dolstra
965ca18db8 Merge build-utils-meson/{diagnostics,threads} into build-utils-meson/common
This reduces the amount of boilerplate. More importantly, it provides
a place to add compiler flags (such as -O3) without having to add it
to every subproject (and the risk of forgetting to include it).
2024-11-21 20:34:54 +01:00
Brian McKenna
9dca7aeece Set Windows API version in Meson 2024-11-05 23:36:08 +11:00
John Ericson
e65510da56 Move unit tests to the location Meson expects them to be
Everything that is a separate subproject should live in the subprojects
directory.

Progress on #2503

This reverts commit 451f8a8c19.
2024-10-17 15:42:16 -04:00
Renamed from tests/unit/libstore/meson.build (Browse further)