-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use shader's Cargo.toml
to get spirv-builder
version and toolchain
#27
Use shader's Cargo.toml
to get spirv-builder
version and toolchain
#27
Conversation
61ebb48
to
39932ec
Compare
So the CI tests have highlighted the curious case of not being able to compile a shader that exists in workspace whose root I hadn't realised that you were manually compiling the The windows error though is still a mystery, maybe it's because of parentheses in the path. I'll keep looking into it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these changes are great. I had some nits, some typos and some questions.
A few things I'd like to get clarified that weren't immediately obvious from the code (forgive my skimming):
- after everything is cached and built, will future invocations be possible without network activity?
- Was that ever the case?
- How much more data are we caching?
- Does using
cargo tree
, or any of the other changes here, cause any significant increase in compile times? I'm guessing it's negligible compared to running codegen.
It seems you're still adding commits, so I'll wait until you say you're ready to do one last pass and approval. Awesome work! 👍
5e01474
to
e313d4c
Compare
We can still override the version and toolchain with CLI args. This commit just changes the defaults. I feel like there could be a lot of edge cases for this implementation. So I consider it more of a first draft. Notable changes: * `Spirv` renamed to `SpirvCli`. * New `impl SpirvSource` that does all the shader crate querying. * CLI args change: `--spirv-builder` is now split into `--spirv-builder-source` and `--spirv-builder-version`. * `--shader-crate` now lives on the `install` subcommand, which because it is inherited by `build` (where it was originally), means it doesn't make much of a difference. * The full build test now has a teardown function making it idempotent. * Cache folder structure now has sub folders for `spirv-builder-cli`'s and `rust-gpu` repos. * `spirv-crate-template` is updated to Git with revision `82a0f69` because "0.9" doesn't seem to compile on Windows. Things to consider: * Can we remove `TARGET_SPECS` now, because we have a copy of the `rust-gpu` repo, we can get them from there instead? * What's the UX expectations for changing `spirv-std` versions or overriding `rust-gpu` versions and toolchain? I think in most cases `spirv-builder-cli` rebuilds should occur because the changes will cause cache directory changes. But I think it'd be good to at least manually test this. * Should the main build test be moved out into an integrations tests folder? * I'd still like to test each `spirv-builder-cli` feature, ie: `spirv-builder-pre-cli` and `spirv-builder-0_10`. We're currently only testing `spirv-builder-pre-cli`.
e313d4c
to
79cb0de
Compare
I've fixed everything from your review comments but the Windows build is still failing. The only clue I can see from the logs is this:
So it's failing to build But let me answer some of your questions anyway.
|
We just need to figure out this Windows error and then I think this is g2g 🚀 . @tombh don't hesitate to thrash against CI on this ;) |
Hehe sure, thanks, I won't hesitate. I'll get my thinking cap on 🤔 |
I have some changes incoming, but I can't seem to push them. I'm not sure if my workflow is borked or if there's a permission error or what. |
Well I figured it out! |
Those are some nice changes! Though I'd prefer they were in their own branch. It's not so easy to pull in your changes into my local branch, I have to It's easy enough to make a PR targeting another PR, and then I can merge your changes into my PR as and when they're ready, without us stepping on each other's toes ❤️ |
FWIW |
Yeah |
I'll open up another PR into yours, @tombh 👍 |
@tombh - is the method you're suggesting for me to fork your fork and then create a PR into your branch at your fork? Because I can't select your branch as the base for my changes in this repo. |
See my additional changes above @tombh ^ |
Looks like currently on my branch (#28), |
fdc1c33
to
beffe12
Compare
For some reason `spirv-tools-sys` only fails to build on windows when run from inside `cargo test`. Maybe it's something to do with what gets set in ENV? Also added `just` so that we have a canonical way of running CI-related tasks.
beffe12
to
2395dd7
Compare
I figured it out! Windows only fails when built inside To formalise it a bit I've added that and the lints to a Thanks for the PR, I did include it. But I think I may still not have got my point across. Perhaps it's just enough to say that I think it's a Golden Rule to never add commits to another person's PR. I had unpushed local commits when you pushed that commit. So I could neither push nor pull without overwriting code. I had to Another benefit of the Golden Rule is that it gives each developer the freedom to choose their own history management. For example I am perhaps an overly zealous proponent of linear history. Therefore that each commit should strive to be part of the beats of a narrative, that they should tell a coherent story such that they provide extra context and documentation. This is particularly useful for bisecting bugs (like the Windows one I was just debugging), or merely peeking a Now whilst I may value such a practice, that doesn't mean that everybody should. We should have the freedom to follow our own approaches in our own PRs. BTW I think another approach to bear in mind could be using some sort of staging branch, named |
Don't worry, you got your point across, and I agree. I was recently contributing to a project and in that project, committing to the PR branch directly was their practice and I was surprised it worked. I decided I'd give it a try. Really I just wish I could make a PR into your PR without having to fork your fork. It would be nice to keep all the discussion here instead of another related PR 🤷 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thank you :)
We can still override the version and toolchain with CLI args. This
commit just changes the defaults.
I feel like there could be a lot of edge cases for this implementation.
So I consider it more of a first draft.
Notable changes:
Spirv
renamed toSpirvCli
.impl SpirvSource
that does all the shader crate querying.--spirv-builder
is now split into--spirv-builder-source
and--spirv-builder-version
.--shader-crate
now lives on theinstall
subcommand, whichbecause it is inherited by
build
(where it was originally), means itdoesn't make much of a difference.
spirv-builder-cli
'sand
rust-gpu
repos.spirv-crate-template
is updated to Git with revision82a0f69
because "0.9" doesn't seem to compile on Windows.
Things to consider:
TARGET_SPECS
now, because we have a copy of therust-gpu
repo, we can get them from there instead?spirv-std
versions oroverriding
rust-gpu
versions and toolchain? I think in most casesspirv-builder-cli
rebuilds should occur because the changes willcause cache directory changes. But I think it'd be good to at least
manually test this.
folder?
spirv-builder-cli
feature, ie:spirv-builder-pre-cli
andspirv-builder-0_10
. We're currently onlytesting
spirv-builder-pre-cli
.