Skip to content
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

Add xtask for project workflows, but start small with only run-wasm #3844

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Jun 6, 2023

Recommended review experience is commit-by-commit.


Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable. N/A
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

Description
Describe what problem this is solving, and how it's solved.

cargo-xtask is a convention for project workflows using a Rust crate that is separate from the main body of code. We've identified some problems that we'd like to solve with xtask12. This PR doesn't try to address those problems specifically, but it does take on setting up xtask for further work. It also absorbs run-wasm as an easy first bit of scope.

Testing
Explain how this change is tested.

  • Have not yet tested that cargo xtask run-wasm yields the same running results, but it should.

Footnotes

  1. See this conversation about eventually needing to manage test expectations for WebGPU CTS.

  2. See this pain point issue: https://github.com/gfx-rs/wgpu/issues/3680

xtask/Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@ErichDonGubler
Copy link
Member Author

Gonna copy in some discussion from Matrix to here, since this is a better place for topical discussion.


@cwfitzgerald asked:

@ErichDonGubler: remind me the benefits/drawbacks of leaving the xtask out of the workspace

I responded:

Pros:

  • People who don't use xtask don't ever pay the cost of compiling it.
  • Toolchain-related questions for developer experience (esp. Cargo.lock, i.e., using newer versions of things) can be separate lanes from the wgpu workspace. Case in point, basically everybody using wgpu in production was compiling run-wasm whenever they ran cargo build --workspace.

Cons:

  • Another compile step for people who aren't expecting it can be weird.

    • This usually isn't a problem in practice, because it's rare for xtask to need recompilation when working on the main body of wgpu's code.
  • A separate xtask crate/workspace can complicate CI a bit with pressure on caching for compute-bound environments like cloud runners. Naga's compiles of xtask, for instance, would/will be a handful of minutes more until something is merged ErichDonGubler/naga#53.

    • Then again, the compiles are also unconditionally paid for in CI anyway currently, so this isn't as bad as it sounds.

@ErichDonGubler ErichDonGubler marked this pull request as ready for review June 6, 2023 20:47
@ErichDonGubler
Copy link
Member Author

@cwfitzgerald: I've updated the OP with more notes explaining why we're doing this. The "further work" mentioned in the OP doesn't seem to have any issues I can link to for WebGPU CTS. Should I file one?

@ErichDonGubler ErichDonGubler self-assigned this Jun 7, 2023
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, filling an issue about CTS test expectations sounds good, plus putting it in the testing tracking issue

.cargo/config.toml Outdated Show resolved Hide resolved
xtask/src/cli.rs Outdated Show resolved Hide resolved
xtask/src/cli.rs Outdated Show resolved Hide resolved
xtask/src/cli.rs Outdated Show resolved Hide resolved
xtask/src/cli.rs Outdated Show resolved Hide resolved
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G2G after discussed nits

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants