[25.0 backport] Makefile: generate-files: fix check for empty TMP_OUT#47586
Merged
[25.0 backport] Makefile: generate-files: fix check for empty TMP_OUT#47586
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport: Makefile: generate-files: fix check for empty TMP_OUT #47569
relates to / introduced in Make sure that make doesn't rm -rf the system out of existence #47121
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_OUTwas always empty when theifeqwas evaluated, making it not possible to execute thegenerate-filestarget.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)