-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Meson build system error (v1.4.99) - blocked by group policy #13880
Comments
Meson attempts to take this code: meson/mesonbuild/utils/vsenv.py Lines 21 to 27 in f0851c9
and format it and run it as a batch script: meson/mesonbuild/utils/vsenv.py Lines 90 to 98 in f0851c9
(bat_path is going to be the It does not allow for the possibility of the batch script failing, so "check_output" raises a python-level traceback -- and raising a python-level traceback is standardly considered to be a UX bug in meson as we should catch exceptions and raise error messages instead. The issue is that apparently running
and error out. Meson can do without this batch script, if and only if you run We could likely make the error message better, of course. :) |
Apologies, this is a project we are inheriting from a contractor, and our company doesn't use python, so we are all learning how it works. So for the pip install, that should just be run in the root of our project? Also not sure what you mean by the environment scripts, since this error is occurring when I am trying to create the environment in the first place. |
No problem, happy to help either way. :) I'm trying to explain the context as I go.
Meson doesn't care one way or another, but I believe VS Code does run pip there, yeah.
There are a couple different "environments" applicable here. VS Code tries to set up a python environment. That entails running meson as a buildsystem tool during the process. Meson wants to set up a MSVC compiler environment so it can run Without access to MSVC's own |
Well, 'pip install' just errors out when it is run, since it needs the "what" for what to install. I also don't see that "cannot find a C compiler" error in the output. Is there a way to run Meson manually to set the environment variables, or do you have a list of variables needed so I can manually add them to the %PATH%? |
Unfortunately Microsoft doesn't document a list of variables needed, the only official way to do that is to execute their batch script. |
Maybe another, better question: your log says you are using the brand new Python 3.13 release, which I guess makes sense as VS Code is probably saying "newer is better". But projects like numpy provide prebuilt binary releases, which can be installed by
So if you try selecting Python 3.12 here instead of Python 3.13.0, your requirements.txt would install successfully.
It requires numpy version 2.0.1, and from the release artifacts page at https://pypi.org/project/numpy/2.0.1/#files
But no versions are listed that say they are compatible with CPython 3.13, so it instead downloads the source code and tries to recompile it from scratch. |
I will try with 3.12. I only have the newest installed, so will have to add it. |
Looks like that solved the problem. Thank you for your time. Could be useful to add error messages for python version, but it is also another product, so makes sense if you don't want to. I will reach out to the contractors, as they were insisting you had to install the latest version. |
It's interesting that they are insisting to install the latest version of Python. The requirements.txt says that numpy version 2.0.1 shall be used, which isn't the latest version of numpy -- the latest version of numpy is version 2.1.3, and that comes with prebuilt binary artifacts for Python 3.13 It is usually the case that if you want to upgrade to a brand new release of Python, you will also need to take a look at upgrading your thirdparty modules (like numpy) as well. Both in order to ensure that you can use prebuilt binary artifacts, and because often there are code changes in the thirdparty module that are needed in order to adapt to the new Python release. |
Using NumPy 2.0.1 + Python 3.12, or using NumPy 2.1.3 + Python 3.13 sounds like the right answer. NumPy 2.0.1 doesn't even support Python 3.13, so definitely don't try to build it from source.
That's like the one actionable thing here on the Meson side it looks like? |
Yeah, that is about it. Everything else has been figured out. Thank you! |
Describe the bug
Trying to create a Python environment in VSCode. When running, an error occurs stating that a program is blocked by our group policy. We have so many policies in place, it isn't clear which one may be blocking it. Is there a way to get more details? Seems to be happening in NumPy. Submitting bug here since the error logs say it is a bug with Meson and should be reported.
To Reproduce
Don't think it can be reproduced, as it is something with our policies. IT has reviewed all of them, and nothing jumps out at them as an issue. Attached is the output file. Key lines are 206 and 261.
Expected behavior
We expect meson to run successfully. Ran using the VSCode command "Python: Create Environment", "Venv", "Delete and Recreate"/"New", "Python 3.13.0 64 bit", selected "requirements.txt".
system parameters
Output.txt
The text was updated successfully, but these errors were encountered: