isJuhn / KAMI

Kot And Mouse Injector
MIT License
124 stars 13 forks source link

CI: fix core dependency (PINE) not building and bundling #60

Closed dio-gh closed 2 years ago

dio-gh commented 2 years ago

Fixes PINE not building and bundling with the final archive.

isJuhn commented 2 years ago

maybe @Margen67 knows why it's going with mingw instead of msvc?

eli-schwartz commented 2 years ago

The adventures with meson in PowerShell don't end here though, as I'd also need to rely on this Action component to make the current shell an MSVC developer shell. Only then would meson be able to pick up MSVC for some reason. This Action component is what requires using PowerShell ^^ by the way in the first place, since otherwise I can't seem to make the necessary env vars propagate.

TL;DR: as usual, everything C++ related is ass, and Windows shell scripting is too

Meson has a --vsenv option. meson setup builddir/ --vsenv. It's supposed to force detecting Visual Studio via running vswhere.exe and parsing its output in order to give Meson access to the critical environment variables that an MSVC developer shell would have. In the absence of this option, Meson will indeed detect GCC first and end up using that (but if it didn't find GCC, then it would try setting up vsenv as a last resort). :(

Does this option help?

dio-gh commented 2 years ago

I tried it, but meson exited with a meson: error: unrecognized arguments: --vsenv, and I also couldn't locate this switch nor in the documentation, nor in the help messages of the program. Also didn't work locally.

After some investigation, I found that the downstream packaging on Chocolatey has been lagging behind, and is severely out of date by now, that's why the switch is not available. To get around this issue, I pulled in this Actions component instead of relying on choco. With this, I was able to use the --vsenv switch successfully, however, things fail with a Project was not setup successfully now. I'm not entirely sure how to proceed just yet, because despite passing --verbose the info emitted is really sparse.

But yes, thanks, it did help. Partial success.

Update: The latter message was emitted by the Actions component, not Meson, so no skin off of Meson's nose there. I ended up replicating the necessary capabilities of that component, since I could do so in 3 lines, and it shone light on what the remaining problem was (that being, me not quite grasping how Meson operates and where it puts its files / what the correct syntax is).

dio-gh commented 2 years ago

Managed to finally figure it out, cheers. Thanks for the help.