Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zgrannan committed Nov 30, 2023
1 parent c106612 commit f078a7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 39 deletions.
6 changes: 0 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@ bindeps = true

[registries.crates-io]
protocol = "sparse"

[build.'cfg(all(windows, target_arch="x86_64", target_env="msvc"))']
target = "x86_64-pc-windows-msvc"

[test.'cfg(all(windows, target_arch="x86_64", target_env="msvc"))']
target = "x86_64-pc-windows-msvc"
40 changes: 8 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
PRUSTI_CACHE_PATH: ${{ github.workspace }}/prusti_cache.bin
COMPILATION_TARGET_PRUSTI: ${{ matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || '' }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -232,8 +233,6 @@ jobs:
distribution: 'zulu'
- name: Set up the environment
run: python x.py setup
- name: Print cfg
run: rustc --print=cfg
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -252,39 +251,16 @@ jobs:
key: ${{ env.VER_CACHE_KEY_UNIQUE }}
# Restore from the most recent cache that matches a shared prefix of the key
restore-keys: ${{ env.VER_CACHE_KEY_SHARED }}
- name: Build with cargo (Windows)
if: matrix.os == 'windows-latest'
run: python x.py build --all --jobs 1
shell: powershell

- name: Build with cargo (Non-Windows)
if: matrix.os != 'windows-latest'
run: python x.py build --all --jobs 1

- name: Run cargo tests (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:COMPILATION_TARGET_PRUSTI="x86_64-pc-windows-msvc"
python x.py test --all
shell: powershell

- name: Run cargo tests (Non-Windows)
if: matrix.os != 'windows-latest'
run: python x.py test --all
- name: Build with cargo
run: python x.py build --all --jobs 1 ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }}

- name: Run a subset of tests with Carbon (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:COMPILATION_TARGET_PRUSTI="x86_64-pc-windows-msvc"
python x.py test pass/no-annotation --all --verbose
shell: powershell
env:
PRUSTI_VIPER_BACKEND: carbon
- name: Run cargo tests
run: python x.py test --all ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }}

- name: Run a subset of tests with Carbon (Non-Windows)
if: matrix.os != 'windows-latest'
- name: Run a subset of tests with Carbon
run: |
python x.py test pass/no-annotation --all --verbose
python x.py test pass/no-annotation --all --verbose ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }}
env:
PRUSTI_VIPER_BACKEND: carbon
- name: Check prusti-contracts
Expand Down Expand Up @@ -325,7 +301,7 @@ jobs:
run: python x.py setup

- name: Build with cargo --release
run: python x.py build --release
run: python x.py build --release ${{ matrix.os == 'windows-latest' && '--target x86_64-pc-windows-msvc' || '' }}

# Run Prusti on itself.
# Disabled because of a bug when compiling jni-gen
Expand Down
4 changes: 3 additions & 1 deletion prusti-utils/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ pub fn find_compiled_executable(name: &str) -> PathBuf {
// For CI, however this is presumably also relevant for anyone
// wishing to run tests for cross-compiled prusti
if let Ok(triple) = env::var("COMPILATION_TARGET_PRUSTI") {
target_path.push(triple);
if !triple.is_empty() {
target_path.push(triple);
}
}

target_path.push(target_directory);
Expand Down

0 comments on commit f078a7f

Please sign in to comment.