diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ec6ad7..35eb227 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,6 +140,8 @@ jobs: run: .build/debug/forge-cli run Tests/GoldenModelTests/Models/*.json --quiet - name: MCP modeling workflows over stdio run: python3 -m unittest discover -s Tests/IntegrationTests -v + - name: Packaging script regressions (BSD find) + run: python3 -m unittest discover -s Tests/PackagingTests -v - name: Build app (Metal + SwiftUI) if: always() run: swift build --product ForgeApp diff --git a/Tests/PackagingTests/test_fetch_occt_windows.py b/Tests/PackagingTests/test_fetch_occt_windows.py index a5e4e24..1bc5579 100644 --- a/Tests/PackagingTests/test_fetch_occt_windows.py +++ b/Tests/PackagingTests/test_fetch_occt_windows.py @@ -31,6 +31,9 @@ def setUp(self): if not os.environ.get('NO_LIBRARY'): z.writestr('install/lib/TKernel.lib', 'fixture') z.writestr('install/bin/TKernel.dll', 'fixture') + for excluded in ['qt-6/bin/QtCore.dll', 'debug/Debug.dll', + 'plugins/plugin.dll', 'msvc-vc14-64/bin/msvcp140.dll']: + z.writestr('install/' + excluded, 'excluded fixture') ''') def stub(self, name, body): @@ -70,6 +73,8 @@ def test_environment_quotes_paths_and_cache_can_be_reused(self): prefix, path = result.stdout.split('\n', 1) self.assertEqual(prefix, str(self.dest / 'occt/install')) self.assertEqual(path.split(':')[0], str(self.dest / 'occt/install/bin')) + # Excluded DLL directories must not alter PATH; preserve every original entry. + self.assertEqual(path.split(':')[1:], self.env['PATH'].split(':')) self.env['FAIL_DOWNLOAD'] = '1' self.assertEqual(self.fetch().returncode, 0) diff --git a/scripts/fetch-occt-windows.sh b/scripts/fetch-occt-windows.sh index 87dc09e..71036a0 100755 --- a/scripts/fetch-occt-windows.sh +++ b/scripts/fetch-occt-windows.sh @@ -60,7 +60,9 @@ prefix="$(cd "$prefix" && pwd)" # exchange through XCAF) imports: FreeImage, FreeType, FFmpeg, OpenVR. Not the bundled MSVC # runtime (msvc-vc14-64: older than the system's, it shadows it) nor the viewers' Qt, VTK or # Tcl/Tk. -dlldirs="$(find "$dest" -name '*.dll' -printf '%h\n' | sort -u | grep -Ev '/(qt|vtk|tcltk|glfw|angle|gl2ps|msvc)[^/]*(/|$)|/debug/|/plugins/' || true)" +# Batch directory extraction in POSIX sh: BSD find has no GNU -printf, while +# passing filenames as arguments preserves spaces and quotes on every host. +dlldirs="$(find "$dest" -name '*.dll' -exec sh -c 'for dll do printf "%s\n" "${dll%/*}"; done' sh {} + | sort -u | grep -Ev '/(qt|vtk|tcltk|glfw|angle|gl2ps|msvc)[^/]*(/|$)|/(debug|plugins)(/|$)' || true)" { printf 'export FORGE_OCCT_PREFIX=%q\n' "$(cygpath -m "$prefix")"