Skip to content

Commit a707867

Browse files
HanSur94claude
andauthored
fix(mex): bypass install() in CI + remove broken add-paths filter (#94)
Round 2 on the multi-platform refresh pipeline (after #93). Two remaining issues from validation run 25055144678: 1. Windows MATLAB still emitted no .mexw64 despite the install.m probe-2 guard. The Compile step ran for 6s with zero MATLAB output — too short for actual compilation, suggesting install() exited before first_run() ran (possibly a path resolution issue with `fileparts(mfilename('fullpath'))` inside run-matlab-command's temp cwd, but also generally undesirable in CI). install()'s needs_build cache is a user-facing convenience; CI should compile unconditionally. Replace `install();` with explicit `addpath('libs/FastSense'); build_mex();` plus a diagnostic header (cwd, mexext, arch, build_mex path) that prints regardless. 2. The aggregator's create-pull-request `add-paths` filter (with nested-glob patterns like `libs/FastSense/private/octave-*/**`) silently failed to stage despite git status showing all the modifications. peter-evans/create-pull-request then errored with "no changes added to commit" → "Unexpected error". Remove the filter; the aggregator's working tree is exclusively the committed repo plus extracted MEX artifacts plus the regenerated stamp, so staging all changes is correct here. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dbc2c73 commit a707867

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

.github/workflows/refresh-mex-binaries.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,23 @@ jobs:
9191
with:
9292
command: "assert(strcmp(mexext(), '${{ matrix.mexext }}'), sprintf('Expected %s, got %s', '${{ matrix.mexext }}', mexext()));"
9393

94-
- name: Compile via install()
94+
# Compile via build_mex() directly, NOT install(). install() applies
95+
# a needs_build cache check that has bitten us on Windows MATLAB:
96+
# if any probe path matches (or path resolution gets weird in the
97+
# run-matlab-command temp cwd), install() exits before compiling
98+
# and produces an empty artifact. build_mex() is unconditional.
99+
- name: Compile via build_mex()
95100
uses: matlab-actions/run-command@v3
96101
with:
97-
command: "install();"
102+
command: |
103+
fprintf('--- runner diagnostics ---\n');
104+
fprintf('cwd: %s\n', pwd);
105+
fprintf('mexext: %s\n', mexext());
106+
fprintf('arch: %s\n', computer('arch'));
107+
addpath(fullfile(pwd, 'libs', 'FastSense'));
108+
fprintf('build_mex on path: %s\n', which('build_mex'));
109+
fprintf('--- compiling ---\n');
110+
build_mex();
98111
99112
- name: Upload artifact
100113
uses: actions/upload-artifact@v7
@@ -317,20 +330,10 @@ jobs:
317330
318331
Merging this PR does NOT retrigger the workflow (binaries and
319332
the stamp are excluded from the workflow's `paths` filter).
320-
add-paths: |
321-
libs/FastSense/private/*.mexmaca64
322-
libs/FastSense/private/*.mexmaci64
323-
libs/FastSense/private/*.mexa64
324-
libs/FastSense/private/*.mexw64
325-
libs/FastSense/mksqlite.mexmaca64
326-
libs/FastSense/mksqlite.mexmaci64
327-
libs/FastSense/mksqlite.mexa64
328-
libs/FastSense/mksqlite.mexw64
329-
libs/SensorThreshold/private/*.mexmaca64
330-
libs/SensorThreshold/private/*.mexmaci64
331-
libs/SensorThreshold/private/*.mexa64
332-
libs/SensorThreshold/private/*.mexw64
333-
libs/FastSense/private/octave-*/**
334-
libs/FastSense/octave-*/**
335-
libs/SensorThreshold/private/octave-*/**
336-
libs/FastSense/private/.mex-version
333+
# No `add-paths` filter: the prior nested-glob patterns
334+
# (e.g. `libs/FastSense/private/octave-*/**`) didn't match
335+
# reliably and resulted in "no changes added to commit"
336+
# followed by an opaque "Unexpected error" from the action.
337+
# The aggregator's working tree only contains the committed
338+
# repo plus extracted MEX artifacts and the regenerated stamp,
339+
# so staging all changes is correct here.

0 commit comments

Comments
 (0)