Skip to content

Commit

Permalink
Refactor repo into Cargo workspace with scaffolding for Rust-based qu…
Browse files Browse the repository at this point in the history
…eries (#31)

## What Changed?

The repository has become a Cargo workspace. The new `crates` directory
contains:
- `dfpp`: PDG generation, same as before
- `dfpp-explorer`: the `dfpp/explorer` directory factored into a
standalone crate
- `dfgraph`: the core `ProgramDescription` type emitted by `dfpp`
- `dfcheck`: the runtime for property checkers

I also added a `props` directory at the root which contains sample
implementations of properties for Websubmit and Lemmy.

## Why Does It Need To?

To separate out the different concerns, and to ensure that third-party
property checkers don't need to include every `dfpp` transitive
dependency.

## Checklist

- [x] Above description has been filled out so that upon quash merge we
have a
  good record of what changed.
- [ ] New functions, methods, types are documented. Old documentation is
updated
  if necessary
- The new `dfcheck` and `dfcheck-cli` crates are not documented because
their structure is highly tentative.
- [ ] Documentation in Notion has been updated
  - Not sure where to update with this information?
- [ ] Tests for new behaviors are provided
- Need to add some tests that run the `dfcheck-cli` tool on the sample
properties.
- [ ] Refactor rustc serializers to just wholesale convert from rustc
types to ProgramDescription before any serialization happens
  • Loading branch information
willcrichton authored Sep 14, 2023
1 parent 722f543 commit f4560a4
Show file tree
Hide file tree
Showing 119 changed files with 3,926 additions and 1,808 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
run: cargo build --verbose
- name: Run tests
run: |
cargo test --test non_transitive_graph_tests
cargo test --test call_chain_analysis_tests
cargo test --test control_flow_tests
cargo test --test new_alias_analysis_tests
cargo test --test async_tests
cargo test --test inline_elision_tests
cargo test -p dfpp --test non_transitive_graph_tests
cargo test -p dfpp --test call_chain_analysis_tests
cargo test -p dfpp --test control_flow_tests
cargo test -p dfpp --test new_alias_analysis_tests
cargo test -p dfpp --test async_tests
cargo test -p dfpp --test inline_elision_tests
intergration-tests:
name: Integration Tests
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
cd forge
raco pkg install --auto || raco setup forge
- name: Run Tests
run: cargo test --test external_annotation_tests
run: cargo test -p dfpp --test external_annotation_tests

format-check:
name: Format Control
Expand All @@ -91,8 +91,11 @@ jobs:
with:
path: ~/.rustup
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain.toml') }}
- name: Perform Check
- name: Check main repo
run: cargo fmt --check
- name: Check properties
run: cargo fmt --check
working-directory: props

linting:
name: Clippy
Expand All @@ -116,3 +119,6 @@ jobs:
key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Here come the complaints
run: cargo clippy --all -- -D warnings
- name: Complaints about properties
run: cargo clippy --all -- -D warnings
working-directory: props
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/target/
target/


/rust-dfpp-patch
Expand All @@ -7,4 +7,9 @@ flow-graph.json
# Local cargo configuration
.cargo/config.toml
*.eqs
*.info.json
*.info.json

props/Cargo.lock

# Delete this if we want to include a rustfmt configuration
.rustfmt.toml
Loading

0 comments on commit f4560a4

Please sign in to comment.