Makefile.include: creation of CACHEDIR.TAG as a dependency of pkg-prepare#20689
Makefile.include: creation of CACHEDIR.TAG as a dependency of pkg-prepare#20689Enoch247 merged 1 commit intoRIOT-OS:masterfrom
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 |
Enoch247
left a comment
There was a problem hiding this comment.
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) |
Enoch247
left a comment
There was a problem hiding this comment.
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. |
kfessel
left a comment
There was a problem hiding this comment.
Thank you for your contribution
|
Thanks, I will test and review this weekend. |
Enoch247
left a comment
There was a problem hiding this comment.
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. |
| # Declare 'all' first to have it being the default target | ||
| all: prepare | ||
|
|
||
| BUILD_DIR ?= $(RIOTBASE)/build |
There was a problem hiding this comment.
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.TAGand was creating thebuild/directory throughpkg/pkg.mk.Issues/PRs references
N/A