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

lightningd/test/Makefile: add missing dependency on header_versions_gen.h #7859

Merged

Conversation

whitslack
Copy link
Collaborator

lightningd/test/run-find_my_abspath.c includes ../lightningd.c, which includes header_versions_gen.h, a generated header file.

lightningd/Makefile correctly declares that lightningd/lightningd.o depends on header_versions_gen.h, but lightningd/test/Makefile lacks any such declaration regarding lightningd/test/run-find_my_abspath.c, which leads to build failure:

In file included from lightningd/test/run-find_my_abspath.c:5:
lightningd/test/../lightningd.c:64:10: fatal error: header_versions_gen.h: No such file or directory
   64 | #include <header_versions_gen.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~

Declare the missing dependency in lightningd/test/Makefile so that Make will ensure that header_versions_gen.h is generated before it attempts to build lightningd/test/run-find_my_abspath.o.

Changelog-None


Important

24.11 FREEZE NOVEMBER 7TH: Non-bugfix PRs not ready by this date will wait for 25.02.

Checklist

Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes.

…en.h

lightningd/test/run-find_my_abspath.c includes ../lightningd.c, which includes
header_versions_gen.h, a generated header file.

lightningd/Makefile correctly declares that lightningd/lightningd.o depends on
header_versions_gen.h, but lightningd/test/Makefile lacks any such declaration
regarding lightningd/test/run-find_my_abspath.c, which leads to build failure:

In file included from lightningd/test/run-find_my_abspath.c:5:
lightningd/test/../lightningd.c:64:10: fatal error: header_versions_gen.h: No such file or directory
   64 | #include <header_versions_gen.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~

Declare the missing dependency in lightningd/test/Makefile so that Make will
ensure that header_versions_gen.h is generated before it attempts to build
lightningd/test/run-find_my_abspath.o.

Changelog-None
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering when this build error is hit in your setup?

@whitslack
Copy link
Collaborator Author

Wondering when this build error is hit in your setup?

What do you mean? It's hit during build. make -jN, where N is some number greater than 1. You have to tell Make the dependencies of each and every target that it can build, or it might try to build a target without first building that target's dependencies.

gentoo-repo-qa-bot pushed a commit to gentoo-mirror/bitcoin that referenced this pull request Nov 23, 2024
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 8165f99

What do you mean?

I just asked because I compile core lightning with no problem and I was wondering what was the way to reproduce it. Thanks for clarify it!

@vincenzopalazzo vincenzopalazzo merged commit 7a20068 into ElementsProject:master Nov 23, 2024
35 of 39 checks passed
@whitslack
Copy link
Collaborator Author

I just asked because I compile core lightning with no problem and I was wondering what was the way to reproduce it.

@vincenzopalazzo: It's a probabilistic failure, apparently with a very low probability of occurring. I have done hundreds of full builds of CLN, with both hot and cold ccaches, and have never run into this particular failure before. Such is the nature of race conditions, though: if an ordering can occur, then it will occur eventually. Best to specify correct deps in the Makefile so that it never occurs. Thanks for merging.

@whitslack whitslack deleted the missing-header-dep branch November 23, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants