Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
313 stars 134 forks source link

win10 native MSYS2 build make install privileges issue #713

Closed Melonbob closed 1 year ago

Melonbob commented 1 year ago

Had to run MINGW64 terminal with admin privileges to get make install to install into default location, which is "C:/Program Files (x86)".

matty0ung commented 1 year ago

Ah, that is interesting. This doesn't happen on my machine. I think there's a way you can install MSYS2 so this isn't an issue -- see https://www.msys2.org/wiki/Sudo/. If that's what's needed we should update the wiki.

Melonbob commented 1 year ago

The default make command is actually mingw32-make as well.

matty0ung commented 1 year ago

Oh, yes, it should be mentioned in the wiki somewhere that you have to call cmake instead of make on Windows. But we should probably make that more prominent.

If you have a look at https://github.com/Brewtarget/brewtarget/blob/develop/.github/workflows/windows.yml, you can see the commands run in MSYS2 for the nightly builds, which might help a bit. Eg, instead of make you want cmake --build . and instead of make install you want (I think) cmake --build . --target install.

Sorry it's a bit painful. If and when I get the new build system flying, it will be a lot more consistent between platforms.

Melonbob commented 1 year ago

To close this issue for Windows 10 and 11 builds, the solution is to run the MSYS2 terminal (whichever one you built from, e.g., MINGW64 or MINGW32 or UCRT64) as an administrator (rt-click on App in the Start menu and choose Run as administrator) then issue cmake --build . --target install. The wiki has been updated.