From 6758de34459c32316adce275b8337a845fb73a30 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Tue, 26 May 2026 19:31:41 -0700 Subject: [PATCH] fix: make heimdall-eda support darwin --- .github/workflows/ci-deb.yml | 86 --------------- .github/workflows/ci-docker.yml | 182 -------------------------------- README.md | 5 + crates/heimdall-eda/Cargo.toml | 14 +-- pkgs/heimdall-eda/default.nix | 2 +- pkgs/heimdall-logo/default.nix | 4 +- 6 files changed, 15 insertions(+), 278 deletions(-) delete mode 100644 .github/workflows/ci-deb.yml delete mode 100644 .github/workflows/ci-docker.yml diff --git a/.github/workflows/ci-deb.yml b/.github/workflows/ci-deb.yml deleted file mode 100644 index e80ef1f..0000000 --- a/.github/workflows/ci-deb.yml +++ /dev/null @@ -1,86 +0,0 @@ -on: - push: - branches: - - master - tags: - - v?[0-9]+.[0-9]+.[0-9]+* - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - discover: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - outputs: - matrix: ${{ steps.discover.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - id: discover - run: | - flake_json=$(nix flake show --all-systems --json 2>/dev/null) - - matrix=$(echo "$flake_json" | jq -c '[.inventory.packages.output.children - | to_entries[] - | .key as $sys - | .value.children - | keys[] - | select(endswith("-deb")) - | {system: $sys, package: .}]') - - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - - build: - needs: discover - runs-on: ${{ matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} - permissions: - id-token: write - contents: read - strategy: - fail-fast: false - matrix: - include: ${{ fromJson(needs.discover.outputs.matrix) }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - - name: Build .deb package - run: nix build '.#packages.${{ matrix.system }}.${{ matrix.package }}' -o result - - - name: Determine .deb filename - id: meta - run: | - deb=$(basename "$(readlink result)") - cp result "$deb" - echo "filename=$deb" >> "$GITHUB_OUTPUT" - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.package }}-${{ matrix.system }} - path: ${{ steps.meta.outputs.filename }} - - release: - if: startsWith(github.ref, 'refs/tags/v') - needs: build - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: debs - merge-multiple: true - - - name: Upload to release - uses: softprops/action-gh-release@v2 - with: - files: debs/*.deb diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml deleted file mode 100644 index 7188a7e..0000000 --- a/.github/workflows/ci-docker.yml +++ /dev/null @@ -1,182 +0,0 @@ -on: - push: - branches: - - master - tags: - - v?[0-9]+.[0-9]+.[0-9]+* - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - discover: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - outputs: - matrix: ${{ steps.discover.outputs.matrix }} - manifests: ${{ steps.discover.outputs.manifests }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - id: discover - run: | - flake_json=$(nix flake show --all-systems --json 2>/dev/null) - - matrix=$(echo "$flake_json" | jq -c '[.inventory.packages.output.children - | to_entries[] - | .key as $sys - | .value.children - | keys[] - | select(endswith("-docker")) - | {system: $sys, package: .}]') - - manifests=$(echo "$flake_json" | jq -c '[.inventory.packages.output.children - | to_entries[] - | .key as $sys - | .value.children - | keys[] - | select(endswith("-docker")) - | {system: $sys, package: .}] - | group_by(.package) - | map({package: .[0].package, systems: [.[].system]})') - - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - echo "manifests=$manifests" >> "$GITHUB_OUTPUT" - - build-and-push: - needs: discover - runs-on: ${{ matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} - permissions: - id-token: write - contents: read - packages: write - strategy: - fail-fast: false - matrix: - include: ${{ fromJson(needs.discover.outputs.matrix) }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - - name: Build Docker image - run: nix build '.#packages.${{ matrix.system }}.${{ matrix.package }}' -o result - - - name: Determine image metadata - id: meta - run: | - name=$(nix eval --raw '.#packages.${{ matrix.system }}.${{ matrix.package }}.imageName') - tag=$(nix eval --raw '.#packages.${{ matrix.system }}.${{ matrix.package }}.imageTag') - echo "name=$name" >> "$GITHUB_OUTPUT" - echo "tag=$tag" >> "$GITHUB_OUTPUT" - - - name: Login to GHCR - if: github.event_name == 'push' - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Push image - if: github.event_name == 'push' - run: | - repo="ghcr.io/${{ github.repository_owner }}/${{ steps.meta.outputs.name }}" - repo="${repo,,}" - sha="${GITHUB_SHA::7}" - - docker load < result - loaded="${{ steps.meta.outputs.name }}:${{ steps.meta.outputs.tag }}" - - # Always push the system-specific tag (used by manifest job) - docker tag "$loaded" "$repo:${{ matrix.system }}" - docker push "$repo:${{ matrix.system }}" - - # Push SHA-tagged per-arch image - docker tag "$loaded" "$repo:${{ matrix.system }}-$sha" - docker push "$repo:${{ matrix.system }}-$sha" - - # Push version-tagged per-arch image on tag events - if [[ "$GITHUB_REF" == refs/tags/v* ]]; then - vtag="${GITHUB_REF#refs/tags/}" - docker tag "$loaded" "$repo:${{ matrix.system }}-$vtag" - docker push "$repo:${{ matrix.system }}-$vtag" - fi - - manifest: - if: github.event_name == 'push' - needs: [discover, build-and-push] - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - packages: write - strategy: - matrix: - include: ${{ fromJson(needs.discover.outputs.manifests) }} - steps: - - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/flakehub-cache-action@main - - - name: Determine image name - id: meta - run: | - name=$(nix eval --raw '.#packages.${{ matrix.systems[0] }}.${{ matrix.package }}.imageName') - repo="ghcr.io/${{ github.repository_owner }}/$name" - echo "repo=${repo,,}" >> "$GITHUB_OUTPUT" - - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Create and push multi-arch manifests - run: | - repo="${{ steps.meta.outputs.repo }}" - systems='${{ toJson(matrix.systems) }}' - sha="${GITHUB_SHA::7}" - - args=() - annotations=() - for sys in $(echo "$systems" | jq -r '.[]'); do - args+=("$repo:$sys") - arch="${sys%%-*}" - case "$arch" in - x86_64) docker_arch="amd64" ;; - aarch64) docker_arch="arm64" ;; - *) docker_arch="$arch" ;; - esac - annotations+=("$repo:$sys --os linux --arch $docker_arch") - done - - # latest manifest - docker manifest create "$repo:latest" "${args[@]}" - for ann in "${annotations[@]}"; do - docker manifest annotate "$repo:latest" $ann - done - docker manifest push "$repo:latest" - - # SHA manifest - docker manifest create "$repo:$sha" "${args[@]}" - for ann in "${annotations[@]}"; do - docker manifest annotate "$repo:$sha" $ann - done - docker manifest push "$repo:$sha" - - # Version tag manifest - if [[ "$GITHUB_REF" == refs/tags/v* ]]; then - vtag="${GITHUB_REF#refs/tags/}" - docker manifest create "$repo:$vtag" "${args[@]}" - for ann in "${annotations[@]}"; do - docker manifest annotate "$repo:$vtag" $ann - done - docker manifest push "$repo:$vtag" - fi diff --git a/README.md b/README.md index f32c82c..4f1f35b 100644 --- a/README.md +++ b/README.md @@ -176,3 +176,8 @@ Every crate in `crates/` is publishable on its own. Build only what you need. ## Commercial support Midstall offers paid integration work for Heimdall: new DUT drivers, custom transports, on-prem deployment, and bringup-as-a-service. Contact `inquire@midstall.com`. + +## Community + +- **Discord**: [Join the server](https://discord.gg/HRhetTVcHG) +- **Contact**: [inquire@midstall.com](mailto:inquire@midstall.com) diff --git a/crates/heimdall-eda/Cargo.toml b/crates/heimdall-eda/Cargo.toml index 4ba5a52..9e0eff1 100644 --- a/crates/heimdall-eda/Cargo.toml +++ b/crates/heimdall-eda/Cargo.toml @@ -19,13 +19,6 @@ path = "src/main.rs" [dependencies] heimdall = { workspace = true, features = ["fuzzer", "daemon", "tui", "river"] } heimdall-daemon = { workspace = true, features = ["sqlite", "river"] } - -# heimdall-daemon's `aegis` feature pulls in heimdall-transport/linux-cdev -# for chardev GPIO, which only builds on Linux. Darwin builds get a daemon -# without the Aegis factories. River works on both via OpenOCD over TCP. -[target.'cfg(target_os = "linux")'.dependencies] -heimdall = { workspace = true, features = ["aegis"] } -heimdall-daemon = { workspace = true, features = ["aegis"] } heimdall-i18n = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } clap.workspace = true @@ -38,3 +31,10 @@ async-trait = { workspace = true } reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } + +# heimdall-daemon's `aegis` feature pulls in heimdall-transport/linux-cdev +# for chardev GPIO, which only builds on Linux. Darwin gets a daemon +# without the Aegis factories. River works on both via OpenOCD over TCP. +[target.'cfg(target_os = "linux")'.dependencies] +heimdall = { workspace = true, features = ["aegis"] } +heimdall-daemon = { workspace = true, features = ["aegis"] } diff --git a/pkgs/heimdall-eda/default.nix b/pkgs/heimdall-eda/default.nix index 1b328aa..62319d8 100644 --- a/pkgs/heimdall-eda/default.nix +++ b/pkgs/heimdall-eda/default.nix @@ -17,7 +17,7 @@ craneLib.buildPackage ( homepage = "https://github.com/Midstall/heimdall"; license = lib.licenses.asl20; mainProgram = "heimdall"; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; }; } ) diff --git a/pkgs/heimdall-logo/default.nix b/pkgs/heimdall-logo/default.nix index 5c3e477..1cd7889 100644 --- a/pkgs/heimdall-logo/default.nix +++ b/pkgs/heimdall-logo/default.nix @@ -38,13 +38,13 @@ python3Packages.buildPythonPackage (finalAttrs: { meta = with lib; { description = "Rendered Heimdall logo SVGs."; license = licenses.asl20; - platforms = platforms.linux; + platforms = platforms.unix; }; }; meta = with lib; { description = "Programmatic generator for the Heimdall project logo."; license = licenses.asl20; - platforms = platforms.linux; + platforms = platforms.unix; }; })