Skip to content

Makefile: fix DESTDIR environment variable behaviour#5535

Merged
estesp merged 1 commit intocontainerd:masterfrom
oss-qm:submit/makefile-destdir
Jun 3, 2021
Merged

Makefile: fix DESTDIR environment variable behaviour#5535
estesp merged 1 commit intocontainerd:masterfrom
oss-qm:submit/makefile-destdir

Conversation

@metux
Copy link
Copy Markdown
Contributor

@metux metux commented May 25, 2021

The DESTDIR environment variable is used in the wrong way: since 30+ years
it's common practise using it for specifying temporary target root
(where eg. packaging infrastructure picks up the install image), instead
of the installation prefix on the final target.

Fixing this by introducing PREFIX variable (with default /usr/local) and
using both variables according to the 30 years matured common practise.
That way, distro packagers and other standardized build/installation
systems can easily do correct deployments w/o individual hacks.

Signed-off-by: Enrico Weigelt, metux IT consult [email protected]

@k8s-ci-robot
Copy link
Copy Markdown

Hi @metux. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 25, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@Zyqsempai Zyqsempai left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread Makefile Outdated
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Please add a documentation to explain that the behavior of DESTDIR was changed in this release (v1.6).

@mikebrow
Copy link
Copy Markdown
Member

mikebrow commented May 26, 2021

Please add a documentation to explain that the behavior of DESTDIR was changed in this release (v1.6).

DESTDIR is used by scripts and downstream makefiles that we use for local and release installs. There are some release overrides for DESTDIR in the makefile.. and some missing for the local install-deps where the scripts are expecting either a local destdir that includes prefix.. or a override destdir for release... I like the idea of documenting in make help the usage for env variables like DESTDIR...

@metux
Copy link
Copy Markdown
Contributor Author

metux commented May 27, 2021

Please add a documentation to explain that the behavior of DESTDIR was changed in this release (v1.6).

where / how exactly ?

@AkihiroSuda
Copy link
Copy Markdown
Member

where / how exactly ?

Just adding comment lines to Makefile would be fine.
In addition we may copy the text to https://github.com/containerd/containerd/blob/master/BUILDING.md#build-containerd .

@metux metux force-pushed the submit/makefile-destdir branch 2 times, most recently from 8e7acc0 to e0df417 Compare May 27, 2021 17:39
Comment thread BUILDING.md Outdated
Comment thread Makefile Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add the following texts

The files will be installed under `$(DESTDIR)/$(PREFIX)`.
The convention of `DESTDIR` was changed in containerd v1.6.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could you add the following texts

The files will be installed under `$(DESTDIR)/$(PREFIX)`.
The convention of `DESTDIR` was changed in containerd v1.6.

Okay. Directly in the makefile ? Line 21 ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, directly in the makefile around L21 would be fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Puhsed. I've put to above definition of PREFIX.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 27, 2021

Build succeeded.

@metux metux force-pushed the submit/makefile-destdir branch from e0df417 to 9b3821d Compare May 27, 2021 18:33
Copy link
Copy Markdown
Contributor

@alakesh alakesh left a comment

Choose a reason for hiding this comment

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

LGTM if suggested changes to documentation is done.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented May 27, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

The DESTDIR environment variable is used in the wrong way: since 30+ years
it's common practise using it for specifying *temporary* target *root*
(where eg. packaging infrastructure picks up the install image), instead
of the installation *prefix* on the final target.

Fixing this by introducing PREFIX variable (with default /usr/local) and
using both variables according to the 30 years matured common practise.
That way, distro packagers and other standardized build/installation
systems can easily do correct deployments w/o individual hacks.

changes v2: removed variables not used yet
            added documentation

Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
@metux metux force-pushed the submit/makefile-destdir branch from 9b3821d to b5f530a Compare June 1, 2021 08:50
@AkihiroSuda
Copy link
Copy Markdown
Member

/ok-to-test

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jun 1, 2021

Build succeeded.

@AkihiroSuda
Copy link
Copy Markdown
Member

AkihiroSuda commented Jun 2, 2021

/test pull-containerd-node-e2e

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

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.

9 participants