-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
podman: Change hardcoded libexec path #90379
Conversation
This was the error, on Linux: (/home/linuxbrew)
|
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.
Thanks for your PR, @afbjorklund.
Please use the preferred commit-message style for homebrew/core. We put the name of the formula first in commit-message headings. Here's a quick summary from the style guide:
For new formulae:
At Homebrew, we like to put the name of the formula up front like so:
foobar 7.3 (new formula)
.
For existing formulae:
The preferred commit message format for simple version updates is
foobar 7.3
and for fixes isfoobar: fix flibble matrix.
.
Refer to the commit style guide for more details. Also, when making further changes to your pull request, use the following guidelines to make sure that @BrewTestBot can merge your commits:
- One formula per commit; one commit per formula.
- Keep merge commits out of the pull request.
Formula/podman.rb
Outdated
# Remove hardcoded paths | ||
patch :DATA |
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.
Has this patch been upstreamed?
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.
Nope, upstream says it should be fixed by downstream...
i.e. they hardcoded some common brew paths
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.
The patch isn't strictly required, we can loop through all the unused paths first if preferred
Also the change is in a dependency (separate project), which is statically linked
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.
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.
Would the inreplace
suffice without the patch? We don't carry patches that won't get accepted upstream. (With a handful of exceptions for patches that were made before this was made a policy, but even those could face the chopping block at some point.)
It also seems a bit weird to me for upstream to add Homebrew-specific paths that we would then remove here. Does a similar issue not affect other, non-Homebrew, users, who don't install into /usr
or /usr/local
?
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.
See containers/podman#12161 (comment)
I did see that, but didn't we just establish above that this issue is not Homebrew-specific? Or was the conclusion above that this affects non-Homebrew users who install into non-standard locations incorrect?
The right thing would be for "catatonit" and "gvproxy" to be dependencies, not bundled.
See #87116 (comment). Though I'm not sure how having gvproxy
be a dependency fixes the issue about hard-coded paths.
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.
I don't think they support Homebrew outside of standard prefix, or running on Linux (linuxbrew)
So all other Linux distributions have to patch the search paths in a similar way, or add symlinks.
Presumably if gvproxy
was a system dependency, it would be able to find it in some path...
Currently it is a separate package on Ubuntu - with a hardcoded path leading to Podman. :-(
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.
Actually it seems the standalone gvproxy path was already tried (and rejected), so "libexec" it is.
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.
I don't think they support Homebrew outside of standard prefix, or running on Linux (linuxbrew)
Those are not separate projects anymore so they really just support half of Homebrew.
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.
It would be "fun" to see FreeBSDBrew, just like there was some stuff done for DarwinPorts
Basically we tried to run the basic system without the Apple bits, to keep it portable...
And without hardcoding "if apple else gnu". It was surprisingly difficult to do, though.
I changed the commit, but the PR headline wasn't updated |
Formula/podman.rb
Outdated
# Remove hardcoded paths | ||
patch :DATA |
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.
Would the inreplace
suffice without the patch? We don't carry patches that won't get accepted upstream. (With a handful of exceptions for patches that were made before this was made a policy, but even those could face the chopping block at some point.)
It also seems a bit weird to me for upstream to add Homebrew-specific paths that we would then remove here. Does a similar issue not affect other, non-Homebrew, users, who don't install into /usr
or /usr/local
?
The path to helper binaries were hardcoded, so it didn't work for home directory and other relocated installations. Also the "gvproxy" program has been moved from a subdirectory to the top libexec directory in Homebrew, so set the new path. Signed-off-by: Anders F Björklund <[email protected]>
4e12dfb
to
a9d5b7a
Compare
Removed all the patches, so now it just changes the hardcoded prefix to the one in the cellar. anders@ubuntu:/home/linuxbrew$ ./.linuxbrew/bin/podman-remote machine start
INFO[0000] waiting for clients...
INFO[0000] listening tcp://0.0.0.0:7777
INFO[0000] new connection from @ to /run/user/1000/podman/qemu_podman-machine-default.sock
Waiting for VM ...
Machine "podman-machine-default" started successfully |
Is this also submitted as a patch upstream? |
Patches were removed, upstream has all the "usual" homebrew search paths hardcoded. It's not possible to patch the dynamic part upstream, so it has to be edited downstream... system "make", "gvproxy"
libexec.install "bin/gvproxy" inreplace "vendor/github.com/containers/common/pkg/config/config_linux.go", "/usr/local/libexec/podman", libexec
inreplace "vendor/github.com/containers/common/pkg/config/config_darwin.go", "/usr/local/libexec/podman", libexec Upstream says that it is homebrew's problem, that it allows users to relocate the prefix: var defaultHelperBinariesDir = []string{
// Homebrew install paths
"/usr/local/opt/podman/libexec",
"/opt/homebrew/bin",
"/opt/homebrew/opt/podman/libexec",
"/usr/local/bin",
// default paths
"/usr/local/libexec/podman",
"/usr/local/lib/podman",
"/usr/libexec/podman",
"/usr/lib/podman",
} It doesn't support linuxbrew, user will have to add some configuration before it starts. |
What about people who want to install their software outside of homebrew? This seems like a really shortsighted idea to me. |
Currently you have to either patch it, or supply default configuration... Basically it supports both prefixes, Any other location of the helper binaries, is left to the packager's discretion: |
Preferrably, "gvproxy" should be relocated to the default path (i.e. under the prefix) --- a/Formula/podman.rb
+++ b/Formula/podman.rb
@@ -38,7 +38,7 @@ class Podman < Formula
ENV["CGO_ENABLED"] = "1"
os = OS.kernel_name.downcase
- inreplace "vendor/github.com/containers/common/pkg/config/config_#{os}.go", "/usr/local/libexec/podman", libexec
+ inreplace "vendor/github.com/containers/common/pkg/config/config_#{os}.go", "/usr/local/libexec/podman", libexec/"podman"
system "make", "podman-remote-#{os}"
if OS.mac?
@@ -50,7 +50,7 @@ class Podman < Formula
resource("gvproxy").stage do
system "make", "gvproxy"
- libexec.install "bin/gvproxy"
+ (libexec/"podman").install "bin/gvproxy"
end
if build.head? That would make it more similar to other platforms and to the default Also makes the top directory less cluttered, when the other helpers are added too ?
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Applies the patch suggested in Homebrew#90379 (comment). Refs: Homebrew#90379
Applies the patch suggested in #90379 (comment). Refs: #90379 Closes #93794. Signed-off-by: Carlo Cabrera <[email protected]> Signed-off-by: BrewTestBot <[email protected]>
Podman had hardcoded paths for brew, which means it doesn't work for user installations.
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 --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?Closes: