-
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
find_program does not support meson.pyz #13497
Comments
On Linux, I can reproduce this problem only if meson.pyz is unable to be run on its own as a command.
I expect this end result, since as the error message notes:
|
You said that:
Although I am not entirely sure I understand how that works, since on Windows, a python script isn't directly able to be executed as a program? |
/cc @anarazel as IIRC author of that code which is checking for a meson executable in postgres |
I don't know the details about how it works on win. Anyway, on the win machine (windows server 2019) I have access to in my company, I can run meson.pyz with or without python, and it seems to work:
|
That's a question of configuration, I think. The gui installer asks you whether you want to associate .py with python. If that's done, you can execute .py files via cmd and powershell (although the latter possibly just invokes the former for it?). See e.g. the perl example in https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ftype
FWIW, I have done "path/to/meson.py setup" on windows without a problem. I assume the reason that works is that meson has some logic to look at the shebang - maybe that that logic doesn't work for .pyz?
That requires specifying the interpreter - what precisely did you use for --interpreter? |
I don't know if this helps but I'm able to reproduce this bug in 'pure' Windows (i.e., not WSL, cygwin, mingw, etc.). After looking at what the Postgres
Following Eli's lead, this is what I did in a cmd prompt:
Clearly the file is there and 'executable' according to
I'm guessing
In this case the Python installer from python.org has created these registry entries (and put |
Can that meson.pyz be run via |
Only if you 'cheat' and do the ftype substitution yourself:
It looks like with |
Describe the bug
A clear and concise description of what the bug is.
I build postgres v16 with meson.pyz and I get the following error:
No matter I run either
python meson.pyz [...args..]
or
meson.pyz [...args..]
The whole run with more details:
while the file exists obviously as it is used to execute the build, besides:
To Reproduce
Please include your
meson.build
files, preferably as a minimal toy example showing the issue.You may need to create simple source code files (don't include private/proprietary code).
meson.build:
https://github.com/postgres/postgres/blob/REL_16_STABLE/meson.build
line 431
https://github.com/postgres/postgres/blob/a459e583e06b640597c2e24ab6043a0701a5a545/meson.build#L431
meson_bin = find_program(meson_binpath, native: true)
steps:
Expected behavior
A clear and concise description of what you expected to happen.
find_program('f:\USERS\myuser\app\bin\meson.pyz') should recognize meson.pyz as an executable binary.
system parameters
Is this a cross build or just a plain native build (for the same computer)?
Native build with vs2017 on win
what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
Windows Server 2019 (v1809)
what Python version are you using e.g. 3.8.0
python --version
Python 3.11.2
what
meson --version
meson.pyz --version
1.5.1
what
ninja --version
if it's a Ninja buildmsvc 19.40.33812 "Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33812 for x64"
--backend=vs2017
The text was updated successfully, but these errors were encountered: