aboutsummaryrefslogtreecommitdiff
path: root/Makefile
AgeCommit message (Collapse)Author
2024-03-05Merge pull request #5145 from fedepell/local_doc_build_5140eldritch horrors
Docs build: depend on locally built nix executable and not installed one (cherry picked from commit ca72e3e7e8f69526f028475a7a9b40812da1acdd) === includes changes from (because not doing so removes manpages): Merge pull request #9976 from alois31/restore-manual-pages Restore manual pages (cherry picked from commit d3c1997127e0fc08576e842b2bfe046d8a28d2f4) Change-Id: I685ff16163ac552a1754570c03c992c63a461d50
2024-03-05Merge pull request #9541 from obsidiansystems/config-buildprefix-fixeldritch horrors
Including `config.h` also needs `$(buildprefix)` (cherry picked from commit 96fdea3394ff61e24c53358644a5064218218d13) Change-Id: I8b5c0b1826aa007aa681c8b199f9b1489cac6784
2024-03-04Merge pull request #9465 from obsidiansystems/build-direldritch horrors
Use `buildprefix` in a few more places (cherry picked from commit b6a3fde6b7a416929553e6be36fc991680ddf9ef) Change-Id: I2790663fa9f8242ac2db6582b7e421d2fdf42942
2024-03-04Merge pull request #9106 from Ericson2314/positive-source-filteringeldritch horrors
Use positive source filtering for the standalone functional tests job and Perl bindings (cherry picked from commit 6b6bd9003062c86a49d4384381941cf57f269c45) Change-Id: I896be67654f893d543ed6beb5d0d0d6c6d36e027
2024-03-04Merge pull request #8923 from obsidiansystems/test-protoeldritch horrors
Unit test some worker protocol serializers (cherry picked from commit c6faef61a6f31c71146aee5d88168e861df9a22a) Change-Id: I99e36f5f17eb7642211a4e42a16b143424f164b4
2023-12-01Move tests to separate directories, and documentJohn Ericson
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 91b6833686a6a6d9eac7f3f66393ec89ef1d3b57) (cherry picked from commit a61e42adb528b3d40ce43e07c79368d779a8b624)
2023-12-01Put functional tests in `tests/functional`John Ericson
I think it is bad for these reasons when `tests/` contains a mix of functional and integration tests - Concepts is harder to understand, the documentation makes a good unit vs functional vs integration distinction, but when the integration tests are just two subdirs within `tests/` this is not clear. - Source filtering in the `flake.nix` is more complex. We need to filter out some of the dirs from `tests/`, rather than simply pick the dirs we want and take all of them. This is a good sign the structure of what we are trying to do is not matching the structure of the files. With this change we have a clean: ```shell-session $ git show 'HEAD:tests' tree HEAD:tests functional/ installer/ nixos/ ``` (cherry picked from commit 68c81c737571794f7246db53fb4774e94fcf4b7e)
2023-07-18Introduce notion of a test group, use for CA testsJohn Ericson
Grouping our tests should make it easier to understand the intent than one long poorly-arranged list. It also is convenient for running just the tests for a specific component when working on that component. We need at least one test group so this isn't dead code; I decided to collect the tests for the `ca-derivations` and `dynamic-derivations` experimental features in groups. Do ```bash make ca.test-group -jN ``` and ```bash make dyn-drv.test-group -jN ``` to try running just them. I originally did this as part of #8397 for being able to just the local overlay store alone. I am PRing it separately now so we can separate general infra from new features. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-06-15Fix build hook error for libstore library usersRobert Hensing
A library shouldn't require changes to the caller's argument handling, especially if it doesn't have to, and indeed we don't have to. This changes the lookup order to prioritize the hardcoded path to nix if it exists. The static executable still finds itself through /proc and the like.
2023-03-10Generate API docs with DoxygenJohn Ericson
The motivation is as stated in issue #7814: even though the the C++ API is internal and unstable, people still want it to be well documented for sake of learning, code review, and other purposes that aren't predicated on it being stable. Fixes #7814 Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-02-24Add ./configure --disable-tests optionRobert Hensing
Building without tests is useful for bootstrapping with a smaller footprint or running the tests in a separate derivation. Otherwise, we do compile and run them. This isn't fine grained as to allow picking `check` but not `installcheck` or vice versa, but it's good enough for now. I've tried to use Nixpkgs' `checkInputs`, but those inputs weren't discovered properly by the configure script. We can emulate its behavior very well though.
2023-02-10Fix building with GCC 9Eelco Dolstra
Nixpkgs on aarch64-linux is currently stuck on GCC 9 (https://github.com/NixOS/nixpkgs/issues/208412) and using gcc11Stdenv doesn't work either. So use c++2a instead of c++20 for now. Unfortunately this means we can't use some C++20 features for now (like std::span).
2022-10-22Build with C++20Graham Bennett
2022-05-25Merge branch 'master' into ltopennae
2022-05-06Add unit tests for libexpr (#5377)Andreas Rammhold
* libexpr: fix builtins.split example The example was previously indicating that multiple whitespaces would be collapsed into a single captured whitespace. That isn't true and was likely a mistake when being documented initially. * Fix segfault on unitilized list when printing value Since lists are just chunks of memory the individual elements in the list might be unitilized when a programming error happens within Nix. In this case the values are null-initialized (at least with Boehm GC) and we can avoid a nullptr deref when printing them. I ran into this issue while ensuring that new expression tests would show the actual value on an assertion failure. This is unlikely to cause any runtime performance regressions as printing values is not really in the hot path (unless the repl is the primary use case). * Add operator<< for ValueTypes * Add libexpr tests This introduces tests for libexpr that evalulate various trivial Nix language expressions and primop invocations that should be good smoke tests wheter or not the implementation is behaving as expected.
2022-03-03enable LTO in optimized buildspennae
gives 2-5% performance improvement across a board of tests. LTO is broken when using clang; some libs link fine while others crash the linker with a segfault in the llvm linker plugin. šŸ™
2022-01-26Stop vendoring nlohmann_jsonEelco Dolstra
2021-11-11Install nlohmann_json headersRobert Hensing
These headers are included by the libexpr, libfetchers, libstore and libutil headers. Considering that these are vendored sources, Nix should expose them, as it is not a good idea for reverse dependencies to rely on a potentially different source that can go out of sync.
2021-10-04Add a test for RefScanSink and clean up the codeEelco Dolstra
Issue #5322.
2021-07-15nlohmann_json: Update to 3.9.1, fix use of internal copyEelco Dolstra
2021-06-23Add a fish completion scriptJan Tojnar
This is only rudimentary support as allowed by `NIX_GET_COMPLETIONS`. In the future, we could use completeā€™s `--wraps` argument to autocomplete arguments for programs after `nix shell -c`.
2021-06-02Install zsh completion scriptChua Hou
2021-01-26Move command plugin interface to libnixcmdShea Levy
2020-12-22Move <nix/fetchurl.nix> into the nix binaryEelco Dolstra
This makes the statically linked nix binary just work, without needing any additional files.
2020-09-22Disable `FORTIFY_SOURCE` when compiling without optimsregnat
Otherwise the build is cluttered with ``` /nix/store/fwpn2f7a4iqszyydw7ag61zlnp6xk5d3-glibc-2.30-dev/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] 382 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O) | ^~~~~~~ ``` when building with `OPTIMIZE=0`
2020-06-17Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-06-16StorePath: Rewrite in C++Eelco Dolstra
On nix-env -qa -f '<nixpkgs>', this reduces maximum RSS by 20970 KiB and runtime by 0.8%. This is mostly because we're not parsing the hash part as a hash anymore (just validating that it consists of base-32 characters). Also, replace storePathToHash() by StorePath::hashPart().
2020-05-28Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-05-10nix: Implement basic bash completionEelco Dolstra
2020-05-08Move unit tests to sr/libutil/tests, use mk make rulesEelco Dolstra
2020-05-06WIP: add unit tests for libutilTobias Pflug
This is a proof on concept to evaluate writing unit tests for Nix using google test (https://github.com/google/googletest). In order to execute tests: $ make unit-tests $ ./unit-tests The Makefile rules for `unit-tests` is a complete hack.
2020-04-22Don't install error-demoEelco Dolstra
2020-04-22Merge branch 'error-format' of https://github.com/bburdette/nixEelco Dolstra
2020-04-07Backport libfetchers from the flakes branchEelco Dolstra
This provides a pluggable mechanism for defining new fetchers. It adds a builtin function 'fetchTree' that generalizes existing fetchers like 'fetchGit', 'fetchMercurial' and 'fetchTarball'. 'fetchTree' takes a set of attributes, e.g. fetchTree { type = "git"; url = "https://example.org/repo.git"; ref = "some-branch"; rev = "abcdef..."; } The existing fetchers are just wrappers around this. Note that the input attributes to fetchTree are the same as flake input specifications and flake lock file entries. All fetchers share a common cache stored in ~/.cache/nix/fetcher-cache-v1.sqlite. This replaces the ad hoc caching mechanisms in fetchGit and download.cc (e.g. ~/.cache/nix/{tarballs,git-revs*}). This also adds support for Git worktrees (c169ea59049f861aaba429f48b828d0820b74d1d).
2020-04-03move out of tests/Ben Burdette
2020-03-30build with makeBen Burdette
2020-03-30Move fetchers from libstore to libfetchersEelco Dolstra
2019-11-26Add some Rust codeEelco Dolstra
2019-11-07Fix Perl bindingsEelco Dolstra
2019-11-07Revert "autoconf: Allow overriding CFLAGS/CXXFLAGS from outside."Eelco Dolstra
This reverts commit 717e821b99797845e1bef47d862f8cb0fb69cfc9. It's much more convenient to do 'make OPTIMIZE=0'.
2019-11-07Precompile headersEelco Dolstra
This cuts 'make install -j6' on my laptop from 170s to 134s.
2019-07-03autoconf: Allow overriding CFLAGS/CXXFLAGS from outside.Niklas HambĆ¼chen
As is normal for autoconf-based projects. For example, it is a common use case to do ./configure CXXFLAGS=-O0 This did not work for nix until now, because the `CXXFLAGS=` declaration would unconditionally erase what the user had specified. The custom `OPTIMIZE` flag is removed, but the default `-O3` is retained; autoconf would default to `-g -O2` by default otherwise as documented on: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C_002b_002b-Compiler.html
2018-10-26Merge all nix-* binaries into nixEelco Dolstra
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
2018-03-20Merge pull request #1997 from dtzWill/fix/cxx14-std-consistencyEelco Dolstra
ask autotools for c++14 support flags, not c++11; don't override later
2018-03-20ask autotools for c++14 support flags, not c++11; don't override laterWill Dietz
2018-03-20Make <nix/buildenv.nix> a builtin builderEelco Dolstra
This avoids sandbox annoyances.
2018-03-14Use boost::format from the boost packageEelco Dolstra
Note that this only requires headers from boost so it doesn't add a runtime dependency. Also, use Nixpkgs 18.03.
2018-02-08Add plugins to make Nix more extensible.Shea Levy
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2017-08-19Remove nix-mode.el from Nix.Matthew Bauer
This removes the file nix-mode.el from Nix. The file is now available within the repository https://github.com/NixOS/nix-mode. Fixes #662 Fixes #1040 Fixes #1054 Fixes #1055 Closes #1119 Fixes #1419 NOTE: all of the above should be fixed within NixOS/nix-mode. If one of those hasnā€™t please reopen within NixOS/nix-mode and not within NixOS/nix.
2017-03-31Merge branch 'remove-perl' of https://github.com/shlevy/nixEelco Dolstra