gitea: fix passthru.data-compressed#335670
Merged
philiptaron merged 1 commit intoNixOS:masterfrom Aug 19, 2024
Merged
Conversation
13 tasks
Fixes two bugs:
- pass a forgotten `{}` to `compressDrv`.
- remove incorrect usage of `lndir` in `compressDrv`. I added a brief
comment on why, see [this comment][1] for more details.
Tested with:
```
$ nix build .#legacyPackages.x86_64-linux.gitea.passthru.data-compressed
$ ls -lh result/public/assets/licenses.txt*
lrwxrwxrwx 1 root root 90 Jan 1 1970 result/public/assets/licenses.txt -> /nix/store/p21irsr57hckd3x3ym18aa0cr9zmm3an-gitea-1.22.1-data/./public/assets/licenses.txt
-r--r--r-- 1 root root 30K Jan 1 1970 result/public/assets/licenses.txt.br
-r--r--r-- 1 root root 82K Jan 1 1970 result/public/assets/licenses.txt.gz
```
[1]: NixOS#332752 (comment)
e3918fc to
1bd3504
Compare
philiptaron
approved these changes
Aug 19, 2024
Comment on lines
+72
to
+75
| # cannot use lndir here, because it also symlinks directories, | ||
| # which we do not need; we only need to symlink files. | ||
| (cd ${drv}; find -L -type d -exec mkdir -p $out/{} ';') | ||
| (cd ${drv}; find -L -type f -exec ln -s ${drv}/{} $out/{} ';') |
Contributor
There was a problem hiding this comment.
I also just find this so much easier to reason about than lndir. I'm glad to see the return.
Member
There was a problem hiding this comment.
It is just how lndir functions, that it doesn't recurse into other symlinks. Probably mainly to avoid symlink loops?
| mkdir $out | ||
| (cd $out; ${xorg.lndir}/bin/lndir ${drv}) | ||
|
|
||
| # cannot use lndir here, because it also symlinks directories, |
Member
There was a problem hiding this comment.
That comment is wrong. lndir never symlinks directories directly. Only if they are a symlink and then the input file is technically not a directory but a symlink to a directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two bugs:
{}tocompressDrv.lndirincompressDrv. I added a brief comment on why, see this comment for more details.Tested with:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)