Update slang-rhi deps for gfx-unit-test#8237
Conversation
|
/format |
|
🌈 Formatted, please merge the changes from this PR |
|
Thanks for addressing this! Unfortunately it doesn't seem to have fixed the build issue that @niklaskorz mentioned in #7577 (comment); I still get this error: |
yea, it's trickier than I thought. |
|
@gtong-nv that makes sense. If it'd make it easier, I'd imagine we can also change the Nixpkgs build to use |
|
Alternatively: the whole reason the Nixpkgs build disables slang-rhi in the first place is because there doesn't seem to be a way to build it without network access; would it be possible to just provide a way to build slang-rhi with a provided version of Dawn instead? Then we wouldn't need to disable slang-rhi when building Slang. |
|
I think we should just exclude all tests and examples from the build is SLANG-RHI is OFF, as from what I can tell, almost all of them has |
|
/format |
|
🌈 Formatted, please merge the changes from this PR |
|
@gtong-nv thanks for fixing those earlier errors! It looks like the build still doesn't quite work with |
|
Hi @samestep, I tried a clean build and it should work. Can you clear camke cache and try a clean build? |
|
Unfortunately I have already been using a clean build :( Specifically, I've been testing this with the build setup in Nixpkgs, since that was the original motivation for this change: https://github.com/NixOS/nixpkgs/blob/596312aae91421d6923f18cecce934a7d3bfd6b8/pkgs/by-name/sh/shader-slang/package.nix That is, one can reproduce the exact same build error by cloning Nixpkgs at that same commit: gh repo clone NixOS/nixpkgs
git checkout 596312aae91421d6923f18cecce934a7d3bfd6b8Then applying this patch to build with the latest commit from this branch: diff --git a/pkgs/by-name/sh/shader-slang/package.nix b/pkgs/by-name/sh/shader-slang/package.nix
index 78edfe7f43ac..3d40aee57050 100644
--- a/pkgs/by-name/sh/shader-slang/package.nix
+++ b/pkgs/by-name/sh/shader-slang/package.nix
@@ -27,13 +27,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "shader-slang";
- version = "2025.12.1";
+ version = "2025.14.3";
src = fetchFromGitHub {
owner = "shader-slang";
repo = "slang";
- tag = "v${finalAttrs.version}";
- hash = "sha256-5M/sKoCFVGW4VcOPzL8dVhTuo+esjINPXw76fnO7OEw=";
+ rev = "c46125d22e6ecf66a8bb9b0c4b5bcaed8ee6990a";
+ hash = "sha256-8hC39nO7HbVPzSOIqHFSaq22mmwMwvd8W+zJ/ZEAh9w=";
fetchSubmodules = true;
};
@@ -118,6 +118,7 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/shader-slang/slang-rhi is "under active refactoring
# and development, and is not yet ready for general use."
"-DSLANG_ENABLE_SLANG_RHI=OFF"
+ "-DSLANG_ENABLE_TESTS=OFF"
"-DSLANG_USE_SYSTEM_MINIZ=ON"
"-DSLANG_USE_SYSTEM_LZ4=ON"
"-DSLANG_SLANG_LLVM_FLAVOR=${if withLLVM then "USE_SYSTEM_LLVM" else "DISABLE"}"Then running this command: nix-build -A shader-slangI also tried explicitly adding @gtong-nv looking at e.g. the Or @niklaskorz do you happen to know how/if this build error should be fixed on the Nixpkgs side? |
As you already noted in #8102, this is caused by an unintended dependency of the gfx module on the tests. Adding |
samestep
left a comment
There was a problem hiding this comment.
As you already noted in #8102, this is caused by an unintended dependency of the gfx module on the tests. Adding
"-DSLANG_ENABLE_GFX=OFF"to thecmakeFlags(together with"-DSLANG_ENABLE_TESTS=OFF") makes this PR pass in nix.
Ah you're so right, thanks; just tried that and it does indeed work.
|
Techincally, |
This PR marks the
slang-rhia required dependecy forplatformandgfx-unit-test, and only build them whenSLANG_ENABLE_SLANG_RHI=ON.This should allow the slang still to be built without those tests components when
SLANG_ENABLE_SLANG_RHI=OFF.