1.0.0: add build infra and release

This commit is contained in:
🪞👃🪞 2025-04-27 21:18:36 +03:00
parent bba8d39872
commit e76133a10f
12 changed files with 104 additions and 3 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
*

14
.gitignore vendored
View file

@ -1 +1,13 @@
target target/*
!target/.gitkeep
perf.data*
flamegraph*.svg
vgcore*
example.mid
cov
*/cov
*.profraw
build/*
!build/README.md
!build/*.sh
!build/Dockerfile.*

2
Cargo.lock generated
View file

@ -910,7 +910,7 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]] [[package]]
name = "perch" name = "perch"
version = "0.1.0" version = "1.0.0"
dependencies = [ dependencies = [
"byte-unit", "byte-unit",
"clap", "clap",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "perch" name = "perch"
version = "0.1.0" version = "1.0.0"
edition = "2024" edition = "2024"
[dependencies.tengri] [dependencies.tengri]

14
build/Dockerfile.glibc Normal file
View file

@ -0,0 +1,14 @@
FROM docker.io/library/debian:bookworm
RUN apt update \
&& apt install -y build-essential bash tree git wget \
pkg-config libjack-dev liblilv-dev libserd-dev libsord-dev
RUN adduser --quiet --uid 1000 --disabled-password build
RUN wget https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init \
&& chmod +x ./rustup-init \
&& mv rustup-init /usr/bin/rustup-init
USER build
WORKDIR /home/build
RUN rustup-init -yv --profile minimal --default-toolchain nightly \
&& rm -rvf "$HOME/.rustup/roolchains/*/share"
RUN ls -alh "$HOME" && bash -c '. "$HOME/.cargo/env" \
&& cargo version -vv'

13
build/Dockerfile.musl Normal file
View file

@ -0,0 +1,13 @@
FROM docker.io/library/alpine:edge
RUN apk add --no-cache build-base bash tree rustup git just cloc clang20-dev pipewire-jack-dev
RUN adduser -Du1000 build
USER 1000
RUN rustup-init -y --profile minimal --default-toolchain nightly \
&& rm -rvf "$HOME/.rustup/roolchains/*/share"
RUN source "$HOME/.cargo/env" \
&& cargo version -vv

11
build/README.md Normal file
View file

@ -0,0 +1,11 @@
This directory contains Dockerfiles and shell scripts
for building Tek in a container. For now, only the
GLIBC build works, as the Musl static build is unable
to `dlopen` the system's `libjack.so`.
Invoke from repo root, like this: `build/release-glibc.sh`.
This will first build a Docker image, `tek:glibc`, which
will contain all build-time dependencies; then, it
will invoke a `cargo build --release` in a container
spawned from that image, ultimately placing the
release build in this directory, as `build/tek`.

11
build/release-glibc-shell.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env sh
set -exo pipefail
docker inspect perch:glibc || time docker build --cache-from=internal \
-f build/Dockerfile.glibc -t perch:glibc .
time docker run \
--rm -itu0 \
-v .:/build -w /build \
-vperch-build-cargo:/home/build/.cargo \
-vperch-build-target:/build/target \
-eRUST_JACK_DLOPEN=true \
perch:glibc $@

14
build/release-glibc.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env sh
set -exo pipefail
docker inspect perch:glibc || time docker build --cache-from=internal \
-f build/Dockerfile.glibc -t perch:glibc .
time docker run \
--rm -itu0 \
-v .:/build -w /build \
-vperch-build-cargo:/home/build/.cargo \
-vperch-build-target:/build/target \
-eRUST_JACK_DLOPEN=true \
perch:glibc sh -c "chown -R 1000:1000 /build/target \
&& su build -c '. ~/.cargo/env \
&& time cargo build -j4 --release \
&& cp target/release/perch build/'"

11
build/release-musl-shell.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env sh
set -exo pipefail
docker inspect perch:musl || time docker build --cache-from=internal \
-f build/Dockerfile.musl -t perch:musl .
time docker run \
--rm -itu0 \
-v .:/build -w /build \
-vperch-build-cargo:/home/build/.cargo \
-vperch-build-target:/build/target \
-eRUST_JACK_DLOPEN=true \
perch:musl $@

14
build/release-musl.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env sh
set -exo pipefail
docker inspect perch:musl || time docker build --cache-from=internal \
-f build/Dockerfile.musl -t perch:musl .
time docker run \
--rm -itu0 \
-v .:/build -w /build \
-vperch-build-cargo:/home/build/.cargo \
-vperch-build-target:/build/target \
-eRUST_JACK_DLOPEN=true \
perch:musl sh -c "chown -R 1000:1000 /build/target \
&& su build -c 'source ~/.cargo/env \
&& just build-release \
&& cp target/release/perch build/'"

0
target/.gitkeep Normal file
View file