Skip to content

Commit f85a2b4

Browse files
chore(ci): build channel from artifacts (#395)
* chore: bundle artifacts as channel * Include pixi-build-api version * Fix ros backend * Revert activation script * Try ninja * Fix regression * Fix comments * Bump rust compiler version * Fix other comment * Typo * Use sccache for ubuntu * Update sccache * Fix sccache invocation * Use --no-build-id to make sccache work * Remove task caching * Rework * Set CARGO_HOME * Add task caching * Fix windows --------- Co-authored-by: Julian Hofer <[email protected]> Co-authored-by: Hofer-Julian <[email protected]>
1 parent 5a79c7d commit f85a2b4

File tree

14 files changed

+925
-63
lines changed

14 files changed

+925
-63
lines changed

.github/workflows/testsuite.yml

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,46 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
env:
14-
RUST_LOG: info
15-
RUST_BACKTRACE: 1
16-
RUSTFLAGS: "-D warnings"
17-
CARGO_TERM_COLOR: always
18-
TARGET_DIR: target/pixi/ci
1914
PYTHONIOENCODING: utf-8
2015

2116
jobs:
2217
build-binary-linux-x86_64:
2318
name: Build Ubuntu
2419
runs-on: ubuntu-latest
2520
timeout-minutes: 20
21+
env:
22+
SCCACHE_GHA_ENABLED: "true"
23+
ACTIONS_CACHE_SERVICE_V2: on
2624
steps:
2725
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2826
- uses: prefix-dev/setup-pixi@main
2927
with:
3028
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
31-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
29+
- name: Configure sccache
30+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
3231
with:
33-
workspaces: ". -> target/pixi"
34-
key: ${{ hashFiles('pixi.lock') }}
35-
save-if: ${{ github.ref == 'refs/heads/main' }}
36-
- name: Build backends
37-
run: pixi run build-ci
32+
script: |
33+
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
34+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
35+
- name: Build backends channel
36+
run: pixi run -e build create-testsuite-channel
37+
- name: Show sccache stats
38+
run: pixi run -e build sccache --stop-server
3839
- name: Upload executables as artifacts
3940
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4041
with:
4142
name: pixi-build-backends-linux-x86_64
42-
path: |
43-
${{ env.TARGET_DIR }}/pixi-build-*
44-
!${{ env.TARGET_DIR }}/pixi-build-*.d
43+
path: artifacts-channel
4544
if-no-files-found: error
4645
retention-days: 60
4746

4847
build-binary-windows-x86_64:
4948
name: Build Windows
5049
runs-on: windows-latest
5150
timeout-minutes: 20
51+
env:
52+
SCCACHE_GHA_ENABLED: "true"
53+
ACTIONS_CACHE_SERVICE_V2: on
5254
steps:
5355
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
5456
- name: Create Dev Drive
@@ -60,47 +62,55 @@ jobs:
6062
with:
6163
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
6264
manifest-path: ${{ env.PIXI_WORKSPACE }}/pixi.toml
63-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
65+
- name: Configure sccache
66+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
6467
with:
65-
workspaces: ". -> ${{ env.PIXI_WORKSPACE }}/target/pixi"
66-
key: ${{ hashFiles('pixi.lock') }}
67-
save-if: ${{ github.ref == 'refs/heads/main' }}
68-
- name: Build backends
69-
run: pixi run build-ci
68+
script: |
69+
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
70+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
71+
- name: Enable long paths (Windows)
72+
run: git config --global core.longpaths true
73+
- name: Build backends channel
74+
run: pixi run -e build create-testsuite-channel
75+
working-directory: ${{ env.PIXI_WORKSPACE }}
76+
- name: Show sccache stats
77+
run: pixi run -e build sccache --stop-server
7078
working-directory: ${{ env.PIXI_WORKSPACE }}
7179
- name: Upload executables as artifacts
7280
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
7381
with:
7482
name: pixi-build-backends-windows-x86_64
75-
path: |
76-
${{ env.PIXI_WORKSPACE }}/${{ env.TARGET_DIR }}/pixi-build-*
77-
!${{ env.PIXI_WORKSPACE }}/${{ env.TARGET_DIR }}/pixi-build-*.d
83+
path: ${{ env.PIXI_WORKSPACE }}/artifacts-channel
7884
if-no-files-found: error
7985
retention-days: 60
8086

8187
build-binary-macos-aarch64:
8288
name: Build macOS
8389
runs-on: macos-latest
8490
timeout-minutes: 20
91+
env:
92+
SCCACHE_GHA_ENABLED: "true"
93+
ACTIONS_CACHE_SERVICE_V2: on
8594
steps:
8695
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
8796
- uses: prefix-dev/setup-pixi@main
8897
with:
8998
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
90-
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
99+
- name: Configure sccache
100+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
91101
with:
92-
workspaces: ". -> target/pixi"
93-
key: ${{ hashFiles('pixi.lock') }}
94-
save-if: ${{ github.ref == 'refs/heads/main' }}
95-
- name: Build backends
96-
run: pixi run build-ci
102+
script: |
103+
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
104+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
105+
- name: Build backends channel
106+
run: pixi run -e build create-testsuite-channel
107+
- name: Show sccache stats
108+
run: pixi run -e build sccache --stop-server
97109
- name: Upload executables as artifacts
98110
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
99111
with:
100112
name: pixi-build-backends-macos-aarch64
101-
path: |
102-
${{ env.TARGET_DIR }}/pixi-build-*
103-
!${{ env.TARGET_DIR }}/pixi-build-*.d
113+
path: artifacts-channel
104114
if-no-files-found: error
105115
retention-days: 60
106116

@@ -135,9 +145,6 @@ jobs:
135145

136146
- name: Run integration tests
137147
run: pixi run --locked test-slow
138-
env:
139-
PIXI_BIN_DIR: ${{ github.workspace }}/artifacts
140-
BUILD_BACKENDS_BIN_DIR: ${{ github.workspace }}/artifacts
141148

142149
test-windows-x86_64:
143150
name: Test Windows x86_64
@@ -177,9 +184,6 @@ jobs:
177184
- name: Run integration tests
178185
run: pixi run --locked test-slow
179186
working-directory: ${{ env.PIXI_WORKSPACE }}
180-
env:
181-
PIXI_BIN_DIR: ${{ env.PIXI_WORKSPACE }}/artifacts
182-
BUILD_BACKENDS_BIN_DIR: ${{ env.PIXI_WORKSPACE }}/artifacts
183187

184188
test-macos-aarch64:
185189
name: Test macOS aarch64
@@ -212,6 +216,3 @@ jobs:
212216

213217
- name: Run integration tests
214218
run: pixi run --locked test-slow
215-
env:
216-
PIXI_BIN_DIR: ${{ github.workspace }}/artifacts
217-
BUILD_BACKENDS_BIN_DIR: ${{ github.workspace }}/artifacts

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ AGENTS.md
4747
# Python
4848
*.pyc
4949
__pycache__/
50+
51+
artifacts-channel

backends/pixi-build-ros/templates/bld_ament_cmake.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ set CXX=cl.exe
1818
if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"
1919
pushd %BUILD_DIR%
2020

21-
:: set "CMAKE_GENERATOR=Ninja"
21+
set "CMAKE_GENERATOR=Ninja"
2222
:: We use the Visual Studio generator as a workaround for
2323
:: problems in Ninja when using long paths, see https://github.com/RoboStack/ros-humble/pull/229#issuecomment-2564856467
2424
:: Once those are solved, we can switch back to use Ninja
25-
set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%"
25+
:: set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%"
2626

2727
:: PYTHON_INSTALL_DIR should be a relative path, see
2828
:: https://github.com/ament/ament_cmake/blob/2.3.2/ament_cmake_python/README.md

backends/pixi-build-ros/templates/build_ament_python.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ -f setup.cfg ] && grep -q "install[-_]scripts" setup.cfg; then
1616
PKG_NAME_SHORT=${PKG_NAME_SHORT//-/_}
1717
INSTALL_SCRIPTS_ARG="--install-scripts=$PREFIX/lib/$PKG_NAME_SHORT"
1818
echo "WARNING: setup.cfg not set, will set INSTALL_SCRIPTS_ARG to: $INSTALL_SCRIPTS_ARG"
19-
$PYTHON setup.py install --prefix="$PREFIX" --install-lib="$SP_DIR" $INSTALL_SCRIPTS_ARG --single-version-externally-managed
19+
$PYTHON setup.py install --prefix="$PREFIX" --install-lib="$SP_DIR" $INSTALL_SCRIPTS_ARG --single-version-externally-managed --record=files.txt
2020
# Remove build artifacts from setup.py install
2121
rm -rf *.egg-info 2>/dev/null || true
2222
rm -rf build/ 2>/dev/null || true

crates/pixi-build-backend/src/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub trait ProjectModel {
2525
fn dependencies(
2626
&self,
2727
platform: Option<Platform>,
28-
) -> Dependencies<<<Self as ProjectModel>::Targets as Targets>::Spec> {
28+
) -> Dependencies<'_, <<Self as ProjectModel>::Targets as Targets>::Spec> {
2929
self.targets()
3030
.map(|t| t.dependencies(platform))
3131
.unwrap_or_default()

crates/pixi-build-backend/src/traits/targets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub trait Targets {
8181
fn targets(&self) -> impl Iterator<Item = (&Self::Selector, &Self::Target)>;
8282

8383
/// Return all dependencies for the given platform
84-
fn dependencies(&self, platform: Option<Platform>) -> Dependencies<Self::Spec>;
84+
fn dependencies(&self, platform: Option<Platform>) -> Dependencies<'_, Self::Spec>;
8585

8686
/// Return the run dependencies for the given platform
8787
fn run_dependencies(
@@ -191,7 +191,7 @@ impl Targets for pbt::TargetsV1 {
191191
.collect::<IndexMap<&pbt::SourcePackageName, &pbt::PackageSpecV1>>()
192192
}
193193

194-
fn dependencies(&self, platform: Option<Platform>) -> Dependencies<Self::Spec> {
194+
fn dependencies(&self, platform: Option<Platform>) -> Dependencies<'_, Self::Spec> {
195195
let build_deps = self.build_dependencies(platform);
196196
let host_deps = self.host_dependencies(platform);
197197
let run_deps = self.run_dependencies(platform);

crates/recipe-stage0/src/recipe.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl<T> ListOrItem<T> {
293293
self.0.len()
294294
}
295295

296-
pub fn iter(&self) -> std::slice::Iter<T> {
296+
pub fn iter(&self) -> std::slice::Iter<'_, T> {
297297
self.0.iter()
298298
}
299299
}
@@ -659,13 +659,13 @@ impl Display for ConditionalRequirements {
659659
}
660660
}
661661

662-
#[derive(Debug, Serialize, Deserialize)]
663-
pub(crate) struct Requirements {
664-
pub build: Vec<SerializableMatchSpec>,
665-
pub host: Vec<SerializableMatchSpec>,
666-
pub run: Vec<SerializableMatchSpec>,
667-
pub run_constraints: Vec<SerializableMatchSpec>,
668-
}
662+
// #[derive(Debug, Serialize, Deserialize)]
663+
// pub(crate) struct Requirements {
664+
// pub build: Vec<SerializableMatchSpec>,
665+
// pub host: Vec<SerializableMatchSpec>,
666+
// pub run: Vec<SerializableMatchSpec>,
667+
// pub run_constraints: Vec<SerializableMatchSpec>,
668+
// }
669669

670670
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
671671
pub struct Test {

0 commit comments

Comments
 (0)