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

Makefile: allow specifying /lib dir location #17846

Merged

Conversation

NotBobTheBuilder
Copy link
Contributor

Hello 👋

This is my first PR to the podman project! I hope it is useful.

When running make install on Ubuntu, I noticed symlinks under /lib to files under /libexec were broken. I tracked it down to /lib being a symlink to /usr/lib on that platform, resulting in relative symlinks being a directory too "short". I included the explanation from the commit message below.

With this patch applied, Ubuntu users can simply specify Make install LIBDIR=/usr/lib and things will work as expected.

There could be some better way (perhaps the makefile could figure this out for itself somehow?) but this is the best I could think of.

Thanks!


On some platforms, /lib is not actually a directory, it is a symlink to /usr/lib:

$ ls -l /lib
lrwxrwxrwx 1 root root 7 Dec  4 17:11 /lib -> usr/lib

When this is the case, "make install" will be operating under a false assumption when it generates any relative symlinks to files under a different root-level directory.

If linking to /libexec/... from /lib/... for example, the generated relative symlink will be 1 parent directory pointer (../) too short.

This PR allows the builder to specify LIBDIR=/usr/lib, explicitly installing files to the target of the symlink. This results in symlinks being generated with the correct depth.

None

On some platforms, /lib is not actually a directory, it is a symlink to
/usr/lib:

    $ ls -l /lib
    lrwxrwxrwx 1 root root 7 Dec  4 17:11 /lib -> usr/lib

When this is the case, "make install" will be operating under a false
assumption when it generates any relative symlinks to files under a
different root-level directory.

If linking to /libexec/... from /lib/... for example, the generated
relative symlink will be 1 parent directory pointer (../) too short.

This PR allows the builder to specify LIBDIR=/usr/lib, explicitly
installing files to the target of the symlink. This results in
symlinks being generated with the correct depth.

Signed-off-by: Jack Wearden <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Mar 19, 2023

LGTM
/approve
Thanks @NotBobTheBuilder

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: NotBobTheBuilder, 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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2023
@baude
Copy link
Member

baude commented Mar 20, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 20, 2023
@openshift-merge-robot openshift-merge-robot merged commit 27903e0 into containers:main Mar 20, 2023
@NotBobTheBuilder NotBobTheBuilder deleted the makefile-lib-dir branch April 6, 2023 22:03
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 2, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants