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

export variables with msys environment path, and add options to append to PATH variable #227

Closed
windelbouwman opened this issue May 23, 2022 · 4 comments

Comments

@windelbouwman
Copy link

Hi,

I would like to use this action to build the hdf5 rust crate against a msys2 package for HDF5.

Things I would like to request for this github action:

  • I want to use the default shell, and extend the PATH environment variable with the bin folder in the msys2 installation. Is this possible to add to this action? So not using the msys2 shell, but having the PATH environment variable extended by the setup-msys2 action?
  • An exported variable with the location of the msys2 installation. For now, I must manually specify a path to the installation to find HDF5. Specifically, I need to set HDF5_DIR=D:\a\_temp\msys64\mingw64, for the D:\a\_temp\msys64\mingw64 part I would like to be able to use some sort of variable.
@Biswa96
Copy link
Member

Biswa96 commented May 23, 2022

Is not it possible to build the whole hdf5 rust crate in msys2's mingw environment? It may not require those path manipulation. We've rust package also.

@eine
Copy link
Collaborator

eine commented May 23, 2022

@eine
Copy link
Collaborator

eine commented May 24, 2022

As commented in #228 (comment), I added a couple of examples to show how to save the MSYS2 root location to a variable, either from powershell or from python:

- shell: pwsh
run: |
$Env:MSYS2_ROOT = msys2 -c 'cygpath -m /'
$Env:MSYS2_ROOT
- shell: python
run: |
from subprocess import check_output
MSYS2_ROOT = check_output(['msys2', '-c', 'cygpath -m /'], shell=True).decode('utf-8')
print(MSYS2_ROOT)

@lazka
Copy link
Member

lazka commented Aug 3, 2024

There is now an action output which you can use to extend your PATH: https://github.com/msys2/setup-msys2?tab=readme-ov-file#msys2-location (This is an absolute Windows path)

I think it would be best to leave it to users on how, in which order, and when to extend PATH. setup-python has it, via an update-environment option https://github.com/actions/setup-python/blob/04c1311429f7be71707d8ab66c7af8a14e54b938/src/find-python.ts#L111 but I'm a bit worried that this might lead to conflicts if users enable it without understanding the consequences. And under normal circumstances with users using bash this isn't needed.

@lazka lazka closed this as completed Aug 3, 2024
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

No branches or pull requests

4 participants