Makefile: work better with parallel make
Add some dependency information to the Makefile so that it doesn't fail if make is run with -j # (e.g. because MAKEFLAGS includes -j #).
Merge request reports
Activity
added 14 commits
- 130f3eae...f241da3e - 13 commits from branch
gitlab-org:master
- b7c293d0 - Makefile: work better with parallel make
- 130f3eae...f241da3e - 13 commits from branch
@dturner_ts I am not 100% sure we should go down this path. This Makefile is... fragile in places. The moment we introduce more dependencies, the whole thing becomes more sensitive to time stamps (because half of the targets correspond to files and directories). This leads to bugs where things don't get built because Make thinks they're new enough.
Another surprising thing about this Makefile is that things like config files that get generated from config.example files don't depend on those .example files in the Make sense. Otherwise custom config would get nuked every time you run
make
.TL;DR GDK uses Make in 'bad'/unusual ways. What you're doing here is risky.
Edited by Jacob Vosmaer (GitLab)I agree with @jacobvosmaer-gitlab. We also plan to phase the
Makefile
out, so I'm not sure if these changes are needed. What do you think @dturner_ts?Any Makefile is going to be sensitive to timestamps -- that's how Make works. It seems surprising to me that adding dependencies could make things not get built. Is that what you believe can happen?
If you're worried that performance on second and subsequent runs will be worse because stuff will be built unnecessarily, that seems reasonable: perhaps I chose the wrong dependencies. And if you're worried that edited files will get overwritten, perhaps the right thing to do is to have a separate task for initialization.
But if you're going to phase out the Makefile anyway, then a temporary fix will work. So let me just test adding .NOTPARALLEL: to the file.
@jacobvosmaer-gitlab @grzesiek What do you think about the above?
@dturner_ts I think that
.NOTPARALLEL
is a reasonable solution for now. Thanks for suggesting it!I'm not sure why the tests failed. There is no output on the failed job.
@grzesiek shall we just merge this?
@dturner_ts Can you re-trigger the pipeline? I will merge after it succeeds!
@dturner_ts You need to enable shared runners in your fork project
@dturner_ts You need to trigger a manual action that is located in first stage of your pipeline.
Thanks @dturner_ts!
mentioned in commit 51a9388b