···21 with:
22 # pull_request_target checks out the base branch by default
23 ref: refs/pull/${{ github.event.pull_request.number }}/merge
000000000024 - uses: cachix/install-nix-action@v23
25 - name: Determining channel to use for dependencies
26 run: |
···51 # Passing --max-jobs 0 makes sure that we won't build anything
52 nix-build "$nixpkgs" -A tests.nixpkgs-check-by-name --max-jobs 0
53 - name: Running nixpkgs-check-by-name
54- run: result/bin/nixpkgs-check-by-name .
0000000000000000000000000000000000000000000000000000000000000000000000000000000
···21 with:
22 # pull_request_target checks out the base branch by default
23 ref: refs/pull/${{ github.event.pull_request.number }}/merge
24+ # Fetches the merge commit and its parents
25+ fetch-depth: 2
26+ - name: Determining PR git hashes
27+ run: |
28+ echo "mergedSha=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
29+30+ # For pull_request_target this is the same as $GITHUB_SHA
31+ echo "baseSha=$(git rev-parse HEAD^1)" >> "$GITHUB_ENV"
32+33+ echo "headSha=$(git rev-parse HEAD^2)" >> "$GITHUB_ENV"
34 - uses: cachix/install-nix-action@v23
35 - name: Determining channel to use for dependencies
36 run: |
···61 # Passing --max-jobs 0 makes sure that we won't build anything
62 nix-build "$nixpkgs" -A tests.nixpkgs-check-by-name --max-jobs 0
63 - name: Running nixpkgs-check-by-name
64+ run: |
65+ echo "Checking whether the check succeeds on the base branch $GITHUB_BASE_REF"
66+ git checkout -q "$baseSha"
67+ if baseOutput=$(result/bin/nixpkgs-check-by-name . 2>&1); then
68+ baseSuccess=1
69+ else
70+ baseSuccess=
71+ fi
72+ printf "%s\n" "$baseOutput"
73+74+ echo "Checking whether the check would succeed after merging this pull request"
75+ git checkout -q "$mergedSha"
76+ if mergedOutput=$(result/bin/nixpkgs-check-by-name . 2>&1); then
77+ mergedSuccess=1
78+ exitCode=0
79+ else
80+ mergedSuccess=
81+ exitCode=1
82+ fi
83+ printf "%s\n" "$mergedOutput"
84+85+ resultToEmoji() {
86+ if [[ -n "$1" ]]; then
87+ echo ":heavy_check_mark:"
88+ else
89+ echo ":x:"
90+ fi
91+ }
92+93+ # Print a markdown summary in GitHub actions
94+ {
95+ echo "| Nixpkgs version | Check result |"
96+ echo "| --- | --- |"
97+ echo "| Latest base commit | $(resultToEmoji "$baseSuccess") |"
98+ echo "| After merging this PR | $(resultToEmoji "$mergedSuccess") |"
99+ echo ""
100+101+ if [[ -n "$baseSuccess" ]]; then
102+ if [[ -n "$mergedSuccess" ]]; then
103+ echo "The check succeeds on both the base branch and after merging this PR"
104+ else
105+ echo "The check succeeds on the base branch, but would fail after merging this PR:"
106+ echo "\`\`\`"
107+ echo "$mergedOutput"
108+ echo "\`\`\`"
109+ echo ""
110+ fi
111+ else
112+ if [[ -n "$mergedSuccess" ]]; then
113+ echo "The check fails on the base branch, but this PR fixes it, nicely done!"
114+ else
115+ echo "The check fails on both the base branch and after merging this PR, unknown if only this PRs changes would satisfy the check, the base branch needs to be fixed first."
116+ echo ""
117+ echo "Failure on the base branch:"
118+ echo "\`\`\`"
119+ echo "$baseOutput"
120+ echo "\`\`\`"
121+ echo ""
122+ echo "Failure after merging this PR:"
123+ echo "\`\`\`"
124+ echo "$mergedOutput"
125+ echo "\`\`\`"
126+ echo ""
127+ fi
128+ fi
129+130+ echo "### Details"
131+ echo "- nixpkgs-check-by-name tool:"
132+ echo " - Channel: $channel"
133+ echo " - Nixpkgs commit: [$rev](https://github.com/${GITHUB_REPOSITORY}/commit/$rev)"
134+ echo " - Store path: \`$(realpath result)\`"
135+ echo "- Tested Nixpkgs:"
136+ echo " - Base branch $GITHUB_BASE_REF"
137+ echo " - Latest base branch commit: [$baseSha](https://github.com/${GITHUB_REPOSITORY}/commit/$baseSha)"
138+ echo " - Latest PR commit: [$headSha](https://github.com/${GITHUB_REPOSITORY}/commit/$headSha)"
139+ echo " - Merge commit: [$mergedSha](https://github.com/${GITHUB_REPOSITORY}/commit/$mergedSha)"
140+ } >> "$GITHUB_STEP_SUMMARY"
141+142+ exit "$exitCode"
143+
+6-5
doc/languages-frameworks/vim.section.md
···212213## Adding new plugins to nixpkgs {#adding-new-plugins-to-nixpkgs}
214215-Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names).
216217-After running `./update.py`, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`.
218219Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added:
220···241Alternatively, set the number of processes to a lower count to avoid rate-limiting.
242243```sh
244-./pkgs/applications/editors/vim/plugins/update.py --proc 1
0245```
246247## How to maintain an out-of-tree overlay of vim plugins ? {#vim-out-of-tree-overlays}
···250plugin list:
251252```
253-pkgs/applications/editors/vim/plugins/update.py -i vim-plugin-names -o generated.nix --no-commit
254```
255256with the contents of `vim-plugin-names` being for example:
···264265```nix
266myVimPlugins = pkgs.vimPlugins.extend (
267- (pkgs.callPackage generated.nix {})
268);
269```
270
···212213## Adding new plugins to nixpkgs {#adding-new-plugins-to-nixpkgs}
214215+Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`nix-shell -p vimPluginsUpdater --run vim-plugins-updater`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/updater.nix). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names).
216217+After running the updater, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`.
218219Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added:
220···241Alternatively, set the number of processes to a lower count to avoid rate-limiting.
242243```sh
244+245+nix-shell -p vimPluginsUpdater --run 'vim-plugins-updater --proc 1'
246```
247248## How to maintain an out-of-tree overlay of vim plugins ? {#vim-out-of-tree-overlays}
···251plugin list:
252253```
254+nix-shell -p vimPluginsUpdater --run vim-plugins-updater -i vim-plugin-names -o generated.nix --no-commit
255```
256257with the contents of `vim-plugin-names` being for example:
···265266```nix
267myVimPlugins = pkgs.vimPlugins.extend (
268+ (pkgs.callPackage ./generated.nix {})
269);
270```
271
+28-1
lib/fileset/README.md
···41- `_type` (constant string `"fileset"`):
42 Tag to indicate this value is a file set.
4344-- `_internalVersion` (constant `2`, the current version):
45 Version of the representation.
00000004647- `_internalBase` (path):
48 Any files outside of this path cannot influence the set of files.
···110 only removing files explicitly referenced by paths can break a file set expression.
111- (+) This can be removed later, if we discover it's too restrictive
112- (-) It leads to errors when a sensible result could sometimes be returned, such as in the above example.
00000000000000000000113114### Empty directories
115
···41- `_type` (constant string `"fileset"`):
42 Tag to indicate this value is a file set.
4344+- `_internalVersion` (constant `3`, the current version):
45 Version of the representation.
46+47+- `_internalIsEmptyWithoutBase` (bool):
48+ Whether this file set is the empty file set without a base path.
49+ If `true`, `_internalBase*` and `_internalTree` are not set.
50+ This is the only way to represent an empty file set without needing a base path.
51+52+ Such a value can be used as the identity element for `union` and the return value of `unions []` and co.
5354- `_internalBase` (path):
55 Any files outside of this path cannot influence the set of files.
···117 only removing files explicitly referenced by paths can break a file set expression.
118- (+) This can be removed later, if we discover it's too restrictive
119- (-) It leads to errors when a sensible result could sometimes be returned, such as in the above example.
120+121+### Empty file set without a base
122+123+There is a special representation for an empty file set without a base path.
124+This is used for return values that should be empty but when there's no base path that would makes sense.
125+126+Arguments:
127+- Alternative: This could also be represented using `_internalBase = /.` and `_internalTree = null`.
128+ - (+) Removes the need for a special representation.
129+ - (-) Due to [influence tracking](#influence-tracking),
130+ `union empty ./.` would have `/.` as the base path,
131+ which would then prevent `toSource { root = ./.; fileset = union empty ./.; }` from working,
132+ which is not as one would expect.
133+ - (-) With the assumption that there can be multiple filesystem roots (as established with the [path library](../path/README.md)),
134+ this would have to cause an error with `union empty pathWithAnotherFilesystemRoot`,
135+ which is not as one would expect.
136+- Alternative: Do not have such a value and error when it would be needed as a return value
137+ - (+) Removes the need for a special representation.
138+ - (-) Leaves us with no identity element for `union` and no reasonable return value for `unions []`.
139+ From a set theory perspective, which has a well-known notion of empty sets, this is unintuitive.
140141### Empty directories
142
+2-5
lib/fileset/default.nix
···156 lib.fileset.toSource: `root` is of type ${typeOf root}, but it should be a path instead.''
157 # Currently all Nix paths have the same filesystem root, but this could change in the future.
158 # See also ../path/README.md
159- else if rootFilesystemRoot != filesetFilesystemRoot then
160 throw ''
161 lib.fileset.toSource: Filesystem roots are not the same for `fileset` and `root` ("${toString root}"):
162 `root`: root "${toString rootFilesystemRoot}"
···170 lib.fileset.toSource: `root` (${toString root}) is a file, but it should be a directory instead. Potential solutions:
171 - If you want to import the file into the store _without_ a containing directory, use string interpolation or `builtins.path` instead of this function.
172 - If you want to import the file into the store _with_ a containing directory, set `root` to the containing directory, such as ${toString (dirOf root)}, and set `fileset` to the file path.''
173- else if ! hasPrefix root fileset._internalBase then
174 throw ''
175 lib.fileset.toSource: `fileset` could contain files in ${toString fileset._internalBase}, which is not under the `root` (${toString root}). Potential solutions:
176 - Set `root` to ${toString fileset._internalBase} or any directory higher up. This changes the layout of the resulting store path.
···264 filesets:
265 if ! isList filesets then
266 throw "lib.fileset.unions: Expected argument to be a list, but got a ${typeOf filesets}."
267- else if filesets == [ ] then
268- # TODO: This could be supported, but requires an extra internal representation for the empty file set, which would be special for not having a base path.
269- throw "lib.fileset.unions: Expected argument to be a list with at least one element, but it contains no elements."
270 else
271 pipe filesets [
272 # Annotate the elements with context, used by _coerceMany for better errors
···156 lib.fileset.toSource: `root` is of type ${typeOf root}, but it should be a path instead.''
157 # Currently all Nix paths have the same filesystem root, but this could change in the future.
158 # See also ../path/README.md
159+ else if ! fileset._internalIsEmptyWithoutBase && rootFilesystemRoot != filesetFilesystemRoot then
160 throw ''
161 lib.fileset.toSource: Filesystem roots are not the same for `fileset` and `root` ("${toString root}"):
162 `root`: root "${toString rootFilesystemRoot}"
···170 lib.fileset.toSource: `root` (${toString root}) is a file, but it should be a directory instead. Potential solutions:
171 - If you want to import the file into the store _without_ a containing directory, use string interpolation or `builtins.path` instead of this function.
172 - If you want to import the file into the store _with_ a containing directory, set `root` to the containing directory, such as ${toString (dirOf root)}, and set `fileset` to the file path.''
173+ else if ! fileset._internalIsEmptyWithoutBase && ! hasPrefix root fileset._internalBase then
174 throw ''
175 lib.fileset.toSource: `fileset` could contain files in ${toString fileset._internalBase}, which is not under the `root` (${toString root}). Potential solutions:
176 - Set `root` to ${toString fileset._internalBase} or any directory higher up. This changes the layout of the resulting store path.
···264 filesets:
265 if ! isList filesets then
266 throw "lib.fileset.unions: Expected argument to be a list, but got a ${typeOf filesets}."
000267 else
268 pipe filesets [
269 # Annotate the elements with context, used by _coerceMany for better errors
+56-13
lib/fileset/internal.nix
···28 drop
29 elemAt
30 filter
031 findFirstIndex
32 foldl'
33 head
···64 # - Increment this version
65 # - Add an additional migration function below
66 # - Update the description of the internal representation in ./README.md
67- _currentVersion = 2;
6869 # Migrations between versions. The 0th element converts from v0 to v1, and so on
70 migrations = [
···89 _internalVersion = 2;
90 }
91 )
000000000092 ];
93000000000000000094 # Create a fileset, see ./README.md#fileset
95 # Type: path -> filesetTree -> fileset
96 _create = base: tree:
···103 _type = "fileset";
104105 _internalVersion = _currentVersion;
00106 _internalBase = base;
107 _internalBaseRoot = parts.root;
108 _internalBaseComponents = components parts.subpath;
109 _internalTree = tree;
110111 # Double __ to make it be evaluated and ordered first
112- __noEval = throw ''
113- lib.fileset: Directly evaluating a file set is not supported. Use `lib.fileset.toSource` to turn it into a usable source instead.'';
114 };
115116 # Coerce a value to a fileset, erroring when the value cannot be coerced.
···155 _coerce "${functionContext}: ${context}" value
156 ) list;
157158- firstBaseRoot = (head filesets)._internalBaseRoot;
000159160 # Finds the first element with a filesystem root different than the first element, if any
161 differentIndex = findFirstIndex (fileset:
162- firstBaseRoot != fileset._internalBaseRoot
00163 ) null filesets;
164 in
165- if differentIndex != null then
0166 throw ''
167 ${functionContext}: Filesystem roots are not the same:
168 ${(head list).context}: root "${toString firstBaseRoot}"
···311 # Special case because the code below assumes that the _internalBase is always included in the result
312 # which shouldn't be done when we have no files at all in the base
313 # This also forces the tree before returning the filter, leads to earlier error messages
314- if tree == null then
315 empty
316 else
317 nonEmpty;
···321 # Type: [ Fileset ] -> Fileset
322 _unionMany = filesets:
323 let
324- first = head filesets;
00000325326 # To be able to union filesetTree's together, they need to have the same base path.
327 # Base paths can be unioned by taking their common prefix,
···332 # so this cannot cause a stack overflow due to a build-up of unevaluated thunks.
333 commonBaseComponents = foldl'
334 (components: el: commonPrefix components el._internalBaseComponents)
335- first._internalBaseComponents
336 # We could also not do the `tail` here to avoid a list allocation,
337 # but then we'd have to pay for a potentially expensive
338 # but unnecessary `commonPrefix` call
339- (tail filesets);
340341 # The common base path assembled from a filesystem root and the common components
342- commonBase = append first._internalBaseRoot (join commonBaseComponents);
343344 # A list of filesetTree's that all have the same base path
345 # This is achieved by nesting the trees into the components they have over the common base path
···351 setAttrByPath
352 (drop (length commonBaseComponents) fileset._internalBaseComponents)
353 fileset._internalTree
354- ) filesets;
355356 # Folds all trees together into a single one using _unionTree
357 # We do not use a fold here because it would cause a thunk build-up
358 # which could cause a stack overflow for a large number of trees
359 resultTree = _unionTrees trees;
360 in
361- _create commonBase resultTree;
0000362363 # The union of multiple filesetTree's with the same base path.
364 # Later elements are only evaluated if necessary.
···28 drop
29 elemAt
30 filter
31+ findFirst
32 findFirstIndex
33 foldl'
34 head
···65 # - Increment this version
66 # - Add an additional migration function below
67 # - Update the description of the internal representation in ./README.md
68+ _currentVersion = 3;
6970 # Migrations between versions. The 0th element converts from v0 to v1, and so on
71 migrations = [
···90 _internalVersion = 2;
91 }
92 )
93+94+ # Convert v2 into v3: filesetTree's now have a representation for an empty file set without a base path
95+ (
96+ filesetV2:
97+ filesetV2 // {
98+ # All v1 file sets are not the new empty file set
99+ _internalIsEmptyWithoutBase = false;
100+ _internalVersion = 3;
101+ }
102+ )
103 ];
104105+ _noEvalMessage = ''
106+ lib.fileset: Directly evaluating a file set is not supported. Use `lib.fileset.toSource` to turn it into a usable source instead.'';
107+108+ # The empty file set without a base path
109+ _emptyWithoutBase = {
110+ _type = "fileset";
111+112+ _internalVersion = _currentVersion;
113+114+ # The one and only!
115+ _internalIsEmptyWithoutBase = true;
116+117+ # Double __ to make it be evaluated and ordered first
118+ __noEval = throw _noEvalMessage;
119+ };
120+121 # Create a fileset, see ./README.md#fileset
122 # Type: path -> filesetTree -> fileset
123 _create = base: tree:
···130 _type = "fileset";
131132 _internalVersion = _currentVersion;
133+134+ _internalIsEmptyWithoutBase = false;
135 _internalBase = base;
136 _internalBaseRoot = parts.root;
137 _internalBaseComponents = components parts.subpath;
138 _internalTree = tree;
139140 # Double __ to make it be evaluated and ordered first
141+ __noEval = throw _noEvalMessage;
0142 };
143144 # Coerce a value to a fileset, erroring when the value cannot be coerced.
···183 _coerce "${functionContext}: ${context}" value
184 ) list;
185186+ # Find the first value with a base, there may be none!
187+ firstWithBase = findFirst (fileset: ! fileset._internalIsEmptyWithoutBase) null filesets;
188+ # This value is only accessed if first != null
189+ firstBaseRoot = firstWithBase._internalBaseRoot;
190191 # Finds the first element with a filesystem root different than the first element, if any
192 differentIndex = findFirstIndex (fileset:
193+ # The empty value without a base doesn't have a base path
194+ ! fileset._internalIsEmptyWithoutBase
195+ && firstBaseRoot != fileset._internalBaseRoot
196 ) null filesets;
197 in
198+ # Only evaluates `differentIndex` if there are any elements with a base
199+ if firstWithBase != null && differentIndex != null then
200 throw ''
201 ${functionContext}: Filesystem roots are not the same:
202 ${(head list).context}: root "${toString firstBaseRoot}"
···345 # Special case because the code below assumes that the _internalBase is always included in the result
346 # which shouldn't be done when we have no files at all in the base
347 # This also forces the tree before returning the filter, leads to earlier error messages
348+ if fileset._internalIsEmptyWithoutBase || tree == null then
349 empty
350 else
351 nonEmpty;
···355 # Type: [ Fileset ] -> Fileset
356 _unionMany = filesets:
357 let
358+ # All filesets that have a base, aka not the ones that are the empty value without a base
359+ filesetsWithBase = filter (fileset: ! fileset._internalIsEmptyWithoutBase) filesets;
360+361+ # The first fileset that has a base.
362+ # This value is only accessed if there are at all.
363+ firstWithBase = head filesetsWithBase;
364365 # To be able to union filesetTree's together, they need to have the same base path.
366 # Base paths can be unioned by taking their common prefix,
···371 # so this cannot cause a stack overflow due to a build-up of unevaluated thunks.
372 commonBaseComponents = foldl'
373 (components: el: commonPrefix components el._internalBaseComponents)
374+ firstWithBase._internalBaseComponents
375 # We could also not do the `tail` here to avoid a list allocation,
376 # but then we'd have to pay for a potentially expensive
377 # but unnecessary `commonPrefix` call
378+ (tail filesetsWithBase);
379380 # The common base path assembled from a filesystem root and the common components
381+ commonBase = append firstWithBase._internalBaseRoot (join commonBaseComponents);
382383 # A list of filesetTree's that all have the same base path
384 # This is achieved by nesting the trees into the components they have over the common base path
···390 setAttrByPath
391 (drop (length commonBaseComponents) fileset._internalBaseComponents)
392 fileset._internalTree
393+ ) filesetsWithBase;
394395 # Folds all trees together into a single one using _unionTree
396 # We do not use a fold here because it would cause a thunk build-up
397 # which could cause a stack overflow for a large number of trees
398 resultTree = _unionTrees trees;
399 in
400+ # If there's no values with a base, we have no files
401+ if filesetsWithBase == [ ] then
402+ _emptyWithoutBase
403+ else
404+ _create commonBase resultTree;
405406 # The union of multiple filesetTree's with the same base path.
407 # Later elements are only evaluated if necessary.
+40-13
lib/fileset/tests.sh
···282283# File sets cannot be evaluated directly
284expectFailure 'union ./. ./.' 'lib.fileset: Directly evaluating a file set is not supported. Use `lib.fileset.toSource` to turn it into a usable source instead.'
0285286# Past versions of the internal representation are supported
287expectEqual '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 0; _internalBase = ./.; }' \
288- '{ _internalBase = ./.; _internalBaseComponents = path.subpath.components (path.splitRoot ./.).subpath; _internalBaseRoot = /.; _internalVersion = 2; _type = "fileset"; }'
289expectEqual '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 1; }' \
290- '{ _type = "fileset"; _internalVersion = 2; }'
00291292# Future versions of the internal representation are unsupported
293-expectFailure '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 3; }' '<tests>: value is a file set created from a future version of the file set library with a different internal representation:
294-\s*- Internal version of the file set: 3
295-\s*- Internal version of the library: 2
296\s*Make sure to update your Nixpkgs to have a newer version of `lib.fileset`.'
297298# _create followed by _coerce should give the inputs back without any validation
299expectEqual '{
300 inherit (_coerce "<test>" (_create ./. "directory"))
301 _internalVersion _internalBase _internalTree;
302-}' '{ _internalBase = ./.; _internalTree = "directory"; _internalVersion = 2; }'
303304#### Resulting store path ####
305···310tree=(
311)
312checkFileset './.'
000000313314# Directories recursively containing no files are not included
315tree=(
···408409# unions needs a list with at least 1 element
410expectFailure 'toSource { root = ./.; fileset = unions null; }' 'lib.fileset.unions: Expected argument to be a list, but got a null.'
411-expectFailure 'toSource { root = ./.; fileset = unions [ ]; }' 'lib.fileset.unions: Expected argument to be a list with at least one element, but it contains no elements.'
412413# The tree of later arguments should not be evaluated if a former argument already includes all files
414tree=()
415checkFileset 'union ./. (_create ./. (abort "This should not be used!"))'
416checkFileset 'unions [ ./. (_create ./. (abort "This should not be used!")) ]'
417000000000000000000418# union doesn't include files that weren't specified
419tree=(
420 [x]=1
···467 tree[$i/a]=1
468 tree[$i/b]=0
469done
470-(
471- # Locally limit the maximum stack size to 100 * 1024 bytes
472- # If unions was implemented recursively, this would stack overflow
473- ulimit -s 100
474- checkFileset 'unions (mapAttrsToList (name: _: ./. + "/${name}/a") (builtins.readDir ./.))'
475-)
0476477# TODO: Once we have combinators and a property testing library, derive property tests from https://en.wikipedia.org/wiki/Algebra_of_sets
478
···282283# File sets cannot be evaluated directly
284expectFailure 'union ./. ./.' 'lib.fileset: Directly evaluating a file set is not supported. Use `lib.fileset.toSource` to turn it into a usable source instead.'
285+expectFailure '_emptyWithoutBase' 'lib.fileset: Directly evaluating a file set is not supported. Use `lib.fileset.toSource` to turn it into a usable source instead.'
286287# Past versions of the internal representation are supported
288expectEqual '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 0; _internalBase = ./.; }' \
289+ '{ _internalBase = ./.; _internalBaseComponents = path.subpath.components (path.splitRoot ./.).subpath; _internalBaseRoot = /.; _internalIsEmptyWithoutBase = false; _internalVersion = 3; _type = "fileset"; }'
290expectEqual '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 1; }' \
291+ '{ _type = "fileset"; _internalIsEmptyWithoutBase = false; _internalVersion = 3; }'
292+expectEqual '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 2; }' \
293+ '{ _type = "fileset"; _internalIsEmptyWithoutBase = false; _internalVersion = 3; }'
294295# Future versions of the internal representation are unsupported
296+expectFailure '_coerce "<tests>: value" { _type = "fileset"; _internalVersion = 4; }' '<tests>: value is a file set created from a future version of the file set library with a different internal representation:
297+\s*- Internal version of the file set: 4
298+\s*- Internal version of the library: 3
299\s*Make sure to update your Nixpkgs to have a newer version of `lib.fileset`.'
300301# _create followed by _coerce should give the inputs back without any validation
302expectEqual '{
303 inherit (_coerce "<test>" (_create ./. "directory"))
304 _internalVersion _internalBase _internalTree;
305+}' '{ _internalBase = ./.; _internalTree = "directory"; _internalVersion = 3; }'
306307#### Resulting store path ####
308···313tree=(
314)
315checkFileset './.'
316+317+# The empty value without a base should also result in an empty result
318+tree=(
319+ [a]=0
320+)
321+checkFileset '_emptyWithoutBase'
322323# Directories recursively containing no files are not included
324tree=(
···417418# unions needs a list with at least 1 element
419expectFailure 'toSource { root = ./.; fileset = unions null; }' 'lib.fileset.unions: Expected argument to be a list, but got a null.'
0420421# The tree of later arguments should not be evaluated if a former argument already includes all files
422tree=()
423checkFileset 'union ./. (_create ./. (abort "This should not be used!"))'
424checkFileset 'unions [ ./. (_create ./. (abort "This should not be used!")) ]'
425426+# unions doesn't include any files for an empty list or only empty values without a base
427+tree=(
428+ [x]=0
429+ [y/z]=0
430+)
431+checkFileset 'unions [ ]'
432+checkFileset 'unions [ _emptyWithoutBase ]'
433+checkFileset 'unions [ _emptyWithoutBase _emptyWithoutBase ]'
434+checkFileset 'union _emptyWithoutBase _emptyWithoutBase'
435+436+# The empty value without a base is the left and right identity of union
437+tree=(
438+ [x]=1
439+ [y/z]=0
440+)
441+checkFileset 'union ./x _emptyWithoutBase'
442+checkFileset 'union _emptyWithoutBase ./x'
443+444# union doesn't include files that weren't specified
445tree=(
446 [x]=1
···493 tree[$i/a]=1
494 tree[$i/b]=0
495done
496+# This is actually really hard to test:
497+# A lot of files would be needed to cause a stack overflow.
498+# And while we could limit the maximum stack size using `ulimit -s`,
499+# that turns out to not be very deterministic: https://github.com/NixOS/nixpkgs/pull/256417#discussion_r1339396686.
500+# Meanwhile, the test infra here is not the fastest, creating 10000 would be too slow.
501+# So, just using 1000 files for now.
502+checkFileset 'unions (mapAttrsToList (name: _: ./. + "/${name}/a") (builtins.readDir ./.))'
503504# TODO: Once we have combinators and a property testing library, derive property tests from https://en.wikipedia.org/wiki/Algebra_of_sets
505
···2021buildGoModule rec {
22 pname = "gitea";
23- version = "1.20.4";
2425 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
26 src = fetchurl {
27 url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz";
28- hash = "sha256-96LI7/4FZy17KED2xc4UFyW4e47DZMuSnMw7loYYB8c=";
29 };
3031 vendorHash = null;
···2021buildGoModule rec {
22 pname = "gitea";
23+ version = "1.20.5";
2425 # not fetching directly from the git repo, because that lacks several vendor files for the web UI
26 src = fetchurl {
27 url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz";
28+ hash = "sha256-cH/AHsFXOdvfSfj9AZUd3l/RlYE06o1ByZu0vvGQuXw=";
29 };
3031 vendorHash = null;
···1+{ stdenv, fetchFromGitHub, makeWrapper, mono, lib }:
2+3+stdenv.mkDerivation (attrs: {
4+ pname = "Nuget";
5+ version = "6.6.1.2";
6+7+ src = fetchFromGitHub {
8+ owner = "mono";
9+ repo = "linux-packaging-nuget";
10+ rev = "upstream/${attrs.version}.bin";
11+ sha256 = "sha256-9/dSeVshHbpYIgGE/8OzrB4towrWVB3UxDi8Esmbu7Y=";
12+ };
13+14+ nativeBuildInputs = [
15+ makeWrapper
16+ ];
17+18+ installPhase = ''
19+ runHook preInstall
20+21+ mkdir -p $out/lib/${attrs.pname}
22+ cp -r . $out/lib/${attrs.pname}/
23+24+ mkdir -p $out/bin
25+ makeWrapper \
26+ "${mono}/bin/mono" \
27+ "$out/bin/nuget" \
28+ --add-flags "$out/lib/${attrs.pname}/nuget.exe"
29+30+ runHook postInstall
31+ '';
32+33+ meta = with lib; {
34+ description = "A package manager for the .NET platform";
35+ homepage = "https://www.mono-project.com/";
36+ longDescription = ''
37+ NuGet is the package manager for the .NET platform.
38+ This derivation bundles the Mono NuGet CLI, which is mostly used by
39+ older projects based on .NET Framework.
40+41+ Newer .NET projects can use the dotnet CLI, which has most of this
42+ packages functionality built-in.
43+ '';
44+ # https://learn.microsoft.com/en-us/nuget/resources/nuget-faq#what-is-the-license-for-nuget-exe-
45+ license = licenses.mit;
46+ sourceProvenance = [ sourceTypes.binaryBytecode ];
47+ maintainers = [ maintainers.mdarocha ];
48+ platforms = [ "x86_64-linux" ];
49+ };
50+})
+2-2
pkgs/by-name/or/orchard/package.nix
···23buildGoModule rec {
4 pname = "orchard";
5- version = "0.12.0";
67 src = fetchFromGitHub {
8 owner = "cirruslabs";
9 repo = pname;
10 rev = version;
11- hash = "sha256-+QNYlZ3/GiDtCySZPOlrDy03lkdGGvbFCWidQhbZJYQ=";
12 # populate values that require us to use git. By doing this in postFetch we
13 # can delete .git afterwards and maintain better reproducibility of the src.
14 leaveDotGit = true;
···23buildGoModule rec {
4 pname = "orchard";
5+ version = "0.13.1";
67 src = fetchFromGitHub {
8 owner = "cirruslabs";
9 repo = pname;
10 rev = version;
11+ hash = "sha256-b9AHsyMiR3gTXGRbmIUX9uSd7u3dFoUZ/CtKrYpuzno=";
12 # populate values that require us to use git. By doing this in postFetch we
13 # can delete .git afterwards and maintain better reproducibility of the src.
14 leaveDotGit = true;
···33 modBuildPhase = ''
34 for plugin in ${builtins.toString (attrsToPlugins externalPlugins)}; do echo $plugin >> plugin.cfg; done
35 for src in ${builtins.toString (attrsToSources externalPlugins)}; do go get $src; done
36- go generate
37 go mod vendor
38 '';
39···46 chmod -R u+w vendor
47 mv -t . vendor/go.{mod,sum} vendor/plugin.cfg
4849- go generate
50 '';
5152 postPatch = ''
···33 modBuildPhase = ''
34 for plugin in ${builtins.toString (attrsToPlugins externalPlugins)}; do echo $plugin >> plugin.cfg; done
35 for src in ${builtins.toString (attrsToSources externalPlugins)}; do go get $src; done
36+ GOOS= GOARCH= go generate
37 go mod vendor
38 '';
39···46 chmod -R u+w vendor
47 mv -t . vendor/go.{mod,sum} vendor/plugin.cfg
4849+ GOOS= GOARCH= go generate
50 '';
5152 postPatch = ''
···109 asterisk_19 = throw "asterisk_19: Asterisk 19 is end of life and has been removed"; # Added 2023-04-19
110 at_spi2_atk = throw "'at_spi2_atk' has been renamed to/replaced by 'at-spi2-atk'"; # Converted to throw 2022-02-22
111 at_spi2_core = throw "'at_spi2_core' has been renamed to/replaced by 'at-spi2-core'"; # Converted to throw 2022-02-22
0000112 aucdtect = throw "aucdtect: Upstream no longer provides download urls"; # Added 2020-12-26
113 audacity-gtk2 = throw "'audacity-gtk2' has been removed to/replaced by 'audacity'"; # Added 2022-10-09
114 audacity-gtk3 = throw "'audacity-gtk3' has been removed to/replaced by 'audacity'"; # Added 2022-10-09
···109 asterisk_19 = throw "asterisk_19: Asterisk 19 is end of life and has been removed"; # Added 2023-04-19
110 at_spi2_atk = throw "'at_spi2_atk' has been renamed to/replaced by 'at-spi2-atk'"; # Converted to throw 2022-02-22
111 at_spi2_core = throw "'at_spi2_core' has been renamed to/replaced by 'at-spi2-core'"; # Converted to throw 2022-02-22
112+ atom = throw "'atom' has been removed because discontinued and deprecated. Consider using 'pulsar', a maintained fork"; # Added 2023-10-01
113+ atom-beta = throw "'atom-beta' has been removed because discontinued and deprecated. Consider using 'pulsar', a maintained fork"; # Added 2023-10-01
114+ atomEnv = throw "'atomEnv' has been removed because 'atom' is discontinued and deprecated. Consider using 'pulsar', a maintained fork"; # Added 2023-10-01
115+ atomPackages = throw "'atomPackages' has been removed because 'atom' is discontinued and deprecated. Consider using 'pulsar', a maintained fork"; # Added 2023-10-01
116 aucdtect = throw "aucdtect: Upstream no longer provides download urls"; # Added 2020-12-26
117 audacity-gtk2 = throw "'audacity-gtk2' has been removed to/replaced by 'audacity'"; # Added 2022-10-09
118 audacity-gtk3 = throw "'audacity-gtk3' has been removed to/replaced by 'audacity'"; # Added 2022-10-09