aboutsummaryrefslogtreecommitdiff
path: root/package.nix
AgeCommit message (Collapse)Author
2024-10-18packaging: use in-tree capnproto derivationJade Lovelace
This is done because the one in nixpkgs has several problems and we don't want to conflict with them fixing those problems: - not building shared libs - not building debuginfo (more critical for us due to https://git.lix.systems/lix-project/lix/issues/549) - not setting the correct cmake build type - not setting the correct cxxflags to build the coroutine library - not building with clang (required for the coroutine library since gcc is known to miscompile coroutines *in kj*). CC: https://git.lix.systems/lix-project/lix/issues/551 Fixes: https://git.lix.systems/lix-project/lix/issues/550 Change-Id: Ia5b78dc1809963fdd1a8203b127a216cb575d751
2024-10-18packaging: remove workaround for clang stdenv assertsJade Lovelace
This workaround was for the stdenv not being set when callPackage'ing package.nix for some of the stranger CI outputs. Change-Id: I2acdd6efa721b90dd3cb04358544d25d591ff084
2024-10-14fix: macOS build broken by fatal lowdown CLI sandbox setupJade Lovelace
This failed due to https://github.com/NixOS/nixpkgs/pull/346945, which makes a second lowdown-unsandboxed that works in nix builds, and the regular lowdown has executables that fail closed when the sandbox setup fails. The actual failure here is only visible on nixos-unstable at the moment, not 24.05, but this commit should fix it up for all versions. Fixes: https://git.lix.systems/lix-project/lix/issues/547 Change-Id: I50c0ecb59518ef01a7c0181114c1b4c5a7c6b78b
2024-10-09testsuite: use xdist for parallel test runningJade Lovelace
This is capped at 12 because 3.7 seconds of startup is painful enough and 5.5 seconds with 24 was more annoying. Change-Id: I327db40fd98deaa5330cd9cf6de99fb07b2c1cb0
2024-10-09testsuite: add a functional2 test suite based on pytestJade Lovelace
I am tired of bad shell scripts, let me write bad python quickly instead. It's definitely, $100%, better. This is not planned as an immediate replacement of the old test suite, but we::jade would not oppose tests getting ported. What is here is a mere starting point and there is a lot more functionality that we need. Fixes: https://git.lix.systems/lix-project/lix/issues/488 Change-Id: If762efce69030bb667491b263b874c36024bf7b6
2024-09-26fix internal-api-docs buildeldritch horrors
this one is also run from a gcc stdenv. Change-Id: I91ff6915c6689ece15224f348f54367cff5d2b5a
2024-09-17package.nix: fix cross for editlineJade Lovelace
editline's dep on ncurses is a runtime one, so it should be in buildInputs, not nativeBuildInputs. CC: https://git.lix.systems/lix-project/lix/issues/527 Change-Id: I631c192a55677b0cc77faa7511986f1fa2205e91
2024-09-11editline: Vendor cl/1883 patch to recognize `Alt+Left`/`Alt+Right`Rebecca Turner
This vendors the patch added in cl/1883 to avoid GitHub garbage-collecting the commits we're referring to. As @emilazy pointed out on GitHub: > GitHub can garbage‐collect unmerged PR commits if they are later > force‐pushed, which means that code review in upstreams can cause > Nixpkgs builds to fail to reproduce in future. See: https://github.com/NixOS/nixpkgs/pull/341131#discussion_r1753046220 See: https://github.com/troglobit/editline/pull/70 See: https://gerrit.lix.systems/c/lix/+/1883 Change-Id: Ifff522f7f23310d6dbe9efc72fd40be5500ae872
2024-09-11Merge "repl: Patch editline to recognize Meta-Left & Meta-Right" into mainrebecca “wiggles” turner
2024-09-09repl: Patch editline to recognize Meta-Left & Meta-RightRebecca Turner
This applies https://github.com/troglobit/editline/pull/70 to our build of editline, which translates `meta-left` and `meta-right` into `fd_word` and `bk_word`. This makes `nix repl` soooo much nicer to use! Note: My terminal renders `meta-left` as `\e\e[C` and `meta-right` as `\e\e[D`. Closes https://git.lix.systems/lix-project/lix/issues/501 Change-Id: I048b10cf17231bbf4e6bf38e1d1d8572cedaa194
2024-09-09forbid gcc for compilation, only allow clangeldritch horrors
while gcc 12 and older miscompile our generators, gcc 13 and older outright crash on kj coroutines. (newer gcc versions may fix this) Change-Id: I19f12c8c147239680eb0fa5a84ef5c7de38c9263
2024-09-08libstore: turn Worker in a kj event loop usereldritch horrors
using a proper event loop basis we no longer have to worry about most of the intricacies of poll(), or platform-dependent replacements for it. we may even be able to use the event loop and its promise system for all of our scheduling in the future. we don't do any real async processing yet, this is just preparation to separate the first such change from the huge api design difference with the async framework we chose (kj from capnp): kj::Promise, unlike std::future, doesn't return exceptions unmangled. it instead wraps any non-kj exception into a kj exception, erasing all type information and preserving mostly the what() string in the process. this makes sense in the capnp rpc use case where unrestricted exception types can't be transferred, and since it moves error handling styles closer to a world we'd actually like there's no harm in doing it only here for now Change-Id: I20f888de74d525fb2db36ca30ebba4bcfe9cc838
2024-08-24devShell: can we have debuggers?eldritch horrors
macos: we have debuggers at home (the debuggers at home: entitled little brats) Change-Id: Iefd4b5880da97846a81d601db05d2b46530a2b58
2024-08-21fix: build with meson 1.5 alsoJade Lovelace
nixpkgs delivered us the untimely gift of a meson 1.5 upgrade, which *does* make our lives easier by allowing us to delete wrap generation code, but it does so at the cost of renaming all rust crates in such a way that the wrap logic cannot tolerate the new names on the old meson version 😭. It also means that support burden for this is going to be atrocious until we either give in and vendor meson 1.5 or we make a CI target for it. Neither seems appealing, though the latter is not super absurd for ensuring we don't break nixpkgs unstable. This commit causes meson 1.5 to ignore the .wrap files in subprojects/ entirely (since they have the wrong names lol) and instead use Cargo.lock, so it now hard-depends on our workspace reshuffling improvement. It also deletes the hack that we were using to get the sources of Cargo deps into meson by using a feature that went unnoticed when this code was originally written: MESON_PACKAGE_CACHE_DIR: https://github.com/mesonbuild/meson/blob/8a202de6ec763284cbb7160b9d43d5e7e0703f19/mesonbuild/wrap/wrap.py#L490-L502 Change-Id: I7a28f12fc2812c6ed7537b60bc3025c141a05874
2024-08-21build: move to a Cargo workspaceJade Lovelace
This is purely to let Cargo's dependency resolver do stuff for us, we do not actually intend to build this stuff with Cargo to begin with. Change-Id: I4c08d55595c7c27b7096375022581e1e34308a87
2024-08-20lix-doc: move under src/Jade Lovelace
This is required to make more meson stuff easier/possible, and honestly it *is* now Lix sources anyhow. Change-Id: Ia6c38fabce9aa5c53768745ee38c5cf344f5c226
2024-08-20build: build lix-doc with Meson! 🎉Qyriad
lix-doc is now built with Meson, with lix-doc's dependencies built as Meson subprojects, either fetched on demand with .wrap files, or fetched in advance by Nix with importCargoLock. It even builds statically. Fixes #256. Co-authored-by: Lunaphied <lunaphied@lunaphied.me> Co-authored-by: Jade Lovelace <lix@jade.fyi> Change-Id: I3a4731ff13278e7117e0316bc0d7169e85f5eb0c
2024-08-10build: remove expect as a dependencyJade Lovelace
I was packaging Lix 2.91 for nixpkgs and was annoyed at the expect dependency. Turns out that you can replace unbuffer with a pretty-short Python script. It became less short after I found out that Linux was converting \n to \r\n in the terminal subsystem, which was not very funny, but is at least solved by twiddling termios bits. Change-Id: I8a2700abcbbf6a9902e01b05b40fa9340c0ab90c
2024-08-09package: remove unused autotools code, empty fileJade Lovelace
I noticed there was some stuff setting configureFlags that definitely do not do anything with meson, so let's rip them out. As for the empty file, it was added when I was thinking I needed a fake C++ target to convince meson to create the necessary dependencies. That was not in fact possible so it should have never been committed. Change-Id: Ied4723d8a5d21aed85f352c48b080ab2c977a496
2024-08-08Merge changes I0373ac01,I7b543967,I537103eb into mainjade
* changes: releng: fix the git push releng: clarify/update docs, add instructions after tag Fix is_maintenance_branch heuristic
2024-08-08build: integrate clang-tidy into CIJade Lovelace
This still has utterly unacceptably bad output format design that I would not inflict on anyone I like, but it *does* now exist, and you *can* find the errors in the log. Future work would obviously be to fix that and integrate the actual errors into Gerrit using codechecker or so. Followup issue: https://git.lix.systems/lix-project/lix/issues/457 Fixes: https://git.lix.systems/lix-project/lix/issues/147 Change-Id: Ifca22e443d357762125f4ad6bc4f568af3a26c62
2024-08-07Fix is_maintenance_branch heuristicJade Lovelace
This was broken because Nix language's version comparison does not know how to deal with versions like -rc1 and considers them newer, which is in this case not desirable. That in turn led to not tagging 2.90.0 docker images as "latest" since the heuristic was wrong. This commit also adds some more cross-checking and failsafes in case the person running releng does not have a local main branch that is up to date. Fixes: https://git.lix.systems/lix-project/lix/issues/443 Change-Id: I537103ebab58ae978c00e06972abe14432dd9c80
2024-08-07Merge "package: improve support for building without BDW-GC" into mainalois31
2024-08-06package: don't hide system-wide manual pagesAlois Wohlschlager
When MANPATH is unset or contains an empty component, a reasonable default is used. Previously (after 3dced96741816db01f9990e0884224d38ee58390), when MANPATH was unset, the shell hook would only place a location containing the Lix manual pages there, and system-wide manual pages would become unavailable in the development shell, which is undesired. Fix the issue by including an empty component in this case. Change-Id: Ib3c67a831d709fe2a87520e15917eebb59397bd1
2024-08-03package: improve support for building without BDW-GCAlois Wohlschlager
Expose an option for disabling the BDW-GC build dependency entirely. Fix the place where one of its headers was included (unnecessarily) without proper guarding. Finally, use this machinery to exclude BDW-GC from the ASAN builds entirely (its usage has already been disabled due to compatibility issues anyway), to ensure this configuration is not regressed again. Change-Id: I2ebe8094abf67e7d1e99eed971de3e99d071c10b
2024-08-02Merge "package: make aws-sdk-cpp build input optional" into mainJeremy List
2024-08-02Merge "nix flake show: add the description if it exists" into mainIsabel
2024-08-02package: make aws-sdk-cpp build input optionalJeremy List
I have added an option to turn off this build input because I'm much more comfortable when I don't have that type of thing on my computer. Its default value is true in order to avoid impacting anyone who depends on AWS features. Change-Id: Ic57f3c9b9468f422e9fbdcf3ba0fe96177631067
2024-07-31releng: move officialRelease to version.jsonJade Lovelace
This was causing a few bits of suffering downstream, in particular, in the NixOS module, which, after this change, can have the `officialRelease` stuff in *it* completely deleted since we now have correct defaulting in package.nix for it. It also eliminates some automated editing of Nix files, which is certainly always welcome to eliminate. Fixes: https://git.lix.systems/lix-project/lix/issues/406 Change-Id: Id12f3018cff4633e379dbfcbe26b7bc84922bdaf
2024-07-31Add -Werror CI jobJade Lovelace
We should cause CLs that introduce compiler warnings to fail CI. Sadly this will only cover Clang, but it will cover Clang for free, so it's truly impossible to say if it's bad or not. Change-Id: I45ca20d77251af9671d5cbe0d29cb08c5f1d03c2
2024-07-31ci: add a asan+ubsan test run on x86_64-linuxJade Lovelace
This should at least catch out blatantly bad patches that don't pass the test suite with ASan. We don't do this to the integration tests since they run on relatively limited-memory VMs and so it may not be super safe to run an evaluator with leak driven garbage collection for them. Fixes: https://git.lix.systems/lix-project/lix/issues/403 Fixes: https://git.lix.systems/lix-project/lix/issues/319 Change-Id: I5267b02626866fd33e8b4d8794344531af679f78
2024-07-26devendor pegtlvigress8
Change-Id: I609a58985fc5210806d0959049a48976ae079c30
2024-07-26Merge changes I45d3895f,I541be3ea,Ibe51416d into mainalois31
* changes: libstore/build: block io_uring libstore/build: use an allowlist approach to syscall filtering libstore/build: always treat seccomp setup failures as fatal
2024-07-25libstore/build: use an allowlist approach to syscall filteringAlois Wohlschlager
Previously, system call filtering (to prevent builders from storing files with setuid/setgid permission bits or extended attributes) was performed using a blocklist. While this looks simple at first, it actually carries significant security and maintainability risks: after all, the kernel may add new syscalls to achieve the same functionality one is trying to block, and it can even be hard to actually add the syscall to the blocklist when building against a C library that doesn't know about it yet. For a recent demonstration of this happening in practice to Nix, see the introduction of fchmodat2 [0] [1]. The allowlist approach does not share the same drawback. While it does require a rather large list of harmless syscalls to be maintained in the codebase, failing to update this list (and roll out the update to all users) in time has rather benign effects; at worst, very recent programs that already rely on new syscalls will fail with an error the same way they would on a slightly older kernel that doesn't support them yet. Most importantly, no unintended new ways of performing dangerous operations will be silently allowed. Another possible drawback is reduced system call performance due to the larger filter created by the allowlist requiring more computation [2]. However, this issue has not convincingly been demonstrated yet in practice, for example in systemd or various browsers. To the contrary, it has been measured that the the actual filter constructed here has approximately the same overhead as a very simple filter blocking only one system call. This commit tries to keep the behavior as close to unchanged as possible. The system call list is in line with libseccomp 2.5.5 and glibc 2.39, which are the latest versions at the point of writing. Since libseccomp 2.5.5 is already a requirement and the distributions shipping this together with older versions of glibc are mostly not a thing any more, this should not lead to more build failures any more. [0] https://github.com/NixOS/nixpkgs/issues/300635 [1] https://github.com/NixOS/nix/issues/10424 [2] https://github.com/flatpak/flatpak/pull/4462#issuecomment-1061690607 Change-Id: I541be3ea9b249bcceddfed6a5a13ac10b11e16ad
2024-07-23package.nix: remove dead codeJade Lovelace
Change-Id: Ic0dfcfe27dbf13da4f7f74f5fab8ce6fa718d28f
2024-07-23nix flake show: add the description if it existsisabel
(cherry picked from commit 8cd1d02f90eb9915e640c5d370d919fad9833c65) nix flake show: Only print up to the first new line if it exists. (cherry picked from commit 5281a44927bdb51bfe6e5de12262d815c98f6fe7) add tests (cherry picked from commit 74ae0fbdc70a5079a527fe143c4832d1357011f7) Handle long strings, embedded new lines and empty descriptions (cherry picked from commit 2ca7b3afdbbd983173a17fa0a822cf7623601367) Account for total length of 80 (cherry picked from commit 1cc808c18cbaaf26aaae42bb1d7f7223f25dd364) docs: add nix flake show description release note fix: remove white space nix flake show: trim length based on terminal size test: account for terminal size docs(flake-description): before and after commands; add myself to credits Upstream-PR: https://github.com/NixOS/nix/pull/10980 Change-Id: Ie1c667dc816b3dd81e65a1f5395e57ea48ee0362
2024-07-22De-vendor nixfmtvigress8
Change-Id: I1a051be495318a507d07f6d0a6b157616e26774c
2024-07-16remove sourceToSink, sinkToSource, and boehm patcheldritch horrors
Change-Id: I1379841299713175d0225b82a67f50660f9eb5e2
2024-07-10Merge "lix-doc: update dependencies and refactor" into mainlunaphied
2024-07-10devShell: Fix errors with environment variablespiegames
Previous code assumed that $MANPATH always exists Change-Id: I5a4d012045ba6ff9086373b3f46a75d82285d393
2024-07-10lix-doc: update dependencies and refactorLunaphied
This updates the version of rnix used and refactors the code generally to be more precise and capable in it's identification of both lambdas and determining which documentation comments are attached. Change-Id: Ib0dddabd71f772c95077f9d7654023b37a7a1fd2
2024-06-26packaging: make pegtl use the __forDefaults mechanismJade Lovelace
This avoids needing to pass it in when callPackage'ing Lix from external code. Change-Id: Ie07e84a151e38614064609a2f6dbff165e193be7
2024-06-25Merge "change shebangs of all .sh scripts to bash" into mainjade
2024-06-25Merge changes If0ddec6b,Iaa63ed18 into mainjade
* changes: Add some release notes for things we did packaging: don't build internal api docs by default in dev shells
2024-06-25libexpr: rewrite the parser with pegtl instead of flex/bisoneldritch horrors
this gives about 20% performance improvements on pure parsing. obviously it will be less on full eval, but depending on how much parsing is to be done (e.g. including hackage-packages.nix or not) it's more like 4%-10%. this has been tested (with thousands of core hours of fuzzing) to ensure that the ASTs produced by the new parser are exactly the same as the old one would have produced. error messages will change (sometimes by a lot) and are not yet perfect, but we would rather leave this as is for later. test results for running only the parser (excluding the variable binding code) in a tight loop with inputs and parameters as given are promising: - 40% faster on lix's package.nix at 10000 iterations - 1.3% faster on nixpkgs all-packages.nix at 1000 iterations - equivalent on all of nixpkgs concatenated at 100 iterations (excluding invalid files, each file surrounded with parens) more realistic benchmarks are somewhere in between the extremes, parsing once again getting the largest uplift. other realistic workloads improve by a few percentage points as well, notably system builds are 4% faster. Benchmarks summary (from ./bench/summarize.jq bench/bench-*.json) old/bin/nix --extra-experimental-features 'nix-command flakes' eval -f bench/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix mean: 0.408s ± 0.025s user: 0.355s | system: 0.033s median: 0.389s range: 0.388s ... 0.442s relative: 1 new/bin/nix --extra-experimental-features 'nix-command flakes' eval -f bench/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix mean: 0.332s ± 0.024s user: 0.279s | system: 0.033s median: 0.314s range: 0.313s ... 0.361s relative: 0.814 --- old/bin/nix --extra-experimental-features 'nix-command flakes' eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' mean: 6.133s ± 0.022s user: 5.395s | system: 0.437s median: 6.128s range: 6.099s ... 6.183s relative: 1 new/bin/nix --extra-experimental-features 'nix-command flakes' eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' mean: 5.925s ± 0.025s user: 5.176s | system: 0.456s median: 5.934s range: 5.861s ... 5.943s relative: 0.966 --- GC_INITIAL_HEAP_SIZE=10g old/bin/nix eval --extra-experimental-features 'nix-command flakes' --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' mean: 4.503s ± 0.027s user: 3.731s | system: 0.547s median: 4.499s range: 4.478s ... 4.541s relative: 1 GC_INITIAL_HEAP_SIZE=10g new/bin/nix eval --extra-experimental-features 'nix-command flakes' --raw --impure --expr 'with import <nixpkgs/nixos> {}; system' mean: 4.285s ± 0.031s user: 3.504s | system: 0.571s median: 4.281s range: 4.221s ... 4.328s relative: 0.951 --- old/bin/nix --extra-experimental-features 'nix-command flakes' search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870 hello mean: 16.475s ± 0.07s user: 14.088s | system: 1.572s median: 16.495s range: 16.351s ... 16.536s relative: 1 new/bin/nix --extra-experimental-features 'nix-command flakes' search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870 hello mean: 15.973s ± 0.013s user: 13.558s | system: 1.615s median: 15.973s range: 15.946s ... 15.99s relative: 0.97 --- Change-Id: Ie66ec2d045dec964632c6541e25f8f0797319ee2
2024-06-24packaging: don't build internal api docs by default in dev shellsJade Lovelace
These are totally available and you can just turn them on, but they have very bad dependency tracking and thus bloat incremental change times, which is not really ok. Change-Id: Iaa63ed18a789e74fcb757248cd24c3b194afcc80
2024-06-24change shebangs of all .sh scripts to bashvigress8
On operating systems where /bin/sh is not Bash, some scripts are invalid because of bashisms, and building Lix fails with errors like this: `render-manpage.sh: 3: set: Illegal option -o pipefail` This modifies all scripts that use a `/bin/sh` shebang to `/usr/bin/env bash`, including currently POSIX-compliant ones, to prevent any future confusion. Change-Id: Ia074cc6db42d40fc59a63726f6194ea0149ea5e0
2024-06-24devShell: guard against running from another directoryJade Lovelace
I was working on nix-eval-jobs with a dev shell with some shenanigans to run against a locally built Lix and it was getting really annoying when `nix develop ../lix#` was messing up my other git repo's hooks. This is a fix via blunt force, but it is at least obvious how it works. Change-Id: Ia29eeb5be57ab6a2c88451c00ea18a51e4dfe65e
2024-06-13packaging: Move binaryTarball to a passthru attr in package.nixJade Lovelace
This is motivated by flakes being bad and all the stuff that calls things by "system" being utterly unable to cope with cross compilation. So if we go shove it in package.nix it is suddenly usable from cross contexts. Usage: ``` nix build -L .#nix-riscv64-linux.binaryTarball ``` Change-Id: I702ebf2ac5bd9d1c57662f968b000073134df336
2024-06-12dev shell: Add bashInteractivePierre Bourdon
This was bothersome to me as a zsh+direnv user. Change-Id: Ia5b54cc63647a5c6ced2b5412e972dac1abf8184