-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Build system" #48
Comments
Technical requirements for a user-facing build system, and what abilities we have to solve that! Reading through this section of the readme is likely helpful: https://github.com/EmbarkStudios/rust-gpu#getting-started-for-power-users-who-dont-want-to-use-spirv-builder We need to do a couple things to build a spir-v crate:
This is all terribly complicated for users, so we want to simplify it.
That "fancy hack" crate (currently called spirv-builder) can be consumed in a number of ways, current ideas we've thought of so far is:
|
I've been thinking about this quite a bit in past couple of days, in relation to testing the crate, as right now we use
I think the following changes together would drastically simplify the build process, and make
I've laid out the motivation for each of the changes below.
At the end of the day this is the expected flow for each of the use cases with the proposed changes. User
In build scripts: // In build.rs
fn main () {
// Pseudo code (This could also be a single function that takes an enum.)
SpirvBuilder::auto_detect(build_dir)?;
SpirvBuilder::use_installed(build_dir)?;
SpirvBuilder::from_source(build_dir)?;
// For people who just want locations and don't want us to set flags.
let (sysroot, codegen_backend_path) = builder.get_sources(build_dir)?;
} Contributor
CI
|
You can add it as |
Wait what?!? I haven't seen or found code for that anywhere in rustc, could you point it out? I've only seen the codepaths for "here's a filename, dlopen it" and then a hardcoded "if it's the string llvm, or now cranelift, load the statically linked backend". Edit: or do you mean submitting a PR to rustc to add support for this? |
It turns out that it is also possible to add it to a sysroot passed using Edit: actually not, I misread the code. It has to be part of the default sysroot.
That is |
oh! haha, apparently haven't |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
A recent development that could change this, is the new "artifact dependencies" Cargo RFC (rust-lang/rfcs#3028), which will allow you to specify an artifact dependency in cargo (See example below). I think if this RFC is accepted and implemented, it will negate most if not all of the need for sky-shader = { path = "./sky-shader", artifact = "cdylib", target = "spirv-unknown-unknown" } const SHADER: &[u8] = include_bytes!(env!("CARGO_CDYLIB_DIR_SKY_SHADER")); |
We've figured out the build system enough, and things work well enough, that we should probably make more focused issues on particular problems we're having, or feature desires (e.g. the cargo artifact dependency RFC) |
This is a tracking issue for what I've been calling the "build system", but in reality the full task list is larger than just that.
In general, this is a group of related issues that would be great for someone other than me to own and drive forwards. These tasks are spread across various "functionality levels", see that issue for more information.
include!
d (or perhaps a better designed version of this). I've created an extremely rough and minimally-featured prototype in the spirv-builder crate - we need to expand it quite a bit, in both robustness and features.The text was updated successfully, but these errors were encountered: