| Commit message (Expand) | Author | Age | Files | Lines |
| * | lib.fileset: Fix tests on Darwin, more POSIX•••This was found when trying to run the fileset tests on Darwin
(https://github.com/NixOS/nix/pull/9546#issuecomment-1967409445), which mysteriously fail on Darwin:
test case at lib/fileset/tests.sh:342 failed: toSource { root = "/nix/store/foobar"; fileset = ./.; } should have errored with this regex pattern:
lib.fileset.toSource: `root` \(/nix/store/foobar\) is a string-like value, but it should be a path instead.
\s*Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.
but this was the actual error:
error: lib.fileset.toSource: `root` (/nix/store/foobar) is a string-like value, but it should be a path instead.
Paths in strings are not supported by `lib.fileset`, use `lib.sources` or derivations instead.
After dissecting this, I find out that apparently \s works on Linux, but not on Darwin for some reason!
From the bash source code, it looks like <regex.h> with `REG_EXTENDED` is used for all platforms the same,
so there's nothing odd there.
It's almost impossible to know where <regex.h> comes from,
but it looks to be a POSIX thing.
So after digging through the almost impossible to find POSIX specifications
(https://pubs.opengroup.org/onlinepubs/007908799/xbd/re.html#tag_007_003_005),
I can indeed confirm that there's no mention of \s or the like!
_However_, there is a mention of `[[:blank:]]`, so we'll use that instead.
| Silvan Mosberger | 2024-02-27 | 1 | -48/+52 |
| * | lib.fileset.toList: init | Silvan Mosberger | 2024-02-26 | 1 | -2/+22 |
| * | lib.fileset.gitTracked: Allow clones of shallow repositories•••The only reason shallow clones are not the default in
`builtins.fetchGit` is that `revCount` can't be provided when cloning a
shallow repository. However, `revCount` isn't used or exposed by
`lib.fileset`. Hence, allowing cloning shallow repositories makes
`gitTracked` more general without any drawbacks.
Co-authored-by: Silvan Mosberger <github@infinisil.com>
| ibbem | 2024-02-01 | 1 | -0/+13 |
| * | Remove --simulate-pure-eval | Silvan Mosberger | 2023-12-19 | 1 | -36/+18 |
| * | lib.fileset.gitTracked: Support out-of-tree builds | Silvan Mosberger | 2023-12-19 | 1 | -3/+53 |
| * | lib.fileset.gitTracked: Improve error when passing files | Silvan Mosberger | 2023-12-11 | 1 | -0/+6 |
| * | Merge pull request #266362 from tweag/fileset.fileFilter-ext•••`lib.fileset.fileFilter`: Predicate attribute for file extension | Silvan Mosberger | 2023-11-24 | 1 | -1/+34 |
| |\ |
|
| | * | lib.fileset.fileFilter: Predicate attribute for file extension | Silvan Mosberger | 2023-11-23 | 1 | -1/+34 |
| * | | lib.fileset.maybeMissing: init | Silvan Mosberger | 2023-11-20 | 1 | -1/+36 |
| |/ |
|
| * | lib.fileset: Minor changes•••- Make fromSource's missing file error message more consistent with others,
and add a test for it
- Indent some function arguments
- Fix an internal type
| Silvan Mosberger | 2023-11-19 | 1 | -1/+6 |
| * | lib.fileset.gitTracked: Better error in pure eval | Silvan Mosberger | 2023-11-16 | 1 | -16/+42 |
| * | lib.fileset.gitTrackedWith: Introduce recurseSubmodules parameter | Silvan Mosberger | 2023-11-16 | 1 | -3/+26 |
| * | lib.fileset.gitTracked/gitTrackedWith: init•••A configuration parameter for gitTrackedWith will be introduced in the
next commit
| Silvan Mosberger | 2023-11-16 | 1 | -1/+146 |
| * | lib.fileset.fileFilter: Restrict second argument to paths•••While this change is backwards-incompatible, I think it's okay because:
- The `fileFilter` function is not yet in a stable NixOS release, it was only merged about [a month ago](https://github.com/NixOS/nixpkgs/pull/257356).
- All public uses of the function on GitHub only pass a path
- Any `fileFilter pred fileset` can also be expressed as `intersection fileset (fileFilter pred path)` without loss of functionality.
- This is furthermore pointed out in the new error message when a file set is passed
| Silvan Mosberger | 2023-11-15 | 1 | -11/+4 |
| * | Merge pull request #267381 from tweag/fileset.fileFilter-path•••`fileset.fileFilter`: Don't run predicate unnecessarily | Silvan Mosberger | 2023-11-15 | 1 | -0/+27 |
| |\ |
|
| | * | lib.fileset.fileFilter: Don't run predicate unnecessarily•••Before:
nix-repl> fileset.trace (fileset.fileFilter (file: builtins.trace file.name false) ./default.nix)
trace: README.md
trace: benchmark.sh
trace: default.nix
trace: internal.nix
trace: mock-splitRoot.nix
trace: tests.sh
After:
nix-repl> fileset.trace (fileset.fileFilter (file: builtins.trace file.name false) ./default.nix)
trace: default.nix
| Silvan Mosberger | 2023-11-14 | 1 | -0/+20 |
| | * | lib.fileset.fileFilter: Minor cleanups and more tests | Silvan Mosberger | 2023-11-14 | 1 | -0/+7 |
| * | | Merge pull request #261732 from tweag/fileset.fromSource•••`lib.fileset.fromSource`: init | Robert Hensing | 2023-11-10 | 1 | -26/+262 |
| |\ \
| |/
|/| |
|
| | * | lib.fileset.toSource: Mention fromSource in errors | Silvan Mosberger | 2023-11-08 | 1 | -0/+7 |
| | * | lib.fileset.fromSource: init | Silvan Mosberger | 2023-11-08 | 1 | -0/+213 |
| | * | lib.fileset: Split out internal test helper | Silvan Mosberger | 2023-11-08 | 1 | -26/+42 |
| * | | lib.fileset: Make error messages more uniform•••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
| Silvan Mosberger | 2023-11-08 | 1 | -23/+23 |
| * | | Merge pull request #259065 from tweag/fileset.difference•••`lib.fileset.difference`: init | Silvan Mosberger | 2023-11-01 | 1 | -0/+98 |
| |\ \ |
|
| | * | | lib.fileset.difference: init | Silvan Mosberger | 2023-10-30 | 1 | -0/+98 |
| * | | | lib.fileset.toSource: Improve error for unknown file types•••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
| Silvan Mosberger | 2023-10-30 | 1 | -1/+3 |
| * | | | lib.fileset.toSource: Test with unknown file type•••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)
| Silvan Mosberger | 2023-10-26 | 1 | -0/+5 |
| * | | | lib.fileset: Fix shellcheck warnings in tests | Silvan Mosberger | 2023-10-26 | 1 | -4/+4 |
| |/ / |
|
| * / | lib.fileset.fileFilter: init | Silvan Mosberger | 2023-10-24 | 1 | -0/+67 |
| |/ |
|
| * | lib.fileset: Improved error for unsupported coercion values | Silvan Mosberger | 2023-10-16 | 1 | -2/+2 |
| * | lib.fileset.intersection: init | Silvan Mosberger | 2023-10-11 | 1 | -0/+95 |
| * | Merge pull request #256417 from tweag/fileset.trace•••`lib.fileset.trace`, `lib.fileset.traceVal`: init | Silvan Mosberger | 2023-10-04 | 1 | -59/+286 |
| |\ |
|
| | * | lib.fileset: Don't use ulimit for testing tracing | Silvan Mosberger | 2023-10-04 | 1 | -8/+13 |
| | * | lib.fileset: Refactor inotify testing to be reusable | Silvan Mosberger | 2023-10-04 | 1 | -51/+87 |
| | * | lib.fileset: Mention trace functions in the file set evaluation error | Silvan Mosberger | 2023-10-04 | 1 | -2/+6 |
| | * | lib.fileset.traceVal: init | Silvan Mosberger | 2023-10-04 | 1 | -0/+14 |
| | * | lib.fileset.trace: init | Silvan Mosberger | 2023-10-04 | 1 | -0/+151 |
| | * | lib.fileset: Make expectEqual check more | Silvan Mosberger | 2023-10-04 | 1 | -4/+21 |
| | * | lib.fileset: Order noEval last | Silvan Mosberger | 2023-10-03 | 1 | -2/+2 |
| * | | lib.fileset.unions: Fix outdated docs•••Since 4f35f003e6e5b800be75e3985054e5fce2dea50a unions supports empty lists too
| Silvan Mosberger | 2023-10-03 | 1 | -1/+1 |
| |/ |
|
| * | Merge pull request #257351 from tweag/fileset.empty•••`lib.fileset`: Representation for empty file sets without a base path | Robert Hensing | 2023-10-03 | 1 | -7/+33 |
| |\ |
|
| | * | lib.fileset: Internal representation v3, empty value without a base•••`unions []` now works!
Notably the new empty value without a base is not exposed in the interface.
I don't know of any use case for it.
| Silvan Mosberger | 2023-10-03 | 1 | -7/+33 |
| * | | lib.fileset: Don't use non-reproducible ulimit for stack overflow testing | Silvan Mosberger | 2023-09-29 | 1 | -6/+7 |
| |/ |
|
| * | lib.fileset: Minor changes from feedback•••Co-authored-by: Robert Hensing <robert@roberthensing.nl>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
| Silvan Mosberger | 2023-09-21 | 1 | -14/+14 |
| * | lib.fileset: Internal representation v2, ~12x faster unions!••• $ ./benchmark.sh HEAD
[...]
Mean CPU time 0.04006 (σ = 0.0040146) for 10 runs is 8.193619775953792% (σ = 0.9584251052704821%) of the old value 0.488917 (σ = 0.0294955)
[...]
| Silvan Mosberger | 2023-09-21 | 1 | -5/+7 |
| * | lib.fileset: Ignore irrelevant shellcheck warnings | Silvan Mosberger | 2023-09-21 | 1 | -0/+2 |
| * | lib.fileset.unions: Don't stack overflow for many files | Silvan Mosberger | 2023-09-21 | 1 | -0/+13 |
| * | lib.fileset: Optimise tests•••Previously a lot of processes were used, slowing it down considerably
the more files were tested
| Silvan Mosberger | 2023-09-21 | 1 | -4/+18 |
| * | lib.fileset: Various updates relating to union/unions•••Also some minor formatting improvements
| Silvan Mosberger | 2023-09-21 | 1 | -1/+1 |
| * | lib.fileset: Create tests for union and unions | Silvan Mosberger | 2023-09-21 | 1 | -0/+82 |
| * | lib.fileset.toSource: Evaluate fileset even for empty directories | Silvan Mosberger | 2023-09-13 | 1 | -0/+3 |