about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2023-11-13doc: separate commit header conventions for each area, info on docs changes.DS1-0/+20
2023-11-14Merge pull request #265710 from ShamrockLee/lib-copy-function-argsSilvan Mosberger3-9/+45
lib.mirrorFunctionArgs: init
2023-11-13lib.fileset: Very minor changesSilvan Mosberger2-4/+1
2023-11-11Merge master into staging-nextgithub-actions[bot]1-5/+5
2023-11-11treewide: fix redirected and broken URLsAnthony Roussel1-5/+5
Using the script in maintainers/scripts/update-redirected-urls.sh
2023-11-11Merge staging-next into staginggithub-actions[bot]4-29/+398
2023-11-10Merge pull request #261732 from tweag/fileset.fromSourceRobert Hensing4-29/+398
`lib.fileset.fromSource`: init
2023-11-10Merge staging-next into staginggithub-actions[bot]4-57/+83
2023-11-09Merge pull request #266349 from tweag/fileset/cleanupsSilvan Mosberger3-57/+54
Minor `lib.fileset` cleanups
2023-11-09lib: add asserts.assertEachOneOfProfpatsch1-0/+29
Along the lines of `assertOneOf`, but expects a list of values to be compared. This gives a good error message and is useful for lists of values, like `supportedGhcVersions` in the arguments of `haskell-language-server`.
2023-11-09lib.systems: elaborate Rust metadataAlyssa Ross1-2/+98
We need this stuff to be available in lib so make-derivation.nix can access it to construct the Meson cross file. This has a couple of other advantages: - It makes Rust less special. Now figuring out what Rust calls a platform is the same as figuring out what Linux or QEMU call it. - We can unify the schema used to define Rust targets, and the schema used to access those values later. Just like you can set "config" or "system" in a platform definition, and then access those same keys on the elaborated platform, you can now set "rustcTarget" in your crossSystem, and then access "stdenv.hostPlatform.rustcTarget" in your code. "rustcTarget", "rustcTargetSpec", "cargoShortTarget", and "cargoEnvVarTarget" have the "rustc" and "cargo" prefixes because these are not exposed to code by the compiler, and are not standardized. The arch/os/etc. variables are all named to match the forms in the Rust target spec JSON. The new rust.target-family only takes a list, since we don't need to worry about backwards compatibility when that name is used. The old APIs are all still functional with no warning for now, so that it's possible for external code to use a single API on both 23.05 and 23.11. We can introduce the warnings once 23.05 is EOL, and make them hard errors when 23.11 is EOL.
2023-11-09lib.fileset: Remove unused bindingsSilvan Mosberger1-3/+0
Thanks nixd!
2023-11-08lib.fileset: Make error messages more uniformSilvan Mosberger3-45/+47
Just minor changes like: - Always using "X is a Y, but it should be Z" - "X is a path that does not exist" rather than "X does not exist" - Always using multi-line strings for errors - Always quoting string-like values and not quoting path-like values - But do quote filesystem roots. Even though they're paths, they might be very small, good to have quotes to know the start/end - Capitalise the first word - Distinguish root vs filesystem root more
2023-11-08lib.fileset: Remove nixdoc workaroundSilvan Mosberger1-9/+7
This problem was fixed in https://github.com/nix-community/nixdoc/pull/81 which is included in version 2.5.1, which is now used in Nixpkgs
2023-11-08lib.licenses: nvidia*: add shortName-sSomeone Serge1-0/+1
2023-11-08cudaPackages: redist components: per-package license urlSomeone Serge1-0/+8
2023-11-08lib.licenses: nvidia*: use same fullNames as conda doesSomeone Serge1-1/+1
2023-11-08cudnn_cudatoolkit: add NVIDIA licenseTyler Benster1-6/+0
2023-11-08lib.licenses: add NVIDIA licensesTyler Benster1-0/+12
2023-11-08lib.fileset.toSource: Mention fromSource in errorsSilvan Mosberger4-3/+19
2023-11-08lib.fileset.fromSource: initSilvan Mosberger3-0/+337
2023-11-08lib.fileset: Split out internal test helperSilvan Mosberger1-26/+42
2023-11-07Merge pull request #261676 from h7x4/lib-add-replicatestringSilvan Mosberger2-0/+19
lib.strings: add `replicate`
2023-11-07lib.makeOverridable: simplify function arguments preservationYueh-Shun Li1-8/+10
Rename temporary variable copyArgs -> mirrorArgs. Use lib.mirrorFunctionArgs to define `mirrorArgs`. Apply mirrorArgs also to the returned function.
2023-11-07lib.mirrorFunctionArgs: initYueh-Shun Li2-1/+35
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2023-11-05lib.systems.inspect: add patternLogicalAndAdam Joseph1-0/+26
2023-11-04Merge pull request #265045 from Artturin/addcomment1Artturi1-0/+17
2023-11-04lib.systems, test.cross.sanity: add test case for #264989Adam Joseph1-0/+1
We have several cross-compilation bugs that show up if hostPlatform!=buildPlatform yet hostPlatform.config==buildPlatform.config. These bugs have appeared and disappeared as we've fiddled with the definition of equality for platform objects. This commit adds a clear-cut case where they are *not* equal and never will be, so we can test it.
2023-11-02Merge pull request #264892 from tweag/fileset-store-path-rationaleSilvan Mosberger1-0/+3
lib.fileset: Add an additional argument in the design docs
2023-11-02lib.makeScopeWithSplicing': add commentsArtturin1-0/+17
I didn't add these arguments, so these comments are from my understading of the arguments.
2023-11-01lib.fileset: Add an additional argument in the design docsSilvan Mosberger1-0/+3
2023-11-01Merge pull request #264860 from tweag/filesystem-error-testEelco Dolstra1-2/+8
lib.filesystem: Don't test Nix-specific error messages
2023-11-01Merge pull request #259065 from tweag/fileset.differenceSilvan Mosberger3-0/+231
`lib.fileset.difference`: init
2023-11-01lib.filesystem: Don't test Nix-specific error messagesSilvan Mosberger1-2/+8
In https://github.com/NixOS/nix/pull/9269 the error messages change which would've broken this test.
2023-10-31lib.strings: add `replicate`h7x42-0/+19
`strings.replicate` returns n copies of a string, concatenated into a new string Co-authored-by: Silvan Mosberger <github@infinisil.com>
2023-10-31lib/fixed-points.nix: correct typoAlexander Groleau1-1/+1
Corrects a minor typo in the description of `fix`; namely that `fix` allows factoring out syntactic recursion from another function.
2023-10-31Merge pull request #260971 from Gerg-L/getExeSilvan Mosberger2-1/+36
lib.getExe': check arguments
2023-10-30Merge pull request #263478 from tweag/fileset/unknown-type-errorRobert Hensing2-24/+43
`lib.fileset.toSource`: Improve error for unknown file types
2023-10-30lib.fileset.difference: initSilvan Mosberger3-0/+231
2023-10-30lib.fileset.toSource: Optimise unknown file type errorSilvan Mosberger1-27/+28
Compared to the parent commit, this removes any detectable performance cost :)
2023-10-30lib.fileset.toSource: Improve error for unknown file typesSilvan Mosberger2-20/+33
This does decrease performance unfortunately Benchmarking expression toSource { root = ./.; fileset = ./.; } Mean CPU time 0.103747 (σ = 0.012415) for 10 runs is 97.32181384964636% (σ = 16.34179537413021%) of the old value 0.106602 (σ = 0.0125571) Statistic .envs.elements (205920) is 105.5842% (+10891) of the old value 195029 Statistic .gc.totalBytes (20247696) is 101.7495% (+348160) of the old value 19899536 Statistic .nrThunks (134824) is 108.7878% (+10891) of the old value 123933 Statistic .symbols.number (996) is 100.1005% (+1) of the old value 995 Statistic .values.number (275238) is 104.1199% (+10891) of the old value 264347
2023-10-26lib.fileset.toSource: Test with unknown file typeSilvan Mosberger1-0/+5
Currently just throws the Nix error because unknown file types are not supported by the Nix store, but nothing catches this error earlier (yet, see next commit)
2023-10-26lib.fileset: Fix shellcheck warnings in testsSilvan Mosberger1-4/+4
2023-10-25Merge pull request #262838 from amjoseph-nixpkgs/pr/lib/systems/abi-suffixJohn Ericson1-1/+10
lib/systems/parse.nix: add removeAbiSuffix, use it
2023-10-24Merge pull request #260265 from tweag/fileset.fileFilterRobert Hensing3-0/+144
`lib.fileset.fileFilter`: init
2023-10-24lib.fileset.fileFilter: initSilvan Mosberger3-0/+144
2023-10-22lib/systems/parse.nix: add, use removeAbiSuffixAdam Joseph1-1/+10
gnu-config will ignore the portion of a triple matching the regex `e?abi.*$` when determining the validity of a triple. In other words, `i386-linuxabichickenlips` is a valid triple. This commit updates our parsing routines to match gnu-config. I was recently surprised to discover that it is in fact possible to shoehorn ABI flavors into nix doubles in a way which preserves their property of being a (non-canonical) subset of the valid gnu-config triples. This commit is required in order to exploit that discovery to add automatic detection of ILP32 platforms (64-bit void*, 32-bit int, like the Apple Watch and MIPS n32) to Nix.
2023-10-21lib.overrideDerivation: inter-link the documentationYueh-Shun Li1-2/+1
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-10-21doc: lib.customization: add Type and Example tagsYueh-Shun Li1-19/+70
Add the "Type:" blocks. Move the examples below the descriptions whenever possibles Add "Example:" tags before the examples moved below the descriptions.
2023-10-16lib/tests: add tests for getExe' and getExeGerg-L1-0/+28