Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
If:
PathMatch: crates/slang-sys/src/.*\.(cc|cpp|h|hpp)$

CompileFlags:
CompilationDatabase: None
Add:
- -std=c++20
- -I.
- -I../../../third_party/slang/include
- -I../../../third_party/slang/external
- -I../../../target/slang-sys/debug/include
- -I../../../target/slang-sys/cxx/include
- -include
- cstdlib
- -DSLANG_BOOST_SINGLE_HEADER
- -DSLANG_STATIC_DEFINE

---
If:
PathMatch: third_party/slang/.*

CompileFlags:
CompilationDatabase: target/slang-sys/debug/build
31 changes: 17 additions & 14 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Setup pinned Rust
description: Install the Rust toolchain pinned by rust-toolchain.toml.

inputs:
components:
description: Comma-separated Rust components to install.
required: false
default: ""
targets:
description: Comma-separated Rust targets to install.
required: false
Expand All @@ -19,21 +15,28 @@ outputs:
runs:
using: composite
steps:
- name: Read pinned toolchain
- name: Install pinned Rust
shell: bash
run: rustup toolchain install --no-self-update

- name: Install Rust targets
if: inputs.targets != ''
shell: bash
env:
RUST_TARGETS: ${{ inputs.targets }}
run: |
set -euo pipefail
IFS=',' read -ra targets <<< "${RUST_TARGETS}"
rustup target add "${targets[@]}"

- name: Resolve active toolchain
id: toolchain
shell: bash
run: |
set -euo pipefail
toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' "${GITHUB_WORKSPACE}/rust-toolchain.toml")"
toolchain="$(rustup show active-toolchain | awk '{ print $1 }')"
if [ -z "${toolchain}" ]; then
echo "rust-toolchain.toml does not define a toolchain channel." >&2
echo "rustup did not report an active toolchain." >&2
exit 1
fi
echo "toolchain=${toolchain}" >> "${GITHUB_OUTPUT}"

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.toolchain }}
components: ${{ inputs.components }}
targets: ${{ inputs.targets }}
5 changes: 5 additions & 0 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
CARGO_PROFILE_RELEASE_INCREMENTAL: "false"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Rust
uses: ./.github/actions/setup-rust
Expand Down Expand Up @@ -143,6 +145,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Download binary artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -182,6 +185,8 @@ jobs:
working-directory: editors/vscode
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Restore playground WASM cache
id: playground-wasm-cache
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
plan: ${{ steps.plan.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Detect changed paths
id: filter
if: github.event_name != 'workflow_dispatch'
Expand Down Expand Up @@ -67,10 +69,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: ./.github/actions/setup-rust
with:
components: clippy, rustfmt
- name: Setup sccache
uses: ./.github/actions/setup-sccache
with:
Expand Down Expand Up @@ -99,6 +101,8 @@ jobs:
matrix: ${{ fromJSON(needs.changes.outputs.plan).rust_test_matrix }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: ./.github/actions/setup-rust
- name: Setup sccache
Expand Down Expand Up @@ -126,6 +130,8 @@ jobs:
working-directory: editors/vscode
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -147,6 +153,8 @@ jobs:
working-directory: editors/vscode
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore playground WASM cache
id: playground-wasm-cache
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -221,4 +229,3 @@ jobs:
build-kind: nightly
cargo-profile: debug
vsix-profile: debug

1 change: 1 addition & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha || github.event.release.tag_name || github.ref }}
submodules: recursive

- name: Restore playground WASM cache
id: playground-wasm-cache
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Restore playground WASM cache
id: playground-wasm-cache
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third_party/slang"]
path = third_party/slang
url = https://github.com/MikePopoloski/slang.git
14 changes: 14 additions & 0 deletions crates/slang-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "slang-sys"
description = "Thin Rust bindings for the upstream slang SystemVerilog frontend"
version = "0.1.0"
edition = "2024"
license = "MIT"
build = "build.rs"

[dependencies]
cxx = { version = "1.0.124", features = ["c++20"] }

[build-dependencies]
cmake = "0.1.50"
cxx-build = "1.0.124"
Loading
Loading