Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(back): #1128 avoid hitting max arg limit #1129

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions makes/cli/env/runtime/main.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
makeSearchPaths {
bin = [
__nixpkgs__.cachix
__nixpkgs__.findutils
__nixpkgs__.git
__nixpkgs__.gnutar
__nixpkgs__.gzip
Expand Down
10 changes: 5 additions & 5 deletions src/cli/main/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,14 @@ def _nix_build(
]


def _nix_hashes(*paths: str) -> List[str]:
def _nix_hashes(paths: bytes) -> List[str]:
cmd = [
"xargs",
f"{__NIX_STABLE__}/bin/nix-store",
"--query",
"--hash",
*paths,
]
out, stdout, _ = _run_outputs(cmd, stderr=None)
out, stdout, _ = _run_outputs(cmd, stdin=paths, stderr=None)
if out != 0:
raise SystemExit(out)

Expand All @@ -360,7 +360,7 @@ def _nix_build_requisites(path: str) -> List[Tuple[str, str]]:

requisites: List[str] = stdout.decode().splitlines()

hashes: List[str] = _nix_hashes(*requisites)
hashes: List[str] = _nix_hashes(stdout)

return list(zip(requisites, hashes))

Expand Down Expand Up @@ -769,7 +769,7 @@ def write_provenance(
attestation["subject"] = [
{
"uri": realpath(out),
"hash": dict([_nix_hashes(out)[0].split(":")]),
"hash": dict([_nix_hashes(out.encode())[0].split(":")]),
}
]

Expand Down
Loading