Repository navigation
Fix #5711 - Full Build CI: working ccache, faster configure/build/tests, simpler workflow - #5713
Conversation
…ly instead of through symlinks actions/cache archived the ~/.ccache and ~/.conan2 symlinks rather than their /mnt contents, leaving ~200 B entries that blocked any later save. Point CCACHE_DIR/CONAN_HOME and the cache paths at /mnt directly. (Would need deleting the caches manually right now, I didn't change the key)
The conan.lock-keyed ccache got an exact hit on every run after the first, so it was never refreshed. Key it on the commit SHA for pushes and on the head ref for PRs (falling back to the current base branch tip), and save it in a separate step under always(
actions/cache only saves in its post step when the job succeeds, so a conan.lock change followed by any build/test failure lost the rebuilt dependencies. Save it explicitly after conan install (on a key miss only), after cleaning build/source/download/temp folders to keep it small
Clang embeds a timestamp in the .pch, so its content differs every build and every TU including it is a ccache miss (macOS CI: 98/2484 hits, i.e. only the non-PCH TUs)
sccache refuses to cache MSVC compiles that use precompiled headers (/Fp, /Yc), which is ~95% of them (2370/2484 non-cacheable on develop). ccache handles them. Use the same SHA / head_ref keying and separate always() save as on Linux. Also set CCACHE_COMPILERCHECK=content: the default mtime check is unreliable across fresh runner VMs.
The OpenStudio/ subfolder checkout made every hashFiles() in cache keys resolve to an empty string, so conan / external-deps / embedded-files keys never changed and those caches were frozen forever. Drop OPENSTUDIO_SOURCE and use the same layout as Linux.
… end Same as on Linux: actions/cache only saves when the job succeeds, so a conan.lock change followed by any build/test failure lost the rebuilt dependencies. macOS CI: replace hendrikmuhs/ccache-action with the same restore/save as Linux/Windows Same SHA / head_ref keying with base branch tip fallback and always() save, instead of a timestamped key saved on every run (including every PR push).
Nothing uses LaTeX: BUILD_DOCUMENTATION is OFF and the docs only need Doxygen anyway.
It imported Kitware's apt key without adding the repo and nothing installs from apt afterwards. ca-certificates is already installed in both openstudio-cmake-tools images (Dockerfile and Dockerfile_centos9).
aqtinstall is never called (Qt IFW is downloaded as a zip), and there is no Gemfile for bundler-cache to cache
GitHub-hosted Linux runners now have a single disk (actions/runner-images#13587), so /mnt is the same filesystem as / and no longer buys any space. Keep caches in $HOME (/github/home) and the swapfile in RUNNER_TEMP (bind-mounted; swapon doesn't work on the container overlayfs).
….directory and tool-existence guards CMakeLists.txt already picks up ccache as compiler launcher, CCACHE_MAXSIZE already sets the max size, and Windows set safe.directory twice. ccache, git and ninja are always installed, so the command -v / Get-Command guards only hid failures (e.g. silently building without ccache).
Downloads are negligible on a 2h build, and the external-deps key (conan.lock) never tracked the E+/Radiance versions anyway. Restoring generated embedded files into a fresh build dir is either redundant or risks stale outputs. Frees ~2.3 GB of cache quota for ccache. embedded-files-* keys use matrix.os only. CentOS and Ubuntu x64 both run on ubuntu-24.04, so they share the same key, e.g. external-deps-ubuntu-24.04-23f4...
… the one that fails/is expanded)
…oved to 26.04 (clang-format 21), which reformats code
… macOS (installers still uploaded as artifact)
The fork (tcl-tk fixup) was copied from E+'s release_mac.yml, where the build Python's stdlib gets bundled. OpenStudio bundles E+'s python_lib/libpython instead, so upstream 3.12.2 is fine here; drop the toolcache removal hack too.
BUILD_PYTHON_PIP_PACKAGE=ON compiles every SWIG python binding a second time, but nothing ever ran `ninja python_package && cd Products/python_package && python setup.py bdist_wheel` so no wheel was produced or uploaded (python_bindings.yml builds the wheels). Ubuntu x64 built in 104 min vs 63 min on ARM64 / 65 min on CentOS.
os.version isn't set when the deps are built and uploaded (jmarrec/conan-recipes upload_deps.yml) nor in python_bindings.yml, so the package IDs never matched nrel-v2 and every compiled dependency was rebuilt from source. MACOSX_DEPLOYMENT_TARGET / CMAKE_OSX_DEPLOYMENT_TARGET still set OpenStudio's own minimum macOS. readline/*:with_library=termcap is the recipe default, so it was a no-op.
… python requirements on all platforms Restore cache, install Conan, configure it (default profile with cppstd=20 / build_type for both contexts like jmarrec/conan-recipes upload_deps.yml so package IDs match nrel-v2, global.conf, nrel-v2 first), conan install, and save the cache right away on a key miss. Replaces the three diverging copies: remote order (conancenter was first on Linux), -s host-only settings, the Windows lockfile rewrite, and the CentOS glibc step (now config-install / extra-args inputs). macOS passes the same cxxflags conf as upload_deps.yml for deps built from source. Python deps: install only python/requirements.txt on all three platforms (Linux relied on the image, with pytest-xdist unpinned and jinja2 only there as a conan dependency); setuptools/wheel are only needed for the pip package, which Full Build doesn't build.
Deleting *.o / *.obj right before the job ends frees nothing useful (only artifact uploads follow and the runner is discarded), and the recursive scan of the build tree costs time, especially on Windows
conanfile.py now picks RPM instead of DEB on Red Hat-like systems, so Linux no longer passes CPACK_GENERATOR, and Windows now configures with `cmake --preset conan-release` (toolchain, Ninja, build type and CPack generators come from the preset). The DEB/RPM uploads now error if the expected installer is missing instead of silently skipping
Toolchain, Ninja, build type, testing, bindings, Python version/root (from the python running conan) and CPack generators come from the preset; on macOS the libc++ flags come from the tools.build:cxxflags conf and the deployment target from MACOSX_DEPLOYMENT_TARGET. Drop the redundant -D options and the Locate Ruby/Python steps. SYSTEM_RUBY_EXECUTABLE is still passed on macOS/Windows since ruby/test/CMakeLists.txt only searches hardcoded locations (not setup-ruby's toolcache). macOS never passed it before, so the Ruby tests were never created there.
On forks, develop pushes ran the code signing, keychain and S3/docker publish steps without the secrets and failed. Add a repository check to each of those conditions. Also limit macOS Setup Keychain to develop/master/v* tags like the apple-signing environment: the Apple secrets only exist there, so publish_to_s3 dispatches from other branches failed instead of publishing an unsigned DMG
sed -i writes its temp file in the current dir; on Windows the workspace (D:) and the Conan home (C:) are on different drives so the rename failed with "Invalid cross-device link"
… 'sort: Broken pipe' in the macOS build heartbeat
…of them, or one embed_files() call's) CMake Configure: 37.0s time ninja embedded_files: 48s
…mbed_files() call instead of one per file CreateEmbeddedSource now takes a list file (one "<infile>\t<outfile>\t<filenum>\t<embeddedname>" line per file) and processes all of them on all cores. embed_files() writes that list (only when its content changes, so re-running CMake doesn't regenerate everything) and adds a single custom command per call. - About 6600 build steps become 6 (a full build goes from ~9600 to ~2900 steps), so ninja's progress percentage and ETA reflect the real work instead of being dominated by thousands of tiny steps - About 13000 process launches fewer (CreateEmbeddedSource plus a cmake -E make_directory per file), which is slow, especially on Windows - The tool creates the output directories itself - Output is byte-identical to the previous per-file generation (checked on all 6597 files) - Changing one embedded file regenerates all the files of its embed_files() call, but they're all included in the same embedded_files.cxx, which had to be recompiled anyway. Also, worse case is a few seconds for the worst (ruby), About 2.2–2.5 s for all 6379 files on 16 cores locally.
… instead of list(GET) by index
list(GET ... ${i}) re-parses the whole list on every iteration, which made embed_files() quadratic in the number of files: ~33 s at every CMake configure for the 6379 ruby engine files (on Linux, worse on Windows). It now takes ~2.8 s, with identical output
…e uses the line number instead Original was 38s for CMake configure, previous commit was 11s, now it's down to 10s CMake Configure: 37.0s -> 10.1s time ninja embedded_files: 48s -> 2.9s
…so they can run in parallel CI: run all tests in parallel, the "sequential" ModelFixture tests no longer clash
…nd Testing/Rerun.xml for the rerun), so the rerun no longer overwrites the full results and LastTest.log/LastTestsFailed.log exist for the summary steps
…it runs for every test (one process each) and deleted the files of tests running in parallel
…pass but pass on rerun
…y sets up compilers/SWIG (macOS never did)
…(YAML anchors in the Linux job), and reuse them in the other two
…e it for macOS and Windows; Windows now runs it in bash, and macOS installs bundler in a separate step
…n test failures steps across platforms (YAML anchors), Windows now runs them in bash
…> like the others, and only download each platform's installers in its publish job (Linux was also picking up the Windows ones) In practice Linux didn't pick the windows up, because it runs while windows is still building since it's slower
…ownloads with merge-multiple like the others, and the redundant AWS_S3_BUCKET env is gone
…an-release" as in BUILDING.md (drops the unused resource monitor and the heartbeat)
…e --preset / cmake --build --preset), still through cmd /c "call conanbuild.bat && ..." via $env:ComSpec (conan's conanbuild.ps1 calls a bare 'cmd', which resolves to the MSYS2 cmd script setup-ruby puts on the PATH)
…of a hard-coded max_jobs per platform (macOS x64 was using 3 of its 4); max_jobs can still be set on a matrix entry to limit it, eg after an OOM
…ck needed for now... can readd if really needed)
The same can be demonstrated by looking at Scheduled builds (nightly) on days where nothing was pushed to develop: four nightly runs in a row built the exact same commit ( Build Step minutes only:
and whole-job minutes:
|
|
Geeeeeeeez, I'm sorry but I messed up badly, I tried to push another commit to jmarrec/develop but it went to NatLabRockies/develop, and it did accept it (I thought that would be prohibited too...)... Except now I can't revert because while a direct push to develop is ok, a FORCE push isn't allowed for me... I am quite confident in these changes though, so we could keep it that way. Or, otherwise @anchapin @tijcolem @DavidGoldwasser do you have admin rights to do a force push? and we need to request a cache allowance increase (for reference E+ has one) |

Pull request overview
The Full Build workflow had caching that mostly didn't work: every run rebuilt almost everything, so a run took 1.5 to 3.5 hours per platform. This PR makes ccache actually hit on all platforms, removes a lot of wasted work and cruft from the workflow, and fixes the tests that couldn't run in parallel.
Caching (ccache)
OpenStudio.hxx, which ~30 files include, so a new commit no longer invalidates them and every SWIG module.conan installinstead of at the end of the job.external-depsandembedded-filescaches are gone: they cost more to save and restore than they saved.Cache allowance
NOTE: Our cache limit currently is just the free 10GB, and it is not nearly enough: any PR build would evict the develop caches currently.
It is cheap to increase it to say 100GB (about 6 USD/month) and it would be a shame not to.
develop's. Raising the limit costs $0.07 / GB / month (e.g. ~$6 / month for 100 GB) , see the changelog.@DavidGoldwasser @anchapin @tijcolem if one of you can make this request please
Faster configure and build (embedded files)
embed_files()iterates withZIP_LISTSinstead oflist(GET ... i), which was quadratic: CMake configure is 3x faster (37 s → 10 s locally).embed_files()call (multi-threaded), instead of one process per file: ~6600 fewer build steps (9595 → 3005), and the ninja progress is meaningful again.embedded_filestargets (ninja embedded_files, orninja embedded_files_ruby_engine...).conanfile.pypresets, as inBUILDING.md:cmake --preset conan-releaseandcmake --build --preset conan-release. The number of jobs comes from the preset, i.e. the runner's cores (macOS x64 was using 3 of its 4).Tests
ScheduleFile,PythonPluginInstance,ChillerElectricASHRAE205...) now use a directory unique to each test.MeasureFixtureno longer wipes the shared scratch directory for every test.ctest --output-junitwritesTesting/Results.xml, andTesting/Rerun.xmlfor the rerun.[skip tests]in the commit message skips the CTest steps, for faster iteration on CI changes.Workflow cleanup
setup-conancomposite action, used by all three jobs./mntvolume, the "Wait for network stability" and "Cleanup intermediate files" steps, an unused resource monitor and the build heartbeat, redundant ccache flags...NINJA_STATUS(with a percentage, elapsed time and rate) is set once for all platforms, and.ninja_loggoes into the build-diag artifacts.OS-Installers-<platform>-<type>, like the others.Unrelated: clang-format
ubuntu-latestmoved to 26.04, whose clang-format 21 reformats code differently: the clang-format workflow is pinned to Ubuntu 24.04 (clang-format 18). The autocorrects it had already asked for are committed separately (11 files insrc/), and that commit is in.git-blame-ignore-revs.Results
Job and step durations in minutes. Before: the latest upstream
developrun, 45733967523. It's the scheduled run of a SHA that the previous night's push had already built, so it's the best case for a cache. After: jmarrec/OpenStudio 45829708891, a push todevelopwith a warm ccache.(*) Not run: GitHub couldn't acquire a macOS ARM64 runner for that run.
CTest is now the longest part of every job. About 80% of it (Windows) is the CLI tests, which each spend ~20 s in the embedded
Dir.glob. That's fixed in a separate PR, which brings the Windows CTest step from ~29 to ~9 minutes:Notes
cmd /c "call conanbuild.bat && ..."via$env:ComSpec. Conan'sconanbuild.ps1can't be used: it calls a barecmd, which resolves to the MSYS2cmdscript that setup-ruby puts on thePATH.Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)Labels:
IDDChangeAPIChangePull Request - Ready for CIso that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.