Skip to content

Commit 5810231

Browse files
committed
ci(temp): instrument opencv install() with on-disk trace (pinpoint macOS failure)
install() dies invisibly on macOS before cmake (no build log; MCPP_VERBOSE doesn't surface hook errors). Write a step-by-step trace to $HOME/ocv_trace.txt and cat it in the failure diagnostic to see exactly where it dies (find_srcroot / os.mv / before cmake). Temp.
1 parent cbded29 commit 5810231

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/validate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ jobs:
202202
if: failure() && runner.os != 'Windows'
203203
shell: bash
204204
run: |
205+
echo "=== opencv install() trace ==="
206+
cat "$HOME/ocv_trace.txt" 2>/dev/null || echo "(no trace)"
205207
echo "=== opencv build log(s) ==="
206208
find "$GITHUB_WORKSPACE" "$HOME" -name 'mcpp_opencv_build.log' 2>/dev/null | while read -r f; do
207209
echo "--- $f ---"; cat "$f"; echo "--- end ---"

pkgs/c/compat.opencv.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,20 @@ local function find_srcroot(version)
162162
end
163163

164164
local function _install_impl()
165+
-- [TEMP macOS debug] on-disk trace: the install() failure is invisible under
166+
-- xim's interface mode; write progress to $HOME so CI can surface where it dies.
167+
local _trbuf = ""
168+
local function trace(s)
169+
_trbuf = _trbuf .. tostring(s) .. "\n"
170+
pcall(function() io.writefile((os.getenv("HOME") or "/tmp") .. "/ocv_trace.txt", _trbuf) end)
171+
end
172+
trace("enter host=" .. tostring(os.host()))
165173
local version = pkginfo.version()
166174
local prefix = pkginfo.install_dir()
167175
local srcroot = find_srcroot(version)
176+
trace("version=" .. tostring(version))
177+
trace("prefix=" .. tostring(prefix))
178+
trace("srcroot=" .. tostring(srcroot) .. " isdir=" .. tostring(os.isdir(srcroot)))
168179

169180
local jobs = (os.default_njob and os.default_njob()) or 4
170181

@@ -252,10 +263,14 @@ local function _install_impl()
252263
-- compat.openblas). Then build out-of-source into ./_bld and install
253264
-- headers+libs back into prefix, which is now the cwd.
254265
os.tryrm(prefix)
266+
trace("compiler gcc=" .. tostring(gcc) .. " gxx=" .. tostring(gxx) .. " isMac=" .. tostring(isMac))
267+
trace("libenv=[" .. tostring(libenv) .. "]")
255268
os.mv(srcroot, prefix)
256269
os.cd(prefix)
270+
trace("after mv+cd, prefix isdir=" .. tostring(os.isdir(prefix)))
257271

258272
local logf = path.join(prefix, "mcpp_opencv_build.log")
273+
trace("about to run cmake configure; logf=" .. tostring(logf))
259274

260275
-- Curated, fully-offline profile: core+imgproc+imgcodecs, bundled zlib/png/jpeg,
261276
-- everything downloadable or host-dependent OFF (WITH_ADE=OFF kills the only

0 commit comments

Comments
 (0)