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

[25.0 backport] Makefile: generate-files: fix check for empty TMP_OUT #47586

Merged
merged 1 commit into from Mar 19, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 19, 2024

commit c655b7d added a check to make sure the TMP_OUT variable was not set to an empty value, as such a situation would perform an rm -rf /** during cleanup.

However, it was a bit too eager, because Makefile conditionals (ifeq) are evaluated when parsing the Makefile, which happens before the make target is executed.

As a result $@_TMP_OUT was always empty when the ifeq was evaluated, making it not possible to execute the generate-files target.

This patch changes the check to use a shell command to evaluate if the var is set to an empty value.

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

commit c655b7d added a check to make sure
the TMP_OUT variable was not set to an empty value, as such a situation would
perform an `rm -rf /**` during cleanup.

However, it was a bit too eager, because Makefile conditionals (`ifeq`) are
evaluated when parsing the Makefile, which happens _before_ the make target
is executed.

As a result `$@_TMP_OUT` was always empty when the `ifeq` was evaluated,
making it not possible to execute the `generate-files` target.

This patch changes the check to use a shell command to evaluate if the var
is set to an empty value.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 25c9e6e)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added area/testing kind/bugfix PR's that fix bugs labels Mar 19, 2024
@vvoland vvoland added this to the 25.0.5 milestone Mar 19, 2024
@vvoland vvoland self-assigned this Mar 19, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 9df9ccc into moby:25.0 Mar 19, 2024
126 checks passed
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.

None yet

2 participants