Compare commits

..

6 Commits

Author SHA1 Message Date
Remco Ros
d601c19646 fix: take into account service dependencies when loading the service containers and load them in correct order 2026-02-04 15:10:35 +01:00
Matt Hill
58e0b166cb move comment to safe place 2026-02-02 21:09:19 -07:00
Matt Hill
2a678bb017 fix warning and skip raspberrypi builds for now 2026-02-02 20:16:41 -07:00
Matt Hill
5664456b77 fix for buildjet 2026-02-02 18:51:11 -07:00
Matt Hill
3685b7e57e fix workflows 2026-02-02 18:37:13 -07:00
Matt Hill
989d5f73b1 fix --arch flag to fall back to emulation when native image unavailab… (#3108)
* fix --arch flag to fall back to emulation when native image unavailable, always infer hardware requirement for arch

* better handling of arch filter

* dont cancel in-progress commit workflows and abstract common setup

* cli improvements

fix group handling

* fix cli publish

* alpha.19

---------

Co-authored-by: Aiden McClelland <me@drbonez.dev>
2026-02-03 00:56:59 +00:00
7 changed files with 108 additions and 26 deletions

View File

@@ -5,10 +5,6 @@ inputs:
nodejs-version:
description: Node.js version
required: true
use-tmpfs:
description: Mount tmpfs (for fast runners)
required: false
default: "false"
setup-python:
description: Set up Python
required: false
@@ -51,14 +47,10 @@ runs:
sudo rm -rf /usr/share/swift
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Mount tmpfs
if: inputs.use-tmpfs == 'true'
# BuildJet runners lack /opt/hostedtoolcache, which setup-python and setup-qemu expect
- name: Ensure hostedtoolcache exists
shell: bash
run: sudo mount -t tmpfs tmpfs .
- uses: actions/checkout@v4
with:
submodules: recursive
run: sudo mkdir -p /opt/hostedtoolcache && sudo chown $USER:$USER /opt/hostedtoolcache
- name: Set up Python
if: inputs.setup-python == 'true'
@@ -69,6 +61,8 @@ runs:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodejs-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Set up Docker QEMU
if: inputs.setup-docker == 'true'

View File

@@ -65,10 +65,15 @@ jobs:
}}
runs-on: ${{ fromJson('["ubuntu-latest", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }}
steps:
- name: Mount tmpfs
if: ${{ github.event.inputs.runner == 'fast' }}
run: sudo mount -t tmpfs tmpfs .
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}
use-tmpfs: ${{ github.event.inputs.runner == 'fast' }}
- name: Make
run: TARGET=${{ matrix.triple }} make cli

View File

@@ -61,10 +61,15 @@ jobs:
}}
runs-on: ${{ fromJson('["ubuntu-latest", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }}
steps:
- name: Mount tmpfs
if: ${{ github.event.inputs.runner == 'fast' }}
run: sudo mount -t tmpfs tmpfs .
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}
use-tmpfs: ${{ github.event.inputs.runner == 'fast' }}
- name: Make
run: make registry-deb

View File

@@ -61,10 +61,15 @@ jobs:
}}
runs-on: ${{ fromJson('["ubuntu-latest", "buildjet-32vcpu-ubuntu-2204"]')[github.event.inputs.runner == 'fast'] }}
steps:
- name: Mount tmpfs
if: ${{ github.event.inputs.runner == 'fast' }}
run: sudo mount -t tmpfs tmpfs .
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}
use-tmpfs: ${{ github.event.inputs.runner == 'fast' }}
- name: Make
run: make tunnel-deb

View File

@@ -27,7 +27,7 @@ on:
- x86_64-nonfree
- aarch64
- aarch64-nonfree
- raspberrypi
# - raspberrypi
- riscv64
deploy:
type: choice
@@ -91,10 +91,15 @@ jobs:
)[github.event.inputs.runner == 'fast']
}}
steps:
- name: Mount tmpfs
if: ${{ github.event.inputs.runner == 'fast' }}
run: sudo mount -t tmpfs tmpfs .
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}
use-tmpfs: ${{ github.event.inputs.runner == 'fast' }}
setup-python: "true"
- name: Make
@@ -113,13 +118,14 @@ jobs:
strategy:
fail-fast: false
matrix:
# TODO: re-add "raspberrypi" to the platform list below
platform: >-
${{
fromJson(
format(
'[
["{0}"],
["x86_64", "x86_64-nonfree", "aarch64", "aarch64-nonfree", "riscv64", "raspberrypi"]
["x86_64", "x86_64-nonfree", "aarch64", "aarch64-nonfree", "riscv64"]
]',
github.event.inputs.platform || 'ALL'
)
@@ -183,6 +189,10 @@ jobs:
sudo rm -rf "$AGENT_TOOLSDIRECTORY" # Pre-cached tool cache (Go, Node, etc.)
if: ${{ github.event.inputs.runner != 'fast' }}
# BuildJet runners lack /opt/hostedtoolcache, which setup-qemu expects
- name: Ensure hostedtoolcache exists
run: sudo mkdir -p /opt/hostedtoolcache && sudo chown $USER:$USER /opt/hostedtoolcache
- name: Set up docker QEMU
uses: docker/setup-qemu-action@v3

View File

@@ -24,6 +24,9 @@ jobs:
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/setup-build
with:
nodejs-version: ${{ env.NODEJS_VERSION }}

View File

@@ -1,4 +1,4 @@
use std::collections::BTreeMap;
use std::collections::{BTreeMap, BTreeSet};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::Duration;
@@ -88,17 +88,77 @@ impl ServiceMap {
#[instrument(skip_all)]
pub async fn init(&self, ctx: &RpcContext) -> Result<(), Error> {
let ids = ctx.db.peek().await.as_public().as_package_data().keys()?;
let mut jobs = FuturesUnordered::new();
let db = ctx.db.peek().await;
let ids = db.as_public().as_package_data().keys()?;
// Build dependency map for all packages
let mut dependencies: BTreeMap<PackageId, BTreeSet<PackageId>> = BTreeMap::new();
for id in &ids {
jobs.push(self.load(ctx, id, LoadDisposition::Retry));
}
while let Some(res) = jobs.next().await {
if let Err(e) = res {
tracing::error!("Error loading installed package as service: {e}");
tracing::debug!("{e:?}");
if let Some(pde) = db.as_public().as_package_data().as_idx(&id) {
let deps: BTreeSet<PackageId> = pde
.as_current_dependencies()
.de()?
.0
.keys()
.cloned()
.collect();
dependencies.insert(id.clone(), deps);
}
}
let mut remaining: BTreeSet<PackageId> = ids.iter().cloned().collect();
while !remaining.is_empty() {
// Find packages with no remaining dependencies
let can_load: Vec<PackageId> = remaining
.iter()
.filter(|pkg_id| {
// A package can be loaded if none of its dependencies are still in the remaining set
if let Some(deps) = dependencies.get(*pkg_id) {
!deps.iter().any(|dep| remaining.contains(dep))
} else {
true
}
})
.cloned()
.collect();
if can_load.is_empty() {
// Dependency cycle detected, load remaining packages anyway
tracing::warn!(
"Dependency cycle detected, loading remaining packages in arbitrary order"
);
let mut jobs = FuturesUnordered::new();
for id in &remaining {
jobs.push(self.load(ctx, id, LoadDisposition::Retry));
}
while let Some(res) = jobs.next().await {
if let Err(e) = res {
tracing::error!("Error loading installed package as service: {e}");
tracing::debug!("{e:?}");
}
}
break;
}
// Remove from remaining set
for id in &can_load {
remaining.remove(id);
}
// Load packages with no remaining dependencies concurrently
let mut jobs = FuturesUnordered::new();
for id in &can_load {
jobs.push(self.load(ctx, id, LoadDisposition::Retry));
}
while let Some(res) = jobs.next().await {
if let Err(e) = res {
tracing::error!("Error loading installed package as service: {e}");
tracing::debug!("{e:?}");
}
}
}
Ok(())
}