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

Windows: espup should display error when Path is reaching too long #270

Open
georgik opened this issue May 31, 2023 · 8 comments
Open

Windows: espup should display error when Path is reaching too long #270

georgik opened this issue May 31, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@georgik
Copy link
Contributor

georgik commented May 31, 2023

Bug description

espup install updates Path variable, but does not display any warning about reaching limit 2047 characters which is limit on Windows.
Reaching such value makes it impossible to update the variable by user.

@georgik georgik added the bug Something isn't working label May 31, 2023
@SergioGasquez
Copy link
Member

I tried to reproduce this error but couldn't, did you encounter this error with version 0.4.1 of espup? Here is my reproduction attempt:

PS C:\Users\sergio> $Env:path.length
2026
PS C:\Users\sergio> espup install -v 1.70.0.1
....
<After installation>
PS C:\Users\sergio> $Env:path.length
3165    

I think @9names also tried to use a "very long path" with no issues. @9names, do you recall if it was longer than 2047 characters?

@9names
Copy link

9names commented Jun 3, 2023

I think @georgik isn't saying that espup has an issue updating the path.
Rather, they are saying that after it's updated, and the path is > 2047 characters they can no longer change the path via other means.
I don't think warning would be sufficient to help here - you'd really need a prompt to ensure the user is okay with their path becoming too large during installation.

@georgik: how are you trying to update your path after espup installation?
I recommend using Rapid Environment Editor to remove any old paths, and if necessary use it to convert paths to their shorter 8.3 form.

@SergioGasquez
Copy link
Member

Do you think that the following warning message: Your PATH environment variable is longer than 2047 characters. Windows will not allow you editting it. will be sufficient?

@georgik
Copy link
Contributor Author

georgik commented Jun 29, 2023

I recommend requesting user consent at this point or hard-stop the installation with a hint for parameters to override the warning.

@bugadani
Copy link
Contributor

Oh, this has the potential of breaking VSCode terminal. I was wondering why I could no longer use cargo there, and the issue was resolved when I removed my duplicate (everything was in the list like 5 or 6 times) PATH variables.

So, user programs may have issues with using very long path variables. VSCode has such issues, while Windows Terminal doesn't.

@SergioGasquez
Copy link
Member

Oh, this has the potential of breaking VSCode terminal. I was wondering why I could no longer use cargo there, and the issue was resolved when I removed my duplicate (everything was in the list like 5 or 6 times) PATH variables.

Did you install the environment several times?

@bugadani
Copy link
Contributor

bugadani commented Aug 2, 2023

Did you install the environment several times?

Yes, I did. That it duplicated its PATH entries is a separate issue, but the end result is the same: I ended up with an unworkably long PATH.

@Steve-xmh
Copy link

Steve-xmh commented Aug 15, 2023

I also confused by this issue, I'm now using espup 0.5.0 and when I (re)execute install command it will merge PATH environment variable in system environment with those at user environment and then override the user environment with oversized paths.

The command:
image

Before the installation (some unimportant content are masked):
image

After the installation (some unimportant content are masked):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants