Skip to content

Commit

Permalink
Update CaDiCaL to work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed Jun 25, 2024
1 parent 190676a commit 7ce2cb0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 39 deletions.
50 changes: 13 additions & 37 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,11 @@ env:
RUST_FMT_CHANNEL: nightly

jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# crate: []
# steps:
# - uses: actions/checkout@v3
# - name: Install Rust toolchain
# run: |
# rustup toolchain install --profile minimal --no-self-update ${{ env.RUST_CHANNEL }}
# rustup default ${{ env.RUST_CHANNEL }}
# - name: Cache dependencies
# uses: Swatinem/rust-cache@v2
# - name: Build ${{ matrix.crate }}
# run: cargo install --root dist/ --path crates/${{ matrix.crate }}
# - name: Upload build artifact
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.crate }}-${{ matrix.os }}
# path: dist/
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -43,10 +26,14 @@ jobs:
run: |
rustup toolchain install --profile minimal --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.5
- name: Run cargo test
run: cargo test --features splr,cadical,kissat,intel-sat,ipasir-up
if: matrix.os == 'ubuntu-latest'
- name: Run cargo test
run: cargo test --all-features
run: cargo test -p pindakaas --features splr,cadical,ipasir-up
if: matrix.os == 'windows-latest'
clippy:
runs-on: ubuntu-latest
steps:
Expand All @@ -57,8 +44,8 @@ jobs:
run: |
rustup toolchain install --profile minimal --component clippy --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.5
- name: Run clippy
run: cargo clippy --tests --features splr,cadical,kissat,intel-sat,ipasir-up -- -D warnings
format:
Expand All @@ -73,14 +60,3 @@ jobs:
rustup default ${{ env.RUST_CHANNEL }}
- name: Run cargo format
run: cargo +nightly fmt --all --check
# TODO: Re-enable after first release
# semver:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: Check semver
# uses: obi1kenobi/cargo-semver-checks-action@v2
# with:
# crate-name: pindakaas
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "crates/pindakaas-cadical/vendor/cadical"]
path = crates/pindakaas-cadical/vendor/cadical
url = https://github.com/arminbiere/cadical.git
url = https://github.com/pindakaashq/cadical.git
branch = track/pindakaas
[submodule "crates/pindakaas-intel-sat/vendor/intel_sat"]
path = crates/pindakaas-intel-sat/vendor/intel_sat
url = https://github.com/alexander-nadel/intel_sat_solver.git
Expand Down
6 changes: 6 additions & 0 deletions crates/pindakaas-cadical/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::path::Path;

fn main() {
let src = [
"src/ccadical_override.cpp",
Expand Down Expand Up @@ -94,6 +96,10 @@ fn main() {
.define("NTRACING", None)
.define("QUIET", None);

if build.get_compiler().is_like_msvc() {
build.include(Path::new("vendor/cadical/contrib/msvc"));
}

assert_eq!(
env!("CARGO_PKG_VERSION"),
include_str!("vendor/cadical/VERSION").trim()
Expand Down
2 changes: 1 addition & 1 deletion crates/pindakaas-cadical/vendor/cadical
2 changes: 2 additions & 0 deletions crates/pindakaas-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::manual_unwrap_or_default)] // TODO: Remove this when fixed in darling

use darling::FromDeriveInput;
use proc_macro::TokenStream;
use quote::{format_ident, quote};
Expand Down

0 comments on commit 7ce2cb0

Please sign in to comment.