Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into array_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Scott committed Oct 3, 2024
2 parents 77420aa + 82a71d5 commit 881d8d4
Show file tree
Hide file tree
Showing 568 changed files with 21,440 additions and 7,358 deletions.
52 changes: 24 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,57 +28,47 @@ jobs:
# and then use `include` to define their settings.

name: [
linux-gcc9,
linux-debug-gcc9,
linux-gcc11,
linux-debug-gcc11,
windows,
]

include:

- name: linux-gcc9
- name: linux-gcc11
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:2.1.2
containerImage: ghcr.io/gafferhq/build/build:3.0.0
# GitHub container builds run as root. This causes failures for tests that
# assert that filesystem permissions are respected, because root doesn't
# respect permissions. So we run the final test suite as a dedicated
# test user rather than as root.
testRunner: su testUser -c
sconsCacheMegabytes: 400
jobs: 4

- name: linux-debug-gcc9
- name: linux-debug-gcc11
os: ubuntu-20.04
buildType: DEBUG
publish: false
containerImage: ghcr.io/gafferhq/build/build:2.1.2
containerImage: ghcr.io/gafferhq/build/build:3.0.0
testRunner: su testUser -c
testArguments: -excludedCategories performance
# Debug builds are ludicrously big, so we must use a larger cache
# limit. In practice this compresses down to 4-500Mb.
sconsCacheMegabytes: 2500

- name: linux-gcc11
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:3.0.0
# GitHub container builds run as root. This causes failures for tests that
# assert that filesystem permissions are respected, because root doesn't
# respect permissions. So we run the final test suite as a dedicated
# test user rather than as root.
testRunner: su testUser -c
sconsCacheMegabytes: 400
jobs: 4

- name: windows
os: windows-2019
os: windows-2022
buildType: RELEASE
publish: true
containerImage:
testRunner: Invoke-Expression
testArguments: -excludedCategories performance GafferTest GafferVDBTest GafferUSDTest GafferSceneTest GafferDispatchTest GafferOSLTest GafferImageTest GafferUITest GafferImageUITest GafferSceneUITest GafferDispatchUITest GafferOSLUITest GafferUSDUITest GafferVDBUITest GafferDelightUITest GafferTractorTest GafferTractorUITest
sconsCacheMegabytes: 400
sconsCacheMegabytes: 800
jobs: 4

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

Expand All @@ -92,15 +82,16 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ilammy/msvc-dev-cmd@v1.12.1
- uses: ilammy/msvc-dev-cmd@v1.13.0
with:
sdk: 10.0.17763.0
sdk: 10.0.19041.0

- name: Install toolchain (Windows)
run: |
python -m pip install scons
python -m pip install sphinx==4.3.1 sphinx_rtd_theme==1.0.0 myst-parser==0.15.2 docutils==0.17.1 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-serializinghtml==1.1.5 sphinxcontrib-qthelp==1.0.3
Invoke-WebRequest -Uri "https://inkscape.org/gallery/item/37363/inkscape-1.2.2_2022-12-09_732a01da63-x64.exe" -OutFile "inkscape.exe"
Start-Process .\inkscape.exe /S -NoNewWindow -Wait
shell: pwsh
Expand Down Expand Up @@ -157,11 +148,13 @@ jobs:
curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/22.3.1/mesa3d-22.3.1-release-msvc.7z
& "C:\Program Files\7-Zip\7z.exe" x mesa.7z -omesa
./mesa/systemwidedeploy.cmd 1
echo "GALLIUM_DRIVER=llvmpipe" >> $env:GITHUB_ENV
Set-DisplayResolution -Width 1280 -Height 1024 -Force
shell: pwsh
if: runner.os == 'Windows'

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.GAFFER_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.containerImage }}-${{env.GAFFER_DEPENDENCIES_HASH}}-${{ matrix.buildType }}-${{ github.sha }}
Expand All @@ -170,7 +163,7 @@ jobs:
- name: Build Gaffer
run: |
scons -j 2 build BUILD_TYPE=${{ matrix.buildType }} OPTIONS=.github/workflows/main/sconsOptions
scons -j ${{ matrix.jobs }} build BUILD_TYPE=${{ matrix.buildType }} OPTIONS=.github/workflows/main/sconsOptions
env:
PYTHONUTF8: 1

Expand Down Expand Up @@ -203,7 +196,7 @@ jobs:
]
)
#Build Arnold extension
subprocess.check_call( "scons -j 2 build BUILD_TYPE=${{ matrix.buildType }} OPTIONS=.github/workflows/main/sconsOptions", shell = True )
subprocess.check_call( "scons -j ${{ matrix.jobs }} build BUILD_TYPE=${{ matrix.buildType }} OPTIONS=.github/workflows/main/sconsOptions", shell = True )
if os.name != "nt" :
# Test Arnold extension
Expand Down Expand Up @@ -235,7 +228,7 @@ jobs:
run: |
# Treats warnings-as-errors so we know about broken links
echo "::add-matcher::./.github/workflows/main/problemMatchers/sphinx.json"
scons -j 2 package BUILD_TYPE=${{ matrix.buildType }} OPTIONS=.github/workflows/main/sconsOptions
scons -j ${{ matrix.jobs }} package BUILD_TYPE=${{ matrix.buildType }} OPTIONS=.github/workflows/main/sconsOptions
echo "::remove-matcher owner=sphinx::"
env:
PYTHONUTF8: 1
Expand All @@ -248,10 +241,13 @@ jobs:
echo "::remove-matcher owner=validateRelease::"
if: matrix.publish

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ env.GAFFER_BUILD_NAME }}
path: ${{ env.GAFFER_BUILD_NAME }}.${{ env.PACKAGE_EXTENSION }}
# Using compression-level 0 avoids compressing our already compressed
# package and results in a significantly faster upload.
compression-level: 0
if: matrix.publish

- name: Publish Release
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main/installDependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

# Determine default archive URL.

defaultURL = "https://github.com/ImageEngine/cortex/releases/download/10.5.8.0/cortex-10.5.8.0-{platform}{buildEnvironment}.{extension}"
defaultURL = "https://github.com/GafferHQ/dependencies/releases/download/9.0.0a3/gafferDependencies-9.0.0a3-{platform}{buildEnvironment}.{extension}"

# Parse command line arguments.

Expand All @@ -64,8 +64,8 @@
parser.add_argument(
"--buildEnvironment",
help = "The build environment of the dependencies archive to download.",
choices = [ "gcc9", "gcc11" ],
default = os.environ.get( "GAFFER_BUILD_ENVIRONMENT", "gcc9" if sys.platform == "linux" else "" ),
choices = [ "gcc11" ],
default = os.environ.get( "GAFFER_BUILD_ENVIRONMENT", "gcc11" if sys.platform == "linux" else "" ),
)

parser.add_argument(
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/main/sconsOptions
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ if sys.platform == "win32" :
LOCATE_DEPENDENCY_PYTHONPATH=os.path.join(os.environ["GAFFER_BUILD_DIR"], "python")
GLEW_LIB_SUFFIX = "32"
INKSCAPE = "C:\\Program Files\\Inkscape\\bin\\inkscape.exe"
SPHINX = "noSphinxYet"
SPHINX = "sphinx-build.exe"
ENV_VARS_TO_IMPORT += " GALLIUM_DRIVER"
11 changes: 1 addition & 10 deletions .github/workflows/main/setBuildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,6 @@
print( "Setting $GAFFER_GITHUB_RELEASEID to '%s'" % releaseId )
f.write( 'GAFFER_GITHUB_RELEASEID=%s\n' % releaseId )

if os.name == "nt" :
packageExtension = "zip"

# \todo Remove this when docs are ready to build
print( "Setting $GAFFER_VALIDATE_EXTRA_FLAGS to '--skipDocs'" )
f.write( 'GAFFER_VALIDATE_EXTRA_FLAGS=--skipDocs\n' )

else :
packageExtension = "tar.gz"

packageExtension = "zip" if os.name == "nt" else "tar.gz"
print( "Setting $PACKAGE_EXTENSION to '%s'" %packageExtension )
f.write( 'PACKAGE_EXTENSION=%s\n' %packageExtension )
77 changes: 77 additions & 0 deletions .github/workflows/versionCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Version check
on:
pull_request:
# Add `edited` to the default types, so that the check runs again
# when the target branch changes.
types: [opened, synchronize, reopened, edited]
jobs:

check:

name: Version check
runs-on: ubuntu-20.04

steps:

# Checkout both the merge commit for the PR and the
# source branch for the PR.

- uses: actions/checkout@v4
with:
path: merge

- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: source

# Do the check.

- name: Check version
run: |
import os
import re
import sys
# Parses version number from the SConstruct file.
def version( filename ) :
versions = {}
versionRe = re.compile( r"^(gaffer.*Version.*) = (\S+)" )
with open( filename ) as sconstruct :
for line in sconstruct.readlines() :
versionMatch = versionRe.match( line )
if versionMatch :
versions[versionMatch.group( 1 )] = versionMatch.group( 2 ).strip( "'\"" )
return versions["gafferMilestoneVersion"] + "." + versions["gafferMajorVersion"]
# Check that versions match between source and target branches, to avoid
# common mistake of targeting a PR to `main` rather than a maintenance branch.
#
# > Note : We compare the source version to the merged version rather than the
# > version from the target branch itself, to allow a PR to change version number
# > if necessary. That will just be subject to the usual human review process.
mergeVersion = version( "merge/SConstruct" )
sourceVersion = version( "source/SConstruct" )
if sourceVersion != mergeVersion :
message = "Source version {} does not match target version {}. Did you choose the wrong target branch?\n".format(
sourceVersion, mergeVersion
)
sys.stderr.write( f"FAIL : {message}" )
with open( os.environ["GITHUB_STEP_SUMMARY"], "a" ) as summary :
summary.write( f"> [!CAUTION]\n> {message}" )
sys.exit( 1 )
else :
with open( os.environ["GITHUB_STEP_SUMMARY"], "a" ) as summary :
summary.write( f"> [!NOTE]\n> Targeting version {mergeVersion}" )
shell: python
Loading

0 comments on commit 881d8d4

Please sign in to comment.