Skip to content

Commit

Permalink
fix: fetchgitpatch on darwin
Browse files Browse the repository at this point in the history
Builds effected by this bug might have seen messages like: `couldn't
open temporary file /nix/store/sedoypWC9: Operation not permitted`
  • Loading branch information
nicknovitski committed Feb 26, 2025
1 parent 5081883 commit 77cd680
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Build packages on darwin"
on:
pull_request:
push:
branches:
- 'master'
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v30
- run: nix build -L .#nix2container-bin .#skopeo-nix2container
7 changes: 5 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ let
# These lines may include revisions of differing length, based on how Github generates them.
# fetchpatch2 does not filter out, but probably should
fetchgitpatch = args: pkgs.fetchpatch2 (args // {
# On darwin, using sed with --in-place here fails as it tries to create
# temporary files at `/nix/store/<tempfilename>`.
postFetch = (args.postFetch or "") + ''
sed -i \
sed \
-e '/^index /d' \
-e '/^similarity index /d' \
-e '/^dissimilarity index /d' \
$out
$out > $tmpfile
mv $tmpfile $out
'';
});
patch = fetchgitpatch {
Expand Down

0 comments on commit 77cd680

Please sign in to comment.