-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 machine start cannot find gvproxy when brew is not installed in the standard directory #12161
Comments
see #11960 |
I reported it here because I thought it was podman installing and executing As it is only located inside podman's installation folder: |
gvproxy is installed by homebrew as a dependency in the podman libexec folder. homebrew does not recommend installing in another directory, and in the docs there is a warning that things may break when homebrew is installed in another place. |
I know, but Can it then be a new feature? It would be great for people that do not have Thanks. |
This comment has been minimized.
This comment has been minimized.
@afbjorklund for most places, it would link to |
This comment has been minimized.
This comment has been minimized.
Unfortunately, it looks like the formula is broken. resource("gvproxy").stage do
system "make", "gvproxy"
libexec.install "bin/gvproxy"
end It installs under It was supposed to be in a "podman" subdirectory ? So those hardcoded paths are all wrong:
Or at least different to the normal ones:
Maybe other binaries go straight into libexec... Then again, upstream is even worse:
So I guess it needs to be "translated": --- a/Formula/podman.rb
+++ b/Formula/podman.rb
@@ -37,6 +37,9 @@ class Podman < Formula
def install
os = OS.kernel_name.downcase
+ 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
+
system "make", "podman-remote-#{os}"
if OS.mac?
bin.install "bin/#{os}/podman" => "podman-remote" Then the hardcoded paths aren't needed. @@ -17,12 +17,6 @@
}
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",
|
|
Right, here they translate to: HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew prefix: /home/linuxbrew/.linuxbrew/Cellar/podman/3.4.1 And have to use It installs as a special user (with sudo), just to share precompiled binaries. I could have installed it under /home/anders, and compiled everything... https://docs.brew.sh/Homebrew-on-Linux
|
A friendly reminder that this issue had no activity for 30 days. |
Where do we stand on this issue? Is it still a problem? |
I don't think this is an issue that should be fixed on our end, its more of a homebrew install issue, and homebrew specifically states that some packages may break if not installed in their default location |
They forgot to patch the default config, with the current path to use. Could try a PR (for brew), to replace the hardcoded values ? I guess any Linux distribution not using |
This comment has been minimized.
This comment has been minimized.
I would say it is good for the community in general to have this fixed. I raised this ticket because if your computer is blocked by the company you work for, and you don't have admin/sudo rights, installing on a custom directory is the only option. |
You can provide your custom directory in configuration, if Homebrew and Podman doesn't want to fix their packaging |
This comment has been minimized.
This comment has been minimized.
Homebrew prefers to have their packages unpatched, so left all the unused paths in there.
|
It seems weird to call this a Homebrew install issue when this is also causing problems for users who aren't even using Homebrew. See #11960 (also referenced above). |
Technically it is a problem for all "weird" installations that don't use the "usual" But there really isn't any good substitute for * note: you can use Anyway, the path locations needs to be updated:
|
This is an issue for nix installs |
as a workaround, add this to [engine]
helper_binaries_dir = [
"{PATH_TO_GPROXY_BIN}",
"/usr/local/libexec/podman",
"/usr/local/lib/podman",
"/usr/libexec/podman",
"/usr/lib/podman",
] on my Mac system using Nix the path is I'll work on a PR for nixpkgs soon |
It could be a problem to set one "helper" dir, if you spread the podman helpers into different packages. On some system they have relocated them into the podman libexec, while others use a global libexec. https://packages.debian.org/sid/catatonit https://github.com/macports/macports-ports/blob/master/net/gvisor-tap-vsock/Portfile Possibly one could use symlinks, or something... Use one podman libexec prefix, linking to the others ? |
@ashley-cui I think at this stage it's fairly clear that this issue isn't specific to Homebrew. Perhaps you'd reconsider implementing a solution in this project? It seems really inefficient for your various downstream distributors to have to carry around duplicate pieces of code to work around this issue. |
@carlocab I'll bring it up with the team and see what the consensus is. I think we've gone back and forth a lot on where this gvproxy binary should live, but I can bring it up again. |
I don't think it's really a matter of where it should live: I think the above thread shows that that's something difficult to control. To me, it's a matter of providing a mechanism for telling |
@carlocab I will add that there is no way i have found to resolve this when installing podman via nix. Even manually telling it where gvproxy is via editing the config does not let things work |
@bowbahdoe something that works for us currently is to replace these lines:
with the absolute path to directory we expect to contain |
@bowbahdoe I'm guessing you tried adding my example path? If your nixpkgs is at all different you will get a different derivation and output path. You can get yours by running Example:
|
Alright, we'll look into a solution where a location can be set during compile-time using our makefile. |
I don't understand how Nix can work, without some PATH directory to put the symlinks in (like brew) ?
Surely you don't add the installation directory for each and every little package, to the global variable ? EDIT: Right, it was called a "user environment" (the symlink forest) But the main hack is to make sure that gvisor-tap-proxy is part of the podman package, not separate.
(brew and port decided to drop the "podman" dir) Had it been a real program, it would already have been in the PATH and easy to find at runtime. Here it is in the podman spec: https://src.fedoraproject.org/rpms/podman/blob/rawhide/f/podman.spec
|
@ashley-cui : afaik, you already set PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
LIBEXECDIR ?= ${PREFIX}/libexec
LIBEXECPODMAN ?= ${LIBEXECDIR}/podman
MANDIR ?= ${PREFIX}/share/man
SHAREDIR_CONTAINERS ?= ${PREFIX}/share/containers
ETCDIR ?= ${PREFIX}/etc -X $(LIBPOD)/config._installPrefix=$(PREFIX) \
-X $(LIBPOD)/config._etcDir=$(ETCDIR) \ So need to do something similar for the helpers ( |
Closed via: #13372 Example usage: |
I'm facing the same issue on MacOs 11.6.4, attempting to get the latest version of podman up and running. I see this has been fixed but is there any special step I need to do before I have installed the latest Everything was done using |
@deadpyxel there is always this workaround: #12161 (comment) but you should really open an issue on the homebrew formula, it's in the hands of the package maintainers now |
I'll check that. It seems Problem is that I can't apply the patch proposed since there's no |
This should make it easier to locate helper binaries relative to where the main binary was installed, which should be useful in installations such as Homebrew which install packages under a versioned directory. Use a `$BINDIR` magic token as a prefix in the helper path to indicate it should be relative to the directory where the binary is located. This is somewhat familiar to the syntax used in the shell and Makefile and is still quite explicit about the behavior (as opposed to, say, making all relative paths be relative to the directory of the binary.) Update `podman` config on Darwin to look for helpers such as `gvproxy` under `$BINDIR/../libexec/podman`, which is the ultimate objective of this code change. Tested: Updated vendored package in podman, built it with `podman-remote`, copied `gvproxy` to a `libexec/podman` at the same level as `bin/podman` and confirmed that `podman machine start` worked as expected. Fixes: containers/podman#12161 Related: PR containers#946 Signed-off-by: Filipe Brandenburger <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
It is not possible to run
podman machine start
when brew is not installed in the default location.Steps to reproduce the issue:
Install
brew
on your user directory, as described in the official docs:mkdir ~/homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C ~/homebrew
Install
podman
Describe the results you received:
podman machine start
returns:Describe the results you expected:
Podman should be able to find its install location and pick up the
gvproxy
bin inside itslibexec
folder.I can confirm that
gvproxy
IS inside~/homebrew/Cellar/podman/3.4.1/libexec/
folder.Output of
podman version
:Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
MacOS Big Sur 11.3.1
The text was updated successfully, but these errors were encountered: