Closed Ravenwater closed 1 year ago
Well, this is kind of a bug.
The issue here is that the cache action fails because some symlinks can't be created. This is why I use 7zip to unpack the files but @actions/cache
doesn't. So this basically comes from windows being garbage and not being able to handle symlinks properly which is a shame.
I'll look into changing this, maybe there's a way to fix this, either by changing the unpack command for the cache or by manually removing all symlinks from the cached files.
But basically, to fix this, just disable caching on windows runners as it won't do anything anyways:
- name: Install boost
uses: MarkusJx/install-boost@v2.4.1
id: install-boost
with:
boost_version: 1.73.0
platform_version: 2019
toolset: msvc
cache: false
can I keep the caching for mac and ubuntu by adding the caching flag to the toolset?
something like this:
jobs:
build:
name: "Run for ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
#os: [ windows-latest, macos-latest, ubuntu-latest ]
include:
- os: windows-latest
toolset: msvc
version: 2022
cache: false
- os: ubuntu-22.04 # need to set explicity os version
toolset: gcc
version: 22.04 # the reason why you need to set os version
- os: macos-11
toolset: clang
version: 11
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install BOOST
uses: MarkusJx/install-boost@v2.4.3
id: install-boost
with:
boost_version: 1.79.0
platform_version: ${{matrix.version}}
toolset: ${{matrix.toolset}} # cache flag comes from toolset <----- is this feasible?
An easy option would be just to test against the os version:
- name: Install boost
uses: MarkusJx/install-boost@v2.4.1
id: install-boost
with:
boost_version: 1.73.0
platform_version: ${{matrix.version}}
toolset: ${{matrix.toolset}}
cache: ${{matrix.os == 'windows-latest'}}
or, using the runner context (probably the better option as it is more generic)
- name: Install boost
uses: MarkusJx/install-boost@v2.4.1
id: install-boost
with:
boost_version: 1.73.0
platform_version: ${{matrix.version}}
toolset: ${{matrix.toolset}}
cache: ${{runner.os == 'Windows'}}
But I don't know if this actually works, you'd have to test this.
The whole issue seems to be related to https://github.com/actions/cache/issues/1043, an update to the @actions/cache
dependency may fix all of this.
As I currently don't have a lot of time, I'll look into this a little further once my schedule allows.
@MarkusJx the runner.os check did not appear to work:
the brute force cache flag does work:
There is an error reported in the Action that looks like a tar symlink failure on Windows targets:
The install-boost action log details
The Action succeeds and the build and test phases finish successfully, so this is just a user report, not a bug report.