-
Notifications
You must be signed in to change notification settings - Fork 21
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
Additional windows problems #38
Comments
Meson's Ninja backend can print out that message for you: if self.build.need_vsenv:
mlog.log('Visual Studio environment is needed to run Ninja. It is recommended to use Meson wrapper:') Running vsenv_active = setup_vsenv(b.need_vsenv)
if vsenv_active:
mlog.log(mlog.green('INFO:'), 'automatically activated MSVC compiler environment') Sadly, it's impossible set up VS permanently from Meson. We can detect it even not on PATH, but we can only set it up in child processes of Meson itself (that's why This is really a flaw in ninja, there's a ticket at ninja-build/ninja#1610 (comment) discussing it. |
@mattip Do you have a Windows machine to test on? If so, do you think you can make a PR? Looks like it should be a very small change. |
Also, I CI shouldn't be passing on Windows, sounds like? |
https://github.com/scientific-python/devpy/actions/runs/3915502106/jobs/6693736610#step:7:4 The functional tests try to build software using C, I don't know why this is quitting in a single second while printing zero output though. Simply configuring Meson should take longer than that... |
The change to use sys.executable is indeed a small change. But getting devpy to work around the meson/ninja limitation in activating MSVC is a blocker for successfully using devpy in windows, so that needs to be fixed to even start using a devpy-like workflow practical. |
So, what can I do in devpy to handle this situation. I.e., what command do I need to run before meson is invoked? From the above, I don't quite understand the problem, other than the compiler not being on the path? |
It seems we will have to wait for a fix to ninja |
The first step is to figure out why the Windows CI isn't even attempting to execute If it was just a matter of the compiler not being on the PATH, meson would run, print basic information about the build, and then print an error message saying it can't find a compiler on the PATH... |
I made a fix; perhaps there's a better one, but the issue was Powershell not honoring |
How fascinating. Powershell doesn't error out if it doesn't know how to run that file? 👀 Anyway, that fix is great, the issue is now debuggable and we can now tell exactly what is happening on Windows in CI:
This is certainly a thing that happened, but I'm not sure how else to describe it. A common problem with Github Actions, though. Lots of random software installed, including, somewhere, a mingw toolchain. I think this might be the Strawberry Perl one: And ultimately: Meson will look for a compiler on PATH before looking for MSVC, on the assumption -- which is usually correct -- that if you installed one, you want it. If it doesn't find one, it sets up MSVC. Projects such as SciPy make use of this by intentionally and knowingly installing a known-good toolchain from rtools (this, or something similar, is needed if you cannot use MSVC on Windows because you need a FOSS Fortran compiler): |
|
Oh jeez, so maybe the correct solution is to reconstruct the PATH manually. |
I tried to remove Strawberry, but it's still picking up a GCC compiler 🤔 https://github.com/scientific-python/devpy/actions/runs/4020420199/jobs/6908329726#step:8:22 Since it's the same compiler as found above, I presume I didn't get it out of the system somehow. |
Since Powershell apparently silently ignores programs that don't exist, maybe there's just no |
Perhaps it takes it 1:40 to figure that out! Who knows. |
Apparently there's (now?) two of them:
So apparently they also have this: https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
Bit random... Seems like there truly is no way for build systems to know on Github Actions, whether the compiler is or is not supposed to be MSVC. |
An alternative is to go into the MSVC shell: https://dvdhrm.github.io/2021/04/21/meson-msvc-github-actions/ |
But I thought this ticket is all about the fact that we wanted to simulate the condition where users running on a personal device don't have that set up? |
Baffling, because: https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md#msys2
Which makes a ton of sense! Every other gcc should do the same! Github Actions hosted tools should be available if the user wants to activate them, not arbitrarily sprinkled into PATH. But it failed at least twice and maybe more than that, sigh. ... Hold on, msys2 isn't the problem at all. LLVM 15.0.5 is installed too. Clang is: |
@eli-schwartz So what is reasonable behavior for |
Or just do so unconditionally on Windows, perhaps. Ideally the Ninja fix will happen some day, but who knows... this is not a solution for today... |
From the meson branch of NumPy, using the HEAD of this repo 2ad0423 in a virtualenv of the windows store CPython3.9 located in
d:'\temp\cpython_39
:When starting from a cmd shell without cl on the path,
python dev.py build
fails to set up MSVC in a way that ninja can call it. I need to do this (something kindly prints out the second line so I know what to call, then the second invocation of dev.py installs tobuild-install
). A work-around is to activate MSVC before calling this command, but I think it should Just Work without that.running
python dev.py test
still fails. It seems to be calling the base-python rather than the one inside the virtualenv. We touched on this in the other issue. If I change this line to usesys.executable
instead of"python"
then it works.The text was updated successfully, but these errors were encountered: