Skip to content

Commit 20d0440

Browse files
authored
Support bpf-linker (#1950)
1 parent 05a01b6 commit 20d0440

6 files changed

Lines changed: 98 additions & 7 deletions

File tree

.github/.cspell/project-dictionary.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ cyclonedx
1010
cygdrive
1111
deadlinks
1212
deepsource
13-
docgarden
1413
doas
14+
docgarden
1515
enablerepo
1616
epel
1717
espup
@@ -40,6 +40,7 @@ SHASUMS
4040
sigstore
4141
syft
4242
tombi
43+
tzst
4344
udeps
4445
USERPROFILE
4546
wasmtime

TOOLS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ See the [Supported tools section in README.md](README.md#supported-tools) for ho
1616
| ---- | -------------------------------- | ------------------------------- | ------------------ | ------- | ---- |
1717
| [**auto-doc**](https://github.com/tj-actions/auto-doc) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/tj-actions/auto-doc/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/tj-actions/auto-doc/blob/main/LICENSE) | |
1818
| [**biome**](https://biomejs.dev) | `$HOME/.install-action/bin` | [GitHub Releases](https://github.com/biomejs/biome/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/biomejs/biome/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/biomejs/biome/blob/main/LICENSE-MIT) | |
19+
| [**bpf-linker**](https://github.com/aya-rs/bpf-linker) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/aya-rs/bpf-linker/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/aya-rs/bpf-linker/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/aya-rs/bpf-linker/blob/main/LICENSE-MIT) | |
1920
| [**cargo-about**](https://github.com/EmbarkStudios/cargo-about) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/EmbarkStudios/cargo-about/releases) | Linux, macOS, Windows | [MIT](https://github.com/EmbarkStudios/cargo-about/blob/main/LICENSE-MIT) OR [Apache-2.0](https://github.com/EmbarkStudios/cargo-about/blob/main/LICENSE-APACHE) | |
2021
| [**cargo-apple-runner**](https://github.com/madsmtm/cargo-apple-runner) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/madsmtm/cargo-apple-runner/releases) | macOS | [Zlib](https://github.com/madsmtm/cargo-apple-runner/blob/main/LICENSE-ZLIB.txt) OR [Apache-2.0](https://github.com/madsmtm/cargo-apple-runner/blob/main/LICENSE-APACHE.txt) OR [MIT](https://github.com/madsmtm/cargo-apple-runner/blob/main/LICENSE-MIT.txt) | |
2122
| [**cargo-audit**](https://github.com/rustsec/rustsec/tree/HEAD/cargo-audit) | `$CARGO_HOME/bin` | [GitHub Releases](https://github.com/rustsec/rustsec/releases) | Linux, macOS, Windows | [Apache-2.0](https://github.com/rustsec/rustsec/blob/main/cargo-audit/LICENSE-APACHE) OR [MIT](https://github.com/rustsec/rustsec/blob/main/cargo-audit/LICENSE-MIT) | |

main.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ download_and_extract() {
158158
esac
159159
fi
160160
;;
161+
*.tar.zst | *.tzst)
162+
tar_args+=('xf')
163+
if ! type -P zstd >/dev/null; then
164+
case "${base_distro}" in
165+
debian | fedora | suse | arch | alpine)
166+
printf '::group::Install packages required for installation (zstd)\n'
167+
sys_install zstd
168+
printf '::endgroup::\n'
169+
;;
170+
esac
171+
fi
172+
;;
161173
*.zip)
162174
if ! type -P unzip >/dev/null; then
163175
case "${base_distro}" in
@@ -187,8 +199,10 @@ download_and_extract() {
187199
cd -- "${tmp_dir}"
188200
download_and_checksum "${url}" "${checksum}"
189201
if [[ ${#tar_args[@]} -gt 0 ]]; then
190-
tar_args+=("tmp")
191-
tar "${tar_args[@]}"
202+
case "${url}" in
203+
*.tar.zst | *.tzst) zstd -dc tmp | tar "${tar_args[@]}" - ;;
204+
*) tar "${tar_args[@]}" tmp ;;
205+
esac
192206
for tmp in "${bin_in_archive[@]}"; do
193207
case "${tool}" in
194208
editorconfig-checker) mv -- "${tmp}" "${bin_dir}/${tool}${exe}" ;;

manifests/bpf-linker.json

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/ci/tool-list.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ case "$(uname -s)" in
119119
if ! type -P snap >/dev/null; then
120120
incompat_tools+=(valgrind)
121121
fi
122-
if ! type -P apt-get >/dev/null; then
123-
incompat_tools+=(cyclonedx)
124-
fi
125-
if [[ "${runner}" == 'ubuntu:14.04' ]]; then
122+
if ! type -P apt-get >/dev/null || [[ "${runner}" == 'ubuntu:14.04' ]]; then
126123
incompat_tools+=(cyclonedx)
127124
fi
128125
if [[ "${runner}" == 'almalinux:10'* ]]; then
129126
incompat_tools+=(cargo-deb) # no dpkg in package manager
130127
fi
128+
case "${runner}" in
129+
debian/eol:jessie-slim | ubuntu:14.04 | alpine:3.2) incompat_tools+=(bpf-linker) ;; # no zstd in package manager
130+
esac
131131
;;
132132
Darwin)
133133
host_os=macos

tools/codegen/base/bpf-linker.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"repository": "https://github.com/aya-rs/bpf-linker",
3+
"license_markdown": "[Apache-2.0](https://github.com/aya-rs/bpf-linker/blob/main/LICENSE-APACHE) OR [MIT](https://github.com/aya-rs/bpf-linker/blob/main/LICENSE-MIT)",
4+
"tag_prefix": "v",
5+
"version_range": ">= 0.10.4",
6+
"rust_crate": "${package}",
7+
"asset_name": "${package}-${rust_target}.tar.zst",
8+
"platform": {
9+
"x86_64_linux_musl": {},
10+
"x86_64_macos": {},
11+
"x86_64_windows": {
12+
"asset_name": "${package}-${rust_target_arch}-pc-windows-gnullvm.tar.zst"
13+
},
14+
"aarch64_linux_musl": {},
15+
"aarch64_macos": {},
16+
"aarch64_windows": {
17+
"asset_name": "${package}-${rust_target_arch}-pc-windows-gnullvm.tar.zst"
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)