-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ccache windows dynamic build (#1077)
* Configure ccache exe for Visual Studio generator through env var * add info on Windows ccache to README * Determine ccache version automatically * cmake indentation * remove outdated comment
- Loading branch information
Showing
5 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -420,12 +420,6 @@ jobs: | |
build_test_pytket_windows: | ||
name: Build and test pytket (windows) | ||
# I could not get ccache working for this build | ||
# Building tket as a dynamic library currently fails with the Ninja and Makefiles Generators and ccache is set up is more difficult with the Visual Studio generator | ||
# I tried to get ccache working with the Visual Studio generator using the suggestions here: https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake | ||
# I was able to get ccache to wrap the compiler invocations, but all files are reported as uncacheable, due to "No input file" | ||
# See https://ccache.dev/manual/4.8.2.html#_cache_statistics for more info on what that means. I myself haven't fully understood. | ||
# Giving up for now | ||
needs: check_changes | ||
if: needs.check_changes.outputs.tket_or_workflow_changed == 'true' || needs.check_changes.outputs.pytket_or_workflow_changed == 'true' | ||
runs-on: windows-2022 | ||
|
@@ -452,10 +446,43 @@ jobs: | |
$normalized_file = [IO.File]::ReadAllText($f) -replace "`r`n", "`n" | ||
[IO.File]::WriteAllText($f, $normalized_file) | ||
} | ||
- name: ccache setup | ||
# This is what hendrikmuhs/ccache-action does, but for windows (theirs is buggy on windows) | ||
id: ccache-setup | ||
run: | | ||
choco upgrade ccache | ||
$ccache_dir = ccache --get-config cache_dir | ||
echo ccache_dir=$ccache_dir >> $env:GITHUB_OUTPUT | ||
ccache --set-config=max_size='500M' | ||
ccache --set-config=compression=true | ||
ccache --set-config compiler_check=content | ||
ccache --set-config namespace=WITH_TESTS | ||
ccache -p | ||
- name: Get current time | ||
uses: josStorer/[email protected] | ||
id: current_time | ||
with: | ||
format: YYYYMMDDHHmmss | ||
- name: ccache windows | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.ccache-setup.outputs.ccache_dir }} | ||
key: tket-dynamic-visual-studio-windows-2022-${{ steps.current_time.outputs.formattedTime }} | ||
restore-keys: | | ||
tket-dynamic-visual-studio-windows-2022 | ||
- name: get ccache version | ||
id: ccache-ver | ||
shell: bash | ||
run: | | ||
ccache_ver=$(choco list -e ccache | grep "ccache" | grep -ioE '[0-9]+\.[0-9]+\.[0-9]+') | ||
echo "Found ccache version ${ccache_ver}" | ||
echo "ccache_ver=${ccache_ver}" >> $GITHUB_OUTPUT | ||
- name: Build tket | ||
if: needs.check_changes.outputs.tket_changed == 'true' | ||
run: | | ||
conan create tket --user tket --channel stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf `"`" | ||
$env:TKET_VSGEN_CCACHE_EXE = 'C:\\ProgramData\\chocolatey\\lib\\ccache\\tools\\ccache-${{ steps.ccache-ver.outputs.ccache_ver }}-windows-x86_64\\ccache.exe' | ||
conan build tket --user tket --channel stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True | ||
conan export-pkg tket --user tket --channel stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf `"`" | ||
- name: Install tket | ||
if: needs.check_changes.outputs.tket_changed != 'true' | ||
run: conan install --requires tket/${{ needs.check_changes.outputs.tket_ver }}@tket/stable -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True | ||
|
@@ -500,6 +527,10 @@ jobs: | |
run: | | ||
conan remote login -p ${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }} tket-libs ${{ secrets.JFROG_ARTIFACTORY_USER_3 }} | ||
conan upload tket/${{ needs.check_changes.outputs.tket_ver }}@tket/stable -r=tket-libs | ||
- name: ccache stats | ||
run: | | ||
ccache -s #show stats | ||
ccache -z #show stats | ||
publish_pytket_coverage: | ||
name: Publish pytket coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters