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

espflash should look at parent/workspace directories for espflash.toml #593

Closed
marsfan opened this issue Feb 21, 2024 · 3 comments · Fixed by #595
Closed

espflash should look at parent/workspace directories for espflash.toml #593

marsfan opened this issue Feb 21, 2024 · 3 comments · Fixed by #595
Assignees
Milestone

Comments

@marsfan
Copy link

marsfan commented Feb 21, 2024

Looking at the release notes for espflash v3.0.0-rc1, it seems that the partition table can now be specified in the espflash.toml file. (As added in #551)

However, it seems that espflash will only look for this file in the current directory, or the user's main configuration directory (See these lines of code. It should support looking at parent directories so as to support cargo workspaces with multiple crates.

This is especially useful if cargo test is used, as that command will execute in the individual crates sub-directories in the workspace. With the current search method used by espflash, this would require creating an additional espflash.toml in each crate's directory, instead of a single espflash.toml in the workspace directory.

@SergioGasquez SergioGasquez self-assigned this Feb 21, 2024
@SergioGasquez SergioGasquez linked a pull request Feb 21, 2024 that will close this issue
@SergioGasquez
Copy link
Member

Hi @marsfan! Just opened #595, mind testing it and verifying that it solves your request?

@SergioGasquez SergioGasquez added this to the v3 milestone Feb 21, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Feb 21, 2024
@marsfan
Copy link
Author

marsfan commented Feb 22, 2024

@SergioGasquez Two questions regarding testing.

  1. How do I test a version that is not released to crates.io yet (I'm still learning my way around the Rust ecosystem).
  2. When using options configured in the file (such as the option for a partition table file), will it search from the same directory that the file is in, or the directory that espflash was invoked from? I ask this as the cargo test command will invoke espflash from the individual crates directories, as opposed to the workspace directory.

@SergioGasquez
Copy link
Member

  1. How do I test a version that is not released to crates.io yet (I'm still learning my way around the Rust ecosystem).

You have two options:

  • Install the crate from git: cargo install <crate> --git <repo_url>, you can also use the --branch/--rev args if needed. Now that the pr is merged you could just cargo install espflash --git https://github.com/esp-rs/espflash
  • Clone the repo and run it locally with cargo run
  1. When using options configured in the file (such as the option for a partition table file), will it search from the same directory that the file is in, or the directory that espflash was invoked from? I ask this as the cargo test command will invoke espflash from the individual crates directories, as opposed to the workspace directory.

If you use local path to file, you should specify it from the directory where you are executing espflash... I'd say.

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

Successfully merging a pull request may close this issue.

2 participants