Skip to content

Commit f547c6f

Browse files
authored
Merge pull request #1445 from murraystevenson/macCI
Mac CI
2 parents cdf6a7a + 39dd46b commit f547c6f

File tree

7 files changed

+31
-33
lines changed

7 files changed

+31
-33
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ jobs:
3333
linux-gcc11,
3434
linux-debug-gcc11,
3535
windows,
36-
windows-debug
36+
windows-debug,
37+
macos-arm64
3738
]
3839

3940
include:
@@ -46,6 +47,7 @@ jobs:
4647
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/8.0.1/gafferDependencies-8.0.1-linux-gcc11.tar.gz
4748
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
4849
publish: true
50+
jobs: 4
4951

5052
- name: linux-debug-gcc11
5153
os: ubuntu-20.04
@@ -55,6 +57,7 @@ jobs:
5557
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/8.0.1/gafferDependencies-8.0.1-linux-gcc11.tar.gz
5658
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
5759
publish: false
60+
jobs: 4
5861

5962
- name: windows
6063
os: windows-2019
@@ -63,6 +66,7 @@ jobs:
6366
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/8.0.1/gafferDependencies-8.0.1-windows.zip
6467
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
6568
publish: true
69+
jobs: 4
6670

6771
- name: windows-debug
6872
os: windows-2019
@@ -71,6 +75,16 @@ jobs:
7175
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/8.0.1/gafferDependencies-8.0.1-windows.zip
7276
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
7377
publish: false
78+
jobs: 4
79+
80+
- name: macos-arm64
81+
os: macos-14
82+
buildType: RELEASE
83+
options: .github/workflows/main/options.posix
84+
dependenciesURL: https://github.com/GafferHQ/dependencies/releases/download/9.0.0/gafferDependencies-9.0.0-macos-arm64.tar.gz
85+
tests: testCore testCorePython testScene testImage testAlembic testUSD testVDB
86+
publish: true
87+
jobs: 3
7488

7589
runs-on: ${{ matrix.os }}
7690

@@ -92,16 +106,8 @@ jobs:
92106
if: runner.os == 'Windows'
93107

94108
- name: Install toolchain (MacOS)
95-
# Prefer `pip install` because it is faster
96-
# than `brew install`.
97109
run: |
98-
sudo pip3 install scons==4.0.1
99-
# Brew installs all manner of headers into `/usr/local/include`, including
100-
# OpenEXR and Imath versions that conflict with our own. We can't stop Clang
101-
# finding them because Clang is hardcoded to look in `/usr/local/include`
102-
# _before_ anything we specify with `-isystem`, despite documentation to the
103-
# contrary. So we nuke the headers.
104-
rm -rf /usr/local/include/*
110+
pipx install scons==4.6.0
105111
echo PACKAGE_COMMAND=tar -czf >> $GITHUB_ENV
106112
echo PACKAGE_EXTENSION=tar.gz >> $GITHUB_ENV
107113
if: runner.os == 'macOS'
@@ -154,7 +160,7 @@ jobs:
154160
155161
- name: Build
156162
run: |
157-
scons -j 4 BUILD_TYPE=${{ matrix.buildType }} OPTIONS=${{ matrix.options }} BUILD_CACHEDIR=sconsCache
163+
scons -j ${{ matrix.jobs }} BUILD_TYPE=${{ matrix.buildType }} OPTIONS=${{ matrix.options }} BUILD_CACHEDIR=sconsCache
158164
# Copy the config log for use in the "Debug Failures" step, because it
159165
# gets clobbered by the `scons test*` call below.
160166
cp config.log buildConfig.log

SConstruct

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,14 @@ if env["PLATFORM"] != "win32" :
10891089
# deprecation of gluBuild2DMipmaps() in OSX 10.9.
10901090
if osxVersion[0] == 10 and osxVersion[1] > 7 :
10911091
env.Append( CXXFLAGS = [ "-Wno-unused-local-typedef", "-Wno-deprecated-declarations" ] )
1092+
clangVersion = subprocess.check_output( [ env["CXX"], "-dumpversion" ], env=env["ENV"], universal_newlines=True ).strip()
1093+
clangVersion = [ int( v ) for v in clangVersion.split( "." ) ]
1094+
# Work around Boost issues with Xcode 15 where `std::unary_function` has been removed.
1095+
if clangVersion >= [ 15, 0, 0 ] :
1096+
env.Append( CXXFLAGS = [ "-DBOOST_NO_CXX98_FUNCTION_BASE", "-D_HAS_AUTO_PTR_ETC=0" ] )
1097+
# Disable FMA on arm64 builds to limit floating point discrepancies with x86_64 builds.
1098+
if platform.machine() == "arm64" :
1099+
env.Append( CXXFLAGS = [ "-ffp-contract=off" ] )
10921100

10931101
elif env["PLATFORM"]=="posix" :
10941102
if "g++" in os.path.basename( env["CXX"] ) and not "clang++" in os.path.basename( env["CXX"] ) :
@@ -1304,11 +1312,11 @@ if doConfigure :
13041312
Exit( 1 )
13051313

13061314
for line in open( str( boostVersionHeader ) ) :
1307-
m = re.compile( "^#define BOOST_LIB_VERSION \"(.*)\"\s*$" ).match( line )
1315+
m = re.compile( r"^#define BOOST_LIB_VERSION \"(.*)\"\s*$" ).match( line )
13081316
if m :
13091317
boostVersion = m.group( 1 )
13101318
if boostVersion :
1311-
m = re.compile( "^([0-9]+)_([0-9]+)(?:_([0-9]+)|)$" ).match( boostVersion )
1319+
m = re.compile( r"^([0-9]+)_([0-9]+)(?:_([0-9]+)|)$" ).match( boostVersion )
13121320
boostMajorVersion, boostMinorVersion, boostPatchVersion = m.group( 1, 2, 3 )
13131321
env["BOOST_MAJOR_VERSION"] = boostMajorVersion
13141322
env["BOOST_MINOR_VERSION"] = boostMinorVersion
@@ -1494,9 +1502,6 @@ pythonModuleEnv = pythonEnv.Clone()
14941502
pythonModuleEnv["SHLIBPREFIX"] = ""
14951503
pythonModuleEnv["SHLIBSUFFIX"] = ".so" if env["PLATFORM"] != "win32" else ".pyd"
14961504

1497-
if pythonModuleEnv["PLATFORM"]=="darwin" :
1498-
pythonModuleEnv.Append( SHLINKFLAGS = "-single_module" )
1499-
15001505
###########################################################################################
15011506
# An environment for running tests
15021507
###########################################################################################
@@ -1940,9 +1945,7 @@ if doConfigure :
19401945
imagePythonModuleEnv.Append( **imageEnvPrepends )
19411946
imagePythonModuleEnv.Append(
19421947
LIBS = [
1943-
os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ),
19441948
os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ),
1945-
os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ),
19461949
]
19471950
)
19481951
imagePythonModule = imagePythonModuleEnv.SharedLibrary( "python/IECoreImage/_IECoreImage", imagePythonSources + imagePythonModuleSources )
@@ -2277,9 +2280,7 @@ if env["WITH_GL"] and doConfigure :
22772280
glPythonModuleEnv.Append( **glEnvAppends )
22782281
glPythonModuleEnv.Append(
22792282
LIBS = [
2280-
os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ),
22812283
os.path.basename( glEnv.subst( "$INSTALL_LIB_NAME" ) ),
2282-
os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ),
22832284
os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ),
22842285
os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ),
22852286
]

contrib/IECoreUSD/test/IECoreUSD/SceneCacheFileFormatTest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import IECoreScene
4848
import IECoreUSD
4949

50-
@unittest.skipIf( sys.platform == 'darwin', "plugInfo.json fails to register on GitHub Actions Macos container." )
5150
class SceneCacheFileFormatTest( unittest.TestCase ) :
5251

5352
def setUp( self ) :

include/IECore/MatrixInterpolator.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct CubicInterpolator< Imath::Matrix44< T > >
130130

131131
Imath::Vec3<T> s0( 1 ), s1( 1 ), s2( 1 ), s3( 1 ), sx( 1 );
132132
Imath::Vec3<T> h0( 0 ), h1( 0 ), h2( 0 ), h3( 0 ), hx( 0 );
133-
Imath::Vec3<T> r0( 0 ), r1( 0 ), r2( 0 ), r3( 0 ), rx( 0 );
133+
Imath::Vec3<T> r0( 0 ), r1( 0 ), r2( 0 ), r3( 0 );
134134
Imath::Vec3<T> t0( 0 ), t1( 0 ), t2( 0 ), t3( 0 ), tx( 0 );
135135

136136
extractSHRT(y0, s0, h0, r0, t0);

test/IECore/InterpolatorTest.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ void MatrixCubicInterpolatorTest<T>::testSimple()
429429
CubicInterpolator< Matrix > interp;
430430
CubicInterpolator< Vector > vectorInterp;
431431

432-
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), r0( 0, 0, 0 ), t0( 5, 0, 0 );
432+
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), t0( 5, 0, 0 );
433433
Vector s1( 1, 2, 3 ), h1( 1, 2, 3 ), r1( 0, 1, 0 ), t1( 10, 0, 0 );
434434
Vector s2( 0.5, 1.4, 5 ), h2( 2, 3, 4 ), r2( 0, 0.5, 0 ), t2( 20, 0, 0 );
435435
Vector s3( 1, 2, 3 ), h3( 1, 2, 3 ), r3( 0, 1, 0 ), t3( 0, 0, 0 );
@@ -492,7 +492,7 @@ void MatrixCubicInterpolatorTest<T>::testTyped()
492492
CubicInterpolator< MatrixData > interp;
493493
CubicInterpolator< Vector > vectorInterp;
494494

495-
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), r0( 0, 0, 0 ), t0( 5, 0, 0 );
495+
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), t0( 5, 0, 0 );
496496
Vector s1( 1, 2, 3 ), h1( 1, 2, 3 ), r1( 0, 1, 0 ), t1( 10, 0, 0 );
497497
Vector s2( 0.5, 1.4, 5 ), h2( 2, 3, 4 ), r2( 0, 0.5, 0 ), t2( 20, 0, 0 );
498498
Vector s3( 1, 2, 3 ), h3( 1, 2, 3 ), r3( 0, 1, 0 ), t3( 0, 0, 0 );

test/IECoreScene/MeshAlgoDistributePointsTest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,6 @@ def setUp( self ) :
544544

545545
os.environ["CORTEX_POINTDISTRIBUTION_TILESET"] = os.path.join( "test", "IECore", "data", "pointDistributions", "pointDistributionTileSet2048.dat" )
546546

547-
if sys.platform == "darwin" :
548-
549-
# These fail because MacOS uses libc++, and libc++ has a
550-
# different `std::random_shuffle()` than libstdc++.
551-
552-
MeshAlgoDistributePointsTest.testDensityMaskPrimVar = unittest.expectedFailure( MeshAlgoDistributePointsTest.testDensityMaskPrimVar )
553-
MeshAlgoDistributePointsTest.testDistanceBetweenPoints = unittest.expectedFailure( MeshAlgoDistributePointsTest.testDistanceBetweenPoints )
554-
555547
if __name__ == "__main__":
556548
unittest.main()
557549

test/IECoreScene/MeshPrimitive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def testBox( self ) :
266266
self.assertEqual( len( m["N"].data ), 6 )
267267
self.assertEqual( len( m["uv"].indices ), m.variableSize( IECoreScene.PrimitiveVariable.Interpolation.FaceVarying ) )
268268

269-
269+
@unittest.skipIf( IECore.TestUtil.inMacCI(), "Incorrect pointAtUV results on virtualized macOS used in CI" )
270270
def testPlane( self ) :
271271

272272
m = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( 0 ), imath.V2f( 1 ) ) )

0 commit comments

Comments
 (0)