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

Makefile: make 4.2.1 is not respecting Heads logic verification for already extracted packages #799

Closed
tlaurion opened this issue Aug 12, 2020 · 4 comments · Fixed by #808
Assignees

Comments

@tlaurion
Copy link
Collaborator

We can see the result here when a cache is restored without hacks:
https://app.circleci.com/pipelines/github/tlaurion/heads/293/workflows/e50cfc8b-c61f-474b-b2de-476e3cee845d/jobs/319/parallel-runs/0/steps/0-107

We see here that the build fails since make was already extracted there and the patch was already applied.
@osresearch ?

My hack was to delete that directory prior of building when qemu-coreboot was first built here, but it would be nice if make was also respecting Heads build system logic.

tlaurion added a commit to tlaurion/heads that referenced this issue Aug 12, 2020
tlaurion added a commit to tlaurion/heads that referenced this issue Aug 12, 2020
@tlaurion
Copy link
Collaborator Author

Applied fix here which fixes the issue until fixed under Heads buildsystem

tlaurion added a commit to tlaurion/heads that referenced this issue Aug 12, 2020
tlaurion added a commit that referenced this issue Aug 12, 2020
@osresearch
Copy link
Collaborator

Is the cache being restored with the time stamps intact or are they all new? If a normal copy is done, then depending on the copy order, the $(build)/$(make_dir)/.patch file might be older than the patches/make-$(make_version).patch file, which leads to the patch attempt.

As a quick hack, the assumption could be made that make will never be re-patched in normal operation:

diff --git a/Makefile b/Makefile
index 084ad03..10faebf 100644
--- a/Makefile
+++ b/Makefile
@@ -602,8 +602,8 @@ $(build)/$(make_dir)/.extract: $(packages)/$(make_tar)
 	tar xf "$<" -C "$(build)"
 	touch "$@"
 
-$(build)/$(make_dir)/.patch: patches/make-$(make_version).patch $(build)/$(make_dir)/.extract
-	( cd "$(dir $@)" ; patch -p1 ) < "$<"
+$(build)/$(make_dir)/.patch: $(build)/$(make_dir)/.extract
+	( cd "$(dir $@)" ; patch -p1 ) < "patches/make-$(make_version).patch"
 	touch "$@"
 
 $(build)/$(make_dir)/.configured: $(build)/$(make_dir)/.patch

@tlaurion
Copy link
Collaborator Author

@osresearch : my concern here is that this module is the only one acting this way.

@osresearch
Copy link
Collaborator

The bootstrap make module is special; the other modules are handled by this logic: https://github.com/osresearch/heads/blob/master/Makefile#L269

Which both extracts and patches in one step, so that there is a clean-ish version of the tree when patch runs on it.

tlaurion added a commit to tlaurion/heads that referenced this issue Aug 19, 2020
… remove CircleCI hack. Will have to clean CircleCI cache and test.
tlaurion added a commit to tlaurion/heads that referenced this issue Aug 19, 2020
) and remove CircleCI hack. Will have to clean CircleCI cache and test.

- We readd {{ .Environment.CACHE_VERSION }} so that CircleCI has a manual way of changing CACHE_VERSION env variable to rebuild cache in case of problems
- Makefile modified to fix make repatching when cache is exctracted
- CircleCI modified to not delete make directory
tlaurion added a commit to tlaurion/heads that referenced this issue Aug 20, 2020
tlaurion added a commit that referenced this issue Aug 20, 2020
* CircleCI: debian:10 docker based. Give possitility to override CACHE_VERSION through CircleCI when needed
* Makefile: fix #799 with implementation of @osresearch's recommended #799 (comment)
* modules/coreboot : indentation fix and putting version hashes together to facilitate future maintainership.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants