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

Update env.rs #420

Merged
merged 3 commits into from
Mar 22, 2024
Merged

Update env.rs #420

merged 3 commits into from
Mar 22, 2024

Conversation

ryankopf
Copy link
Contributor

The book says "There is no need to execute the file for Windows users. It is only created to show the modified environment variables.". This appears to be out of date.

On Windows 10, using powershell in VS Code, nothing builds correctly without first running the environment file as a command.

cargo generate esp-rs/esp-idf-template cargo
cd projectname
cargo build

Fails unless I first do C:\Users\ryankopf\export-esp.ps1.

The book says "There is no need to execute the file for Windows users. It is only created to show the modified environment variables.". This appears to be out of date.
@ryankopf
Copy link
Contributor Author

Related: #233

Did not appear to get fixed correctly, this is a great way to offer a fix.

@SergioGasquez
Copy link
Member

Mind giving some reproduction steps to the issue and which version of espup are you using?

@ryankopf
Copy link
Contributor Author

ryankopf commented Mar 15, 2024

Certainly!

This happened on two windows machine, one a Surface Pro running either Windows 10 or 11, I will have to check later, and a desktop PC that is running Windows 10 Pro.

The commands run were:

cargo install espup
espup install

Version is:

PS F:\esp2> espup -V
espup 0.11.0

The issue was difficult to reproduce. Keys to reproducing the issue included restarting my PC.

Delete the environment changes manually from the registry and restarted my PC. The environment variables still showed up in new shells until I rebotted, likely due to registry caching of some kind, even when I made certain to open new shells both CMD and PowerShell, using WindowsKey+R 'cmd' or WindowsKey+x and i for PowerShell. Both returned the environment variables when echo'd, despite the fact that they were deleted from the registry in RegEdit.

F: (or whatever your drive letter is)
cargo generate esp-rs/esp-template (all defaults)
cd F:/esp3
cargo build

error: linker `xtensa-esp32-elf-gcc` not found
  = note: program not found
error: could not compile `esp4` (bin "esp4") due to 1 previous error

PS F:\esp4> espup install
[info]: Installing the Espressif Rust ecosystem
[info]: (snip)
        Your environments variables have been updated! Shell may need to be restarted for changes to be effective
        A file was created at 'C:\Users\ryankopf\export-esp.ps1' showing the injected environment variables

PS F:\esp4> cargo build
   Compiling esp4 v0.1.0 (F:\esp4)
error: linker `xtensa-esp32-elf-gcc` not found
  |
  = note: program not found

error: could not compile `esp4` (bin "esp4") due to 1 previous error

Running C:\Users\ryankopf\export-esp.ps1 made it work.

I am certain there is an underlying registry caching issue that is causing these environment variables to not be immediately updated, and this probably is likely not limited to me as it's happened on two systems, but it may be caused by SOMETHING that doesn't exist on a completely fresh Windows installation, if that's where you test the issue, but I don't have access to one at the moment.

src/env.rs Outdated Show resolved Hide resolved
Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
src/env.rs Outdated Show resolved Hide resolved
@SergioGasquez SergioGasquez merged commit 72700d7 into esp-rs:main Mar 22, 2024
16 checks passed
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.

None yet

2 participants