Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
pull_request:
workflow_dispatch:

# Cancel PR actions on new commits
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

env:
# For setup-rust, see https://github.com/moonrepo/setup-rust/issues/22
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -93,6 +98,15 @@ jobs:
glam-version: =0.30.7
# after, glam >0.30.8
- rust-gpu-version: e767f24f2565baf1a71bbaf84d453d181cab2417

# rustc 1.94.0 destabilised json target specs, requiring `-Ztarget-spec-json`
# see https://github.com/Rust-GPU/rust-gpu/pull/545
# see https://github.com/rust-lang/rust/pull/150151
# before
- rust-gpu-version: 30896871ba00e668029ccb724f1438202b284708
# after
# TODO: PRELIMINARY
- rust-gpu-version: 12762d769f7310ab88f09026ced29e4a3c4f1858
runs-on: ubuntu-latest
env:
RUST_LOG: debug
Expand Down
28 changes: 26 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ keywords = ["gpu", "compiler", "rust-gpu"]
license = "MIT OR Apache-2.0"

[workspace.dependencies]
spirv-builder = { git = "https://github.com/Rust-GPU/rust-gpu", rev = "6a67e7b5954f37989ad540a555b5d6969073592e", default-features = false }
spirv-builder = { git = "https://github.com/Rust-GPU/rust-gpu", rev = "12762d769f7310ab88f09026ced29e4a3c4f1858", default-features = false }
cargo-gpu-install = { path = "./crates/cargo-gpu-install" }
anyhow = "1.0.98"
clap = { version = "4.5.41", features = ["derive"] }
Expand All @@ -42,6 +42,8 @@ cargo_metadata = "0.21.0"
cargo-util-schemas = "0.8.2"
semver = "1.0.26"
dunce = "1.0.5"
expect-test = "1.5.1"
regex-lite = "0.1.9"



Expand Down
1 change: 1 addition & 0 deletions crates/cargo-gpu-install/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tempfile = { workspace = true, optional = true }
test-log.workspace = true
cargo_metadata = { workspace = true, features = ["builder"] }
cargo-util-schemas = "0.8.2"
expect-test = "1.5.1"

[lints]
workspace = true
28 changes: 14 additions & 14 deletions crates/cargo-gpu-install/src/spirv_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,24 +267,18 @@ mod test {
use crate::test::TestEnv;
use cargo_metadata::{PackageBuilder, PackageId, Source};
use cargo_util_schemas::manifest::PackageName;
use expect_test::expect;

#[test_log::test]
fn parsing_spirv_std_dep_for_shader_template() {
let shader_template_path = crate::test::shader_crate_template_path();
let source = SpirvSource::get_rust_gpu_deps_from_shader(&shader_template_path).unwrap();
assert_eq!(
source,
SpirvSource::Git {
url: "https://github.com/Rust-GPU/rust-gpu".to_owned(),
rev: "6a67e7b5954f37989ad540a555b5d6969073592e".to_owned()
}
);
}

#[test_log::test]
fn path_sanity() {
let path = std::path::PathBuf::from("./");
assert!(path.is_relative());
expect![[r#"
Git {
url: "https://github.com/Rust-GPU/rust-gpu",
rev: "12762d769f7310ab88f09026ced29e4a3c4f1858",
}"#]]
.assert_eq(&format!("{source:#?}"));
}

#[test_log::test]
Expand All @@ -299,7 +293,13 @@ mod test {
.to_str()
.map(std::string::ToString::to_string)
.unwrap();
assert_eq!("https___github_com_Rust-GPU_rust-gpu+6a67e7b5", &name);
expect!["https___github_com_Rust-GPU_rust-gpu+12762d76"].assert_eq(&name);
}

#[test_log::test]
fn path_sanity() {
let path = std::path::PathBuf::from("./");
assert!(path.is_relative());
}

#[test_log::test]
Expand Down
6 changes: 3 additions & 3 deletions crates/shader-crate-template/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/shader-crate-template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ unexpected_cfgs = { level = "allow", check-cfg = ['cfg(target_arch, values("spir
# Dependencies for CPU and GPU code
[dependencies]
# TODO: use a simple crate version once v0.10.0 is released
spirv-std = { git = "https://github.com/Rust-GPU/rust-gpu", rev = "6a67e7b5954f37989ad540a555b5d6969073592e" }
spirv-std = { git = "https://github.com/Rust-GPU/rust-gpu", rev = "12762d769f7310ab88f09026ced29e4a3c4f1858" }
glam = { version = "0.30.8", default-features = false }

[package.metadata.rust-gpu.build]
Expand Down
1 change: 1 addition & 0 deletions crates/xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env_logger.workspace = true
log.workspace = true
tempfile.workspace = true
toml.workspace = true
regex-lite.workspace = true

[lints]
workspace = true
Loading
Loading