9 Commits

Author SHA1 Message Date
Jörg Thalheim 3dc8ff155b build-support: fix nix-prefetch-* on macOS (#358685) 2024-12-13 14:23:56 +01:00
nicoo 5720f42c32 nix-prefetch-docker: provide hash in SRI format 2024-12-09 14:28:25 +01:00
Jonathan del Strother 6cb8c5ec01 build-support: Simplify tmpdir creation with coreutils
macOS 10.12 doesn't have a usable --tmpdir flag on the builtin mktemp, but we can
make use of coreutil's mktemp instead.
2024-11-25 09:41:02 +00:00
Jonathan del Strother 0c3d16a7d5 build-support: fix nix-prefetch-* on macOS
Since nix 2.20, `nix-store --add-fixed` doesn't accept paths where the
parent directory is a symlink. On macOS, /tmp is a symlink to
/private/tmp, which causes a "'/tmp' is a symlink" error:

```
$ nix run github:nixos/nixpkgs/24.11-beta#nix-prefetch-git -- --url https://github.com/IFTTT/polo.git --rev 316aa2ac210a45a7fc400ab921831493d5dd21b8 --hash sha256
Initialized empty Git repository in /private/tmp/git-checkout-tmp-1Bf9bIv7/polo-316aa2a/.git/
remote: Enumerating objects: 51, done.
remote: Counting objects: 100% (51/51), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 51 (delta 8), reused 19 (delta 5), pack-reused 0 (from 0)
Unpacking objects: 100% (51/51), 19.57 KiB | 541.00 KiB/s, done.
From https://github.com/IFTTT/polo
 * branch            HEAD       -> FETCH_HEAD
Switched to a new branch 'fetchgit'
removing `.git'...
error: path '/tmp' is a symlink
```

Avoid this by resolving /tmp to a real directory in all the prefetch scripts
2024-11-25 09:32:14 +00:00
Robin Bate Boerop 824c9ac5c9 nix-prefetch-docker: handle overrides correctly
Without this change, the `--os` and `--arch` switches are disregarded
for operations involving `skopeo inspect` invocations. This means that,
for example, one cannot fetch Linux images while on macOS.
2023-04-03 21:12:13 +03:00
edef de88771a7d nix-prefetch-docker: output informational messages to stderr
Informational messages belong on stderr, not on stdout and intermixed
with structured output for programmatic use.

Change-Id: I34d094d04460494e9ec8953db7490f4e2292d959
2020-12-01 16:58:29 +00:00
zowoq 365d07cea0 dockerTools: fix skopeo commands 2020-05-25 14:29:54 +10:00
zowoq 42232493a3 dockerTools: pass insecure-policy and tmpdir to skopeo 2020-05-16 08:46:13 +10:00
Jaka Hudoklin c1f0d19785 dockerTools: add nix-prefetch-docker script 2019-04-06 14:16:40 +02:00