msys2 / setup-msys2

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

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

Closed windelbouwman closed 1 month ago

windelbouwman commented 2 years ago

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:

Biswa96 commented 2 years ago

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 commented 2 years ago

You can get the location of the MSYS2 installation by executing cygpath -m /. See https://github.com/msys2/setup-msys2/runs/6554920729?check_suite_focus=true#step:5:7 and https://github.com/msys2/setup-msys2/blob/main/.github/workflows/Test.yml#L399.

eine commented 2 years ago

As commented in https://github.com/msys2/setup-msys2/pull/228#issuecomment-1135896940, I added a couple of examples to show how to save the MSYS2 root location to a variable, either from powershell or from python: https://github.com/msys2/setup-msys2/blob/066de4c88c57fc6eab4f261ae558c6a567bbe372/.github/workflows/Test.yml#L400-L408

lazka commented 1 month ago

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.