-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
libxcb and xcb-proto: depend on system Python 3 #69508
Conversation
Note: this is the only circular dependency I am aware of right now, so this is a quite exceptional situation. |
See also: There are more package managers hit by this issue: the solution is either to ship a second python like I did here, or use the system python to build xcb-proto and libxcb. |
Can we download compiled python (from https://www.python.org) as a resource and use it for bootstrapping? Or use a previous version of python (python@3.8)? I don't like much an idea of adding another version of python because it could cause confusion and lead to more formula use it and then we'll need to support another version of python (and it could get even worse if it'll become versioned one). |
We have had some internal formulae like |
I can test that, I did not think about that option.
I tried it and it works. The drawback is that we might migrate python@3.8 to brew tcl-tk too one day. Or when we migrate to python@3.10 we need to remove tcl-tk from python@3.9.
Yeah, me neither, and regarding Let me test the bootstrapping with a pre-compiled python version, I'll keep you up-to-date once it's tested. |
Regarding bootstrapping:
So this does not look like a good solution. |
This sounds like a useful thing to have. I think, however that:
|
Definitely
+100 The goal would be that end-users who don't build from source never have minimal-python installed. |
I opened a PR in brew for the audit: Homebrew/brew#10401 Regarding the name, I went for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Linux, this causes an issue, as this brings in 2 new dependencies for python@3.9: libx11 and libxext.
Just to be explicit: this is a Linux-only, build/CI only issue for us?
For most people this will not change anything as this is a build dependency only.
or use the system python to build xcb-proto and libxcb.
Given it's a need only on CI for us or folks building from source: I'd like to suggest/agree we instead add an in-formula SystemPythonRequirement
that uses the Python in /usr/bin/python
(or /usr/bin/python3
, whatever). That means we can install (if it's not already) python
in the CI environment to use just for this case.
The formula might present some interest for users wanting a lightweight Python version without tcl-tk.
This (and the audit) are reasons I'd like to avoid adding a new formulae if we can.
Yes, as tcl-tk depends on libx11 only for linux. It might be an issue if:
Let me try that. We do ship python3 in our linux CI image. |
a97ac7a
to
f824341
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better, thanks!
This avoids a cyclic dependency on linux.
This avoids a cyclic dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I do have one OCD-induced comment. But I can open another syntax-only PR if it bothers me enough 😄
# Use Python 3, to avoid a cyclic dependency on Linux: | ||
# python3 -> tcl-tk -> libx11 -> libxcb -> xcb-proto -> python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You dropped the word "existing" here.
if this is only relevant to Linux, then I think we need to add some logic to that effect, because I'm now unable to install libxcb on macOS mojave (which doesn't have python3 natively) |
the mojave bottle was dropped after merging this: 0232be2 |
Weird. Looks like there was no Mojave build? How is that. This is a build-time dependency so you should not need it, unless you are not installing in the default prefix. But as there is no bottle ... |
So it did:
|
The fix would be:
|
Can someone open a pull request for libxcb and xcb-proto? |
On it |
I was about to volunteer, thanks @carlocab! |
The current python@3.9 formula depends on brewed tcl-tk.
For Linux, this causes an issue, as this brings in 2 new dependencies
for python@3.9: libx11 and libxext.
These both need xcb-proto and libxcb to build.
And these two dependencies already depend on python@3.9, causing
a dependency circle.
xcb-proto installs some plain python files, which are python-agnostic. Nothing is compiled here, and nothing links against xcb-proto.
The files are installed in:
/home/linuxbrew/.linuxbrew/Cellar/xcb-proto/1.13/lib/python3.9/site-packages/xcbgen/
pkg-config --variable=pythondir xcb-proto will output that path.
This path is defined by whatever Python was used to build xcb-proto.
libxcb does not build without these files.
I propose to intoduce a new Python formula which is ket only,
and which is only used to build xcb-proto and libxcb.
For most people this will not change anything as this is a build dependency only.
The formula might present some interest for users wanting a lightweight Python
version without tcl-tk.
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?