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

Make xtask work on Windows, add run-example command #1215

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Feb 28, 2024

Since Windows is a little special there are various things where we need to do things in a special way.

Additionally, this adds the run-example command. That makes it easy to run an example without worrying about the features. We can also get nicer errors when trying to run something on an unsupported chip.

❯ cargo xtask run-example examples esp32s3 parl_io_tx
   Compiling xtask v0.0.0 (C:\projects\esp\esp-hal\xtask)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.09s
     Running `target\debug\xtask.exe run-example examples esp32s3 parl_io_tx`
[2024-02-28T12:31:01Z ERROR xtask] Example not found or unsupported for the given chip

@bjoernQ bjoernQ added the skip-changelog No changelog modification needed label Feb 28, 2024
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

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

Code looks good to me! Just a small nitpick on my side.

I do wonder if we want to unify (heh) how to run examples, like do we want to document that this is the way, or do we also allow users to cd into examples and get their hands dirty?

cc: @JurajSadel regarding documenting this

xtask/src/main.rs Outdated Show resolved Hide resolved
@@ -146,6 +146,11 @@ pub fn build_documentation(
builder = builder.arg("--open");
}

// If targeting an Xtensa device, we must use the '+esp' toolchain modifier:
if target.starts_with("xtensa") {
Copy link
Member

Choose a reason for hiding this comment

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

In the back of my head I'm wondering if this will cause issues down the line, but I don't have any real argument not to do this right now, I suppose we could always remove it if it does.

Copy link
Member

Choose a reason for hiding this comment

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

I can't really think of a situation where this would be problematic, we're in control of the Xtensa toolchain and this repository, so any changes made will be made by us. I think it's fine (at least for now).

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Feb 28, 2024

I do wonder if we want to unify (heh) how to run examples, like do we want to document that this is the way, or do we also allow users to cd into examples and get their hands dirty?

I'd say this could be what we tell users since they don't need to care about using the esp toolchain or which features to set. More experienced users probably will skip the README and just cd into the examples folder and run the examples manually (until they find out about the xtask)

Copy link
Member

@jessebraham jessebraham left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this! Sorry for always forgetting about Windows users 😁

@jessebraham jessebraham added this pull request to the merge queue Feb 28, 2024
Merged via the queue into esp-rs:main with commit e81957e Feb 28, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants