Skip to content
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

Add additionalHelperBinariesDir #946

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

ashley-cui
Copy link
Member

Different packaging for different distributions have their own prefix for where helper binaries should live. additionalHelperBinariesDir is a variable that can be set during link-time so that a packager can change the location without having to carry patches for their default location.

[NO NEW TESTS NEEDED]
I have no idea how to test this.

Signed-off-by: Ashley Cui [email protected]

Different packaging for different distributions have their own prefix for where helper binaries should live. additionalHelperBinariesDir is a variable that can be set during link-time so that a packager can change the location without having to carry patches for their default location.

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <[email protected]>
@ashley-cui
Copy link
Member Author

ashley-cui commented Feb 28, 2022

Partially solves #12161

// additionalHelperBinariesDir is an extra helper binaries directory that
// should be set during link-time, if different packagers put their
// helper binary in a different location
additionalHelperBinariesDir string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a list rather then just one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the go linker only allows you to set strings? Not sure though. An alternative would be to take a string, split it by commas, and then put it into a list to allow setting more than one additional helper binary dir.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I thought this was a function call.
LGTM

@rhatdan
Copy link
Member

rhatdan commented Feb 28, 2022

@containers/podman-maintainers PTAL

@TomSweeneyRedHat
Copy link
Member

LGTM

@rhatdan
Copy link
Member

rhatdan commented Feb 28, 2022

/lgtm

@rhatdan
Copy link
Member

rhatdan commented Feb 28, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashley-cui, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 9880eb4 into containers:main Feb 28, 2022
filbranden added a commit to filbranden/common that referenced this pull request Aug 22, 2022
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]>
@ashley-cui ashley-cui deleted the binarypaths branch October 4, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants