Skip to content

Rust Cache warnings for tests with more than one feature enabled #43

@frazar

Description

@frazar

Looking at this CI log

Warning:  ValidationError: Key Validation Error: v0-rust-1.56.1-i686-unknown-linux-gnu-alloc,simd--build_test-a732c1bed0bf174cd2e9b37132d29ed1815eb7cd-df69c652838aa8f1d3f759765b37bdf011baf599 cannot contain commas.
    at checkKey (/home/runner/work/_actions/Swatinem/rust-cache/v2.0.0/dist/restore/index.js:58:15)
    at Object.<anonymous> (/home/runner/work/_actions/Swatinem/rust-cache/v2.0.0/dist/restore/index.js:90:13)
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/Swatinem/rust-cache/v2.0.0/dist/restore/index.js:15:71
    at new Promise (<anonymous>)
    at __webpack_modules__.7799.__awaiter (/home/runner/work/_actions/Swatinem/rust-cache/v2.0.0/dist/restore/index.js:11:12)
    at Object.restoreCache (/home/runner/work/_actions/Swatinem/rust-cache/v2.0.0/dist/restore/index.js:80:12)
    at run (/home/runner/work/_actions/Swatinem/rust-cache/v2.0.0/dist/restore/index.js:62066:40)

it seems like Rust Cache does not like commas in keys.

This occurs because keys defined as

key: "${{ matrix.channel }}-${{ matrix.target }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }}"

and they end up containing commas when ${{ matrix.features }} expands to two or more features, like "alloc,simd,simd-nightly".

Maybe the key definition should be changed to a comma-less verison. Also, a way to turn RustCache warnings into hard errors should be considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions