-
Notifications
You must be signed in to change notification settings - Fork 2k
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.include: creation of CACHEDIR.TAG as a dependency of pkg-prepare #20689
Conversation
@Enoch247 you can look at the way I've done it, not sure it's the best way but at least I think it's the intended behavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might consider taking a look at order only prerequisites to accomplish your goal.
You could leave the existing rule to create the tag file as-is. Then just add it as an order-only-prereq to any rules that should create the build dir.
I am still waiting for a review whenever someone is available. Thank you |
From my POV this PR is a strange workaround abusing
So in this form i don't think it is good to go (no positive from me) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way you have used the include
here is really clever, but not the right tool for the job in my opinion. The problem with doing it this way is that it is always run for every possible invocation of make even invocations that should not create anything such as any of the info-*
recipes. This could be a bit of a surprise in environments when write access is not expected. Also, this causes the build dir to be create always, even if not needed (for example make BOARD=native examples/blinky
).
I removed what I have done previously to move the creation of CACHEDIR.TAG as a dependency of pkg-prepare, it fixes my issue and is anyway enough for me. I appreciate the review thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution
Thanks, I will test and review this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to see the prepare
target inside of pkg.mk
depend on $(BUILD_DIR)/CACHEDIR.TAG
, or the prepare
target depending on '$(PKGDIRBASE)' and '$(PKGDIRBASE)' on $(BUILD_DIR)/CACHEDIR.TAG
, but I won't insist on it.
If you decide to keep the current approach, please accept the suggested change for line 807.
@Enoch247 this version is good for me if you have time to review it once more. |
Thank you. I will take a look tomorrow. |
@@ -82,8 +82,15 @@ PKG_CUSTOM_PREPARED ?= | |||
# Declare 'all' first to have it being the default target | |||
all: prepare | |||
|
|||
BUILD_DIR ?= $(RIOTBASE)/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this recipe should be placed outside of this file, as it is at a broader scope than building packages. Perhaps as an include-able makefile in ./makefiles
. However, I will approve as-is.
Contribution description
The cached dir, only build for now, are not created by default so I added a small default target that will create the build dir and the CACHEDIR whenever a make command is called.
Testing procedure
Both commands should have the same behavior now. Previously pkg-prepare was not creating
build/CACHEDIR.TAG
and was creating thebuild/
directory throughpkg/pkg.mk
.Issues/PRs references
N/A