Skip to content
Open
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
12 changes: 11 additions & 1 deletion .github/workflows/ci_zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,16 @@ jobs:
git clean -fdx
git reset --hard HEAD
nix develop ./src/ -c zig build && zig build snapshot && zig build test

- name: Test Nix package
if: ${{ runner.os == 'Linux' || (runner.os == 'macOS' && runner.arch != 'X64') }}
uses: ./.github/actions/flaky-retry
with:
command: |
nix build ./src#roc
result/bin/roc check src/PROFILING/bench_repeated_check.roc
error_string_contains: TemporaryNameServerFailure
retry_count: 3

zig-cross-compile:
needs: check-once
Expand Down Expand Up @@ -282,4 +292,4 @@ jobs:

# Test cross-compilation with Roc's cross-compilation system (musl + glibc)
roc-cross-compile:
uses: ./.github/workflows/ci_cross_compile.yml
uses: ./.github/workflows/ci_cross_compile.yml
22 changes: 11 additions & 11 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@
.minimum_zig_version = "0.15.2",
.dependencies = .{
.afl_kit = .{
.url = "git+https://github.com/bhansconnect/zig-afl-kit?ref=main#b863c41ca47ed05729e0b509fb1926c111aa2800",
.hash = "afl_kit-0.1.0-NdJ3cncdAAA4154gtkRqNApovBYfOs-LWADNE-9BzzPC",
.url = "git+https://github.com/kristoff-it/zig-afl-kit.git#b6cb826f21d4026409caec30a932be462bca27b9",
.hash = "afl_kit-0.1.0-NdJ3cncdAADtO8S74G1yMYKO1f2XoHputmaJBInsHLp2",
.lazy = true,
},
.roc_deps_aarch64_macos_none = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-macos-none.tar.xz?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-macos-none.tar.xz",
.hash = "N-V-__8AAJuttw4mNdQg3ig107ac4uyAhcFPznGHmpnmX58C",
.lazy = true,
},
.roc_deps_aarch64_linux_musl = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-linux-musl.tar.xz?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-linux-musl.tar.xz",
.hash = "N-V-__8AABnBVRNhZGWHvWKm8PO-N4Js4Zr65NnswmkZ0nYX",
.lazy = true,
},
.roc_deps_aarch64_windows_gnu = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-windows-gnu.zip?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-windows-gnu.zip",
.hash = "N-V-__8AAEbXoBTC007kkcMVW2_P5yIKMxPKQ-L5sYEc3_qH",
.lazy = true,
},
.roc_deps_arm_linux_musleabihf = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/arm-linux-musleabihf.tar.xz?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/arm-linux-musleabihf.tar.xz",
.hash = "N-V-__8AAE9SyhMGHGnkgRenWYw-birLp2Nl-IYGqIbdlga3",
.lazy = true,
},
.roc_deps_x86_linux_musl = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86-linux-musl.tar.xz?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86-linux-musl.tar.xz",
.hash = "N-V-__8AAGXNmxEQQYT5QBEheV2NJzSQjwaBuUx8wj_tGdoy",
.lazy = true,
},
.roc_deps_x86_64_linux_musl = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-linux-musl.tar.xz?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-linux-musl.tar.xz",
.hash = "N-V-__8AAL1yjxS0Lef6Fv5mMGaqNa0rGcPJxOftYK0NYuJu",
.lazy = true,
},
.roc_deps_x86_64_macos_none = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-macos-none.tar.xz?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-macos-none.tar.xz",
.hash = "N-V-__8AAInnSA9gFeMzlB67m7Nu-NYBUOXqDrzYmYgatUHk",
.lazy = true,
},
.roc_deps_x86_64_windows_gnu = .{
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-windows-gnu.zip?response-content-disposition=attachment",
.url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-windows-gnu.zip",
.hash = "N-V-__8AANpEpBfszYPGDvz9XJK8VRBNG7eQzzK1iNSlkdVG",
.lazy = true,
},
Expand All @@ -54,7 +54,7 @@
},
.zstd = .{
.url = "git+https://github.com/allyourcodebase/zstd.git#01327d49cbc56dc24c20a167bb0055d7fc23de84", // 1.5.7
.hash = "1220b9feb4652a62df95843e78a5db008401599366989b52d7cab421bf6263fa73d0",
.hash = "zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0",
},
},
.fingerprint = 0x9eea22a6c3bd0034,
Expand Down
217 changes: 217 additions & 0 deletions build.zig.zon.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# generated by zon2nix (https://github.com/Cloudef/zig2nix)

{
lib,
linkFarm,
fetchurl,
fetchgit,
runCommandLocal,
zig,
name ? "zig-packages",
}:

with builtins;
with lib;

let
unpackZigArtifact =
{ name, artifact }:
runCommandLocal name { nativeBuildInputs = [ zig ]; } ''
hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
mv "$TMPDIR/p/$hash" "$out"
chmod 755 "$out"
'';

fetchZig =
{
name,
url,
hash,
}:
let
artifact = fetchurl { inherit url hash; };
in
unpackZigArtifact { inherit name artifact; };

fetchGitZig =
{
name,
url,
hash,
rev ? throw "rev is required, remove and regenerate the zon2json-lock file",
}:
let
parts = splitString "#" url;
url_base = elemAt parts 0;
url_without_query = elemAt (splitString "?" url_base) 0;
in
fetchgit {
inherit name rev hash;
url = url_without_query;
deepClone = false;
};

fetchZigArtifact =
{
name,
url,
hash,
...
}@args:
let
parts = splitString "://" url;
proto = elemAt parts 0;
path = elemAt parts 1;
fetcher = {
"git+http" = fetchGitZig (
args
// {
url = "http://${path}";
}
);
"git+https" = fetchGitZig (
args
// {
url = "https://${path}";
}
);
http = fetchZig {
inherit name hash;
url = "http://${path}";
};
https = fetchZig {
inherit name hash;
url = "https://${path}";
};
};
in
fetcher.${proto};
in
linkFarm name [
{
name = "afl_kit-0.1.0-NdJ3cncdAADtO8S74G1yMYKO1f2XoHputmaJBInsHLp2";
path = fetchZigArtifact {
name = "afl_kit";
url = "git+https://github.com/kristoff-it/zig-afl-kit.git#b6cb826f21d4026409caec30a932be462bca27b9";
hash = "sha256-b3aBfO1aiM9MV6Pqdy0A8xbRy/X9zEJCztXMe18k2rA=";
rev = "b6cb826f21d4026409caec30a932be462bca27b9";
};
}
{
name = "AFLplusplus-4.21.0-aA1y4dZxAAAhqDy_JoRw3zwNSg8MenEGP7uJI_xNcYuV";
path = fetchZigArtifact {
name = "AFLplusplus";
url = "git+https://github.com/allyourcodebase/AFLplusplus#7e65eb4262688a120bf830d145060aac0e5db920";
hash = "sha256-f5Egmkg2tEOV5jfcNj9KTU0IWOAC/hGdypmC+IG88Q0=";
rev = "7e65eb4262688a120bf830d145060aac0e5db920";
};
}
{
name = "N-V-__8AAKE4uAAJZgEcPdaXnWqoj-IwYf3G2h9YSm-x92gg";
path = fetchZigArtifact {
name = "AFLplusplus";
url = "https://github.com/AFLplusplus/AFLplusplus/archive/v4.21c.tar.gz";
hash = "sha256-EffHfTfP9uf2WsfMVbq3kB4MYgjoRaOHZDlNBO1WezA=";
};
}
{
name = "N-V-__8AAJuttw4mNdQg3ig107ac4uyAhcFPznGHmpnmX58C";
path = fetchZigArtifact {
name = "roc_deps_aarch64_macos_none";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-macos-none.tar.xz";
hash = "sha256-V5vrynGlea56TSLjNpkVpQFJID+d/U/yMaflwNSQaQU=";
};
}
{
name = "N-V-__8AABnBVRNhZGWHvWKm8PO-N4Js4Zr65NnswmkZ0nYX";
path = fetchZigArtifact {
name = "roc_deps_aarch64_linux_musl";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-linux-musl.tar.xz";
hash = "sha256-CXGVG1A7V/xhpu1Kgv6RtF7EH0xKXlVXWVLOfx8DptA=";
};
}
{
name = "N-V-__8AAEbXoBTC007kkcMVW2_P5yIKMxPKQ-L5sYEc3_qH";
path = fetchZigArtifact {
name = "roc_deps_aarch64_windows_gnu";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-windows-gnu.zip";
hash = "sha256-LbVIeMh8gguUczU7nDqOhmkPlSXIYU5kH6EhcssjpWY=";
};
}
{
name = "N-V-__8AAE9SyhMGHGnkgRenWYw-birLp2Nl-IYGqIbdlga3";
path = fetchZigArtifact {
name = "roc_deps_arm_linux_musleabihf";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/arm-linux-musleabihf.tar.xz";
hash = "sha256-0fw/KOpzj7OSgFrysfRGv4WlU/JvaaC3xXu6V+LyEs8=";
};
}
{
name = "N-V-__8AAGXNmxEQQYT5QBEheV2NJzSQjwaBuUx8wj_tGdoy";
path = fetchZigArtifact {
name = "roc_deps_x86_linux_musl";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86-linux-musl.tar.xz";
hash = "sha256-LyYtnADq9CmmzRH+qu3WPRHPj2LjY3zszlyCB+CiRAo=";
};
}
{
name = "N-V-__8AAL1yjxS0Lef6Fv5mMGaqNa0rGcPJxOftYK0NYuJu";
path = fetchZigArtifact {
name = "roc_deps_x86_64_linux_musl";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-linux-musl.tar.xz";
hash = "sha256-zmrzXp9790M4NfjFuBU+TZ7jWjJdN+Z1vRs9aKwkmJM=";
};
}
{
name = "N-V-__8AAInnSA9gFeMzlB67m7Nu-NYBUOXqDrzYmYgatUHk";
path = fetchZigArtifact {
name = "roc_deps_x86_64_macos_none";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-macos-none.tar.xz";
hash = "sha256-w3vpIPXWlmIRztbXPGXiemrwYF9jjFIaFxpZaLOZ9KI=";
};
}
{
name = "N-V-__8AANpEpBfszYPGDvz9XJK8VRBNG7eQzzK1iNSlkdVG";
path = fetchZigArtifact {
name = "roc_deps_x86_64_windows_gnu";
url = "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-windows-gnu.zip";
hash = "sha256-tckuUDxjoeAUWC5RiHW1IVKG3H67R1D0cONk93VbkLs=";
};
}
{
name = "bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi";
path = fetchZigArtifact {
name = "bytebox";
url = "git+https://github.com/rdunnington/bytebox#5c8753ba11c394e4d642dddbb459edcd7c97ac26";
hash = "sha256-UMXzrH5OPqQmt5B2hlMkKzSa1gjI2EreDRK9Son+ZvM=";
rev = "5c8753ba11c394e4d642dddbb459edcd7c97ac26";
};
}
{
name = "stable_array-0.1.0-3ihgvVxbAACET5MoiUn2T5ENunG_da_X3kGbji-f4QTF";
path = fetchZigArtifact {
name = "zig-stable-array";
url = "git+https://github.com/rdunnington/zig-stable-array#9e4f089bd3abf127eafd307ecf9796455871becc";
hash = "sha256-NpxyNyOoFAeyREn3SvEnI/tyaYgM1ZjlcK+0jG2N0Lk=";
rev = "9e4f089bd3abf127eafd307ecf9796455871becc";
};
}
{
name = "zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0";
path = fetchZigArtifact {
name = "zstd";
url = "git+https://github.com/allyourcodebase/zstd.git#01327d49cbc56dc24c20a167bb0055d7fc23de84";
hash = "sha256-1w+hR2U9t6R4sNvUMynDsYO0sNAan2svjxjUvxT+x6A=";
rev = "01327d49cbc56dc24c20a167bb0055d7fc23de84";
};
}
{
name = "N-V-__8AAGxifwAAGwXwvsnl_aOXFGLZTeYCu0WBhuEXr96u";
path = fetchZigArtifact {
name = "zstd";
url = "git+https://github.com/facebook/zstd.git?ref=v1.5.7#f8745da6ff1ad1e7bab384bd1f9d742439278e99";
hash = "sha256-tNFWIT9ydfozB8dWcmTMuZLCQmQudTFJIkSr0aG7S44=";
rev = "f8745da6ff1ad1e7bab384bd1f9d742439278e99";
};
}
]
83 changes: 83 additions & 0 deletions build.zig.zon2json-lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"afl_kit-0.1.0-NdJ3cncdAADtO8S74G1yMYKO1f2XoHputmaJBInsHLp2": {
"name": "afl_kit",
"url": "git+https://github.com/kristoff-it/zig-afl-kit.git#b6cb826f21d4026409caec30a932be462bca27b9",
"hash": "sha256-b3aBfO1aiM9MV6Pqdy0A8xbRy/X9zEJCztXMe18k2rA=",
"rev": "b6cb826f21d4026409caec30a932be462bca27b9"
},
"AFLplusplus-4.21.0-aA1y4dZxAAAhqDy_JoRw3zwNSg8MenEGP7uJI_xNcYuV": {
"name": "AFLplusplus",
"url": "git+https://github.com/allyourcodebase/AFLplusplus#7e65eb4262688a120bf830d145060aac0e5db920",
"hash": "sha256-f5Egmkg2tEOV5jfcNj9KTU0IWOAC/hGdypmC+IG88Q0=",
"rev": "7e65eb4262688a120bf830d145060aac0e5db920"
},
"N-V-__8AAKE4uAAJZgEcPdaXnWqoj-IwYf3G2h9YSm-x92gg": {
"name": "AFLplusplus",
"url": "https://github.com/AFLplusplus/AFLplusplus/archive/v4.21c.tar.gz",
"hash": "sha256-EffHfTfP9uf2WsfMVbq3kB4MYgjoRaOHZDlNBO1WezA="
},
"N-V-__8AAJuttw4mNdQg3ig107ac4uyAhcFPznGHmpnmX58C": {
"name": "roc_deps_aarch64_macos_none",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-macos-none.tar.xz",
"hash": "sha256-V5vrynGlea56TSLjNpkVpQFJID+d/U/yMaflwNSQaQU="
},
"N-V-__8AABnBVRNhZGWHvWKm8PO-N4Js4Zr65NnswmkZ0nYX": {
"name": "roc_deps_aarch64_linux_musl",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-linux-musl.tar.xz",
"hash": "sha256-CXGVG1A7V/xhpu1Kgv6RtF7EH0xKXlVXWVLOfx8DptA="
},
"N-V-__8AAEbXoBTC007kkcMVW2_P5yIKMxPKQ-L5sYEc3_qH": {
"name": "roc_deps_aarch64_windows_gnu",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/aarch64-windows-gnu.zip",
"hash": "sha256-LbVIeMh8gguUczU7nDqOhmkPlSXIYU5kH6EhcssjpWY="
},
"N-V-__8AAE9SyhMGHGnkgRenWYw-birLp2Nl-IYGqIbdlga3": {
"name": "roc_deps_arm_linux_musleabihf",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/arm-linux-musleabihf.tar.xz",
"hash": "sha256-0fw/KOpzj7OSgFrysfRGv4WlU/JvaaC3xXu6V+LyEs8="
},
"N-V-__8AAGXNmxEQQYT5QBEheV2NJzSQjwaBuUx8wj_tGdoy": {
"name": "roc_deps_x86_linux_musl",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86-linux-musl.tar.xz",
"hash": "sha256-LyYtnADq9CmmzRH+qu3WPRHPj2LjY3zszlyCB+CiRAo="
},
"N-V-__8AAL1yjxS0Lef6Fv5mMGaqNa0rGcPJxOftYK0NYuJu": {
"name": "roc_deps_x86_64_linux_musl",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-linux-musl.tar.xz",
"hash": "sha256-zmrzXp9790M4NfjFuBU+TZ7jWjJdN+Z1vRs9aKwkmJM="
},
"N-V-__8AAInnSA9gFeMzlB67m7Nu-NYBUOXqDrzYmYgatUHk": {
"name": "roc_deps_x86_64_macos_none",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-macos-none.tar.xz",
"hash": "sha256-w3vpIPXWlmIRztbXPGXiemrwYF9jjFIaFxpZaLOZ9KI="
},
"N-V-__8AANpEpBfszYPGDvz9XJK8VRBNG7eQzzK1iNSlkdVG": {
"name": "roc_deps_x86_64_windows_gnu",
"url": "https://github.com/roc-lang/roc-bootstrap/releases/download/zig-0.15.1/x86_64-windows-gnu.zip",
"hash": "sha256-tckuUDxjoeAUWC5RiHW1IVKG3H67R1D0cONk93VbkLs="
},
"bytebox-0.0.1-SXc2seA2DwAUHbrqTMz_mAQQGqO0EVPYmZ89YZn4KsTi": {
"name": "bytebox",
"url": "git+https://github.com/rdunnington/bytebox#5c8753ba11c394e4d642dddbb459edcd7c97ac26",
"hash": "sha256-UMXzrH5OPqQmt5B2hlMkKzSa1gjI2EreDRK9Son+ZvM=",
"rev": "5c8753ba11c394e4d642dddbb459edcd7c97ac26"
},
"stable_array-0.1.0-3ihgvVxbAACET5MoiUn2T5ENunG_da_X3kGbji-f4QTF": {
"name": "zig-stable-array",
"url": "git+https://github.com/rdunnington/zig-stable-array#9e4f089bd3abf127eafd307ecf9796455871becc",
"hash": "sha256-NpxyNyOoFAeyREn3SvEnI/tyaYgM1ZjlcK+0jG2N0Lk=",
"rev": "9e4f089bd3abf127eafd307ecf9796455871becc"
},
"zstd-1.5.7-KEItkJ8vAAC5_rRlKmLflYQ-eKXbAIQBWZNmmJtS18q0": {
"name": "zstd",
"url": "git+https://github.com/allyourcodebase/zstd.git#01327d49cbc56dc24c20a167bb0055d7fc23de84",
"hash": "sha256-1w+hR2U9t6R4sNvUMynDsYO0sNAan2svjxjUvxT+x6A=",
"rev": "01327d49cbc56dc24c20a167bb0055d7fc23de84"
},
"N-V-__8AAGxifwAAGwXwvsnl_aOXFGLZTeYCu0WBhuEXr96u": {
"name": "zstd",
"url": "git+https://github.com/facebook/zstd.git?ref=v1.5.7#f8745da6ff1ad1e7bab384bd1f9d742439278e99",
"hash": "sha256-tNFWIT9ydfozB8dWcmTMuZLCQmQudTFJIkSr0aG7S44=",
"rev": "f8745da6ff1ad1e7bab384bd1f9d742439278e99"
}
}
Loading
Loading