msys2 / setup-msys2

GitHub Action to setup MSYS2
https://github.com/marketplace/actions/setup-msys2
MIT License
292 stars 40 forks source link

Add ' ' to $destination that way spaces can be used in path #203

Closed MasonT8198 closed 2 years ago

MasonT8198 commented 2 years ago

Currently if your runner path on a self hosted instance has a space, the setup process will fail because Get-FileHash cannot run with ' ' to define the path if your username has a space, seems like an easy fix that would allow TEST CI to work, however if this wouldn't be desired then it would be nice to note somewhere that you have to have a path with 0 spaces.

eine commented 2 years ago

This should be fixed in the latest release. @MasonT8198 can you please confirm?

jeremyd2019 commented 2 years ago

I am a little confused by how the username would affect the paths used here. AFAICT, actions/runner should be using the runner temp dir RUNNER_TEMP not the user's TEMP/TMP (https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables). And, Github recommends installing the runner on Windows in a folder under the root of a drive to avoid long path issues (https://github.com/actions/runner/releases/tag/v2.289.1). I guess they don't mention not having spaces in that path...

MasonT8198 commented 2 years ago

@eine works! Thanks, I would like to ask another question, for self hosted CI, could we make the msys2 path changes permanent, that way we wouldn't have to reinstall it everytime? It's just a major pain to do

MasonT8198 commented 2 years ago

I am a little confused by how the username would affect the paths used here. AFAICT, actions/runner should be using the runner temp dir RUNNER_TEMP not the user's TEMP/TMP (https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables). And, Github recommends installing the runner on Windows in a folder under the root of a drive to avoid long path issues (https://github.com/actions/runner/releases/tag/v2.289.1). I guess they don't mention not having spaces in that path...

I wasn't necessarily understanding what the issue was in the first place because the error was so vague, however the glaring problem at hand was the lack of ' ' in the pathing, changing my file path to include 0 spaces fixed the issue, however I thought this as just a minor oversight, considering it's mostly used for github virtual environments

jeremyd2019 commented 2 years ago

for self hosted CI, could we make the msys2 path changes permanent, that way we wouldn't have to reinstall it everytime? It's just a major pain to do

I found the same. What I do in that case is install msys2 myself into C:\msys64 when setting up the runner, and use release: false option of this action.

eine commented 2 years ago

@MasonT8198 as @jeremyd2019 suggested, you can use release: false to avoid installing MSYS2 from scratch in each run.

Furthermore, we might enhance location (https://github.com/msys2/setup-msys2#location) to be used in https://github.com/msys2/setup-msys2/blob/main/main.js#L231, if that's something you need.

MasonT8198 commented 2 years ago

@MasonT8198 as @jeremyd2019 suggested, you can use release: false to avoid installing MSYS2 from scratch in each run.

Furthermore, we might enhance location (https://github.com/msys2/setup-msys2#location) to be used in https://github.com/msys2/setup-msys2/blob/main/main.js#L231, if that's something you need.

Sorry this is a really late reply, I think it would be useful if I could store my msys2 build on a shared drive or the non c drive. however not necessarily necessary.

I'll go ahead and close this issue as my original issue has been resolved which I'm very thankful for!