Skip to content

Verify the published Python compatibility version#88

Closed
tianon wants to merge 1 commit into
docker-library:masterfrom
infosiftr:validate-python-version
Closed

Verify the published Python compatibility version#88
tianon wants to merge 1 commit into
docker-library:masterfrom
infosiftr:validate-python-version

Conversation

@tianon
Copy link
Copy Markdown
Member

@tianon tianon commented Mar 4, 2025

This asks PyPy to tell us which version of Python it is so we can validate that we're claiming the correct one.

This is related to 94d8ce9, but the impact is 100% superficial (and only exhibits in a comment in our Dockerfiles, in fact), so I'm not actually convinced this makes any sense to go forward with, but figured I'd open it for discussion (since it's really trivial for us to verify).

@tianon tianon marked this pull request as draft March 4, 2025 21:36
@tianon tianon force-pushed the validate-python-version branch 2 times, most recently from 0b20ce8 to 7e57b42 Compare March 4, 2025 21:50
@tianon
Copy link
Copy Markdown
Member Author

tianon commented Mar 4, 2025

Whew, https://github.com/moby/moby/blob/65c2f799b4f9d839fb8d4b550a2459b17166925c/builder/dockerfile/dispatchers_windows.go#L117-L129 is not a rabbit hole I wanted to dig into today, but here I am -- that's all valid for cmd.exe, but notably not for powershell.exe, so that's why we're losing double quotes.

@tianon
Copy link
Copy Markdown
Member Author

tianon commented Mar 4, 2025

Reading through https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/program-structure/main-command-line (and clicking down/through to https://learn.microsoft.com/en-us/dotnet/api/system.environment.commandline?view=net-9.0#system-environment-commandline), there is an API that PowerShell could use to extract the original Windows "CommandLine" value and parse it differently (ie, like cmd.exe does), but they'd have to go way out of their way to do so, and it wouldn't be compatible with any of their existing argument parsing, and would be Windows-specific behavior/parsing, so I really doubt this is something they'd ever consider. 😭

@tianon
Copy link
Copy Markdown
Member Author

tianon commented Mar 4, 2025

Arguably, Moby/Docker should only be applying that block if we're invoking cmd.exe 🤦

This asks PyPy to tell us which version of Python it is so we can validate that we're claiming the correct one.
@yosifkit
Copy link
Copy Markdown
Member

yosifkit commented Mar 6, 2025

🤔While it is nice to verify the data we get from downloads.python.org/pypy/versions.json, this one isn't material for the provided binaries and is just for a comment in the Dockerfile. I don't think it isn't worth failing the automated update.sh build if it is wrong.

@tianon tianon closed this Mar 6, 2025
@tianon tianon deleted the validate-python-version branch March 6, 2025 17:33
@tianon
Copy link
Copy Markdown
Member Author

tianon commented Mar 6, 2025

Agreed, we can resurrect this if we ever change our mind (or use that provided version for anything more serious than a comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants