Skip to content

Separate external by host#3469

Merged
rustyrussell merged 2 commits into
ElementsProject:masterfrom
NickeZ:separate-external-by-host
Feb 4, 2020
Merged

Separate external by host#3469
rustyrussell merged 2 commits into
ElementsProject:masterfrom
NickeZ:separate-external-by-host

Conversation

@NickeZ
Copy link
Copy Markdown
Contributor

@NickeZ NickeZ commented Jan 29, 2020

Ideally we would support out-of-source-tree builds. But until then we can at least separate the external dependencies per architecture.

The problem I ran into is that we want to cache external dependencies in CI. But this means that the cached files are compiled for the wrong host when we cross-compile.

This PR will compile all dependencies outside their soure trees. The "native" files will stay in external. cross compiled files will go into external/<host-triplet> like external/aarch64-linux-gnu.

The first time you build this PR you might need to wipe your dependencies. Since currently we are building "in-source-tree" automake will complain loudly if you try to build "out-of-source-tree" without cleaning up first.

Changelog-None

@NickeZ
Copy link
Copy Markdown
Contributor Author

NickeZ commented Jan 29, 2020

I had to bump libwally-core as well since they had a bug regarding out-of-tree builds.

Copy link
Copy Markdown
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Just needs to squash and a meaningful commit msg, thanks!

Comment thread external/Makefile Outdated
$(RM) $(EXTERNAL_LIBS) $(TARGET_DIR)/*.la $(TARGET_DIR)/*.o
if [ -f ${TARGET_DIR}/libsodium-build/Makefile ]; then make -C ${TARGET_DIR}/libsodium-build clean; fi
if [ -f ${TARGET_DIR}/libwally-core-build/Makefile ]; then make -C ${TARGET_DIR}/libwally-core-build clean; fi
if [ -f ${TARGET_DIR}/ibwally-core-build/src/Makefile ]; then make -C ${TARGET_DIR}/libwally-core-build/src clean; fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, note the (preexisting!) "ibwally-core" typo!

@niftynei
Copy link
Copy Markdown
Collaborator

I had to bump libwally-core as well since they had a bug regarding out-of-tree builds.

cc'ing @cdecker re: libwally update

@NickeZ NickeZ force-pushed the separate-external-by-host branch from 11762f2 to b234b7f Compare January 31, 2020 17:17
@NickeZ
Copy link
Copy Markdown
Contributor Author

NickeZ commented Jan 31, 2020

Fixed the pre-existing bug and improved the commit message. Thanks for the reviews.

On CI it is nice to cache the external dependencies. However if we
always compile them in the same folder we cannot cache for multiple
different architectures. After this commit native compile targets will
still live in `external` but cross compiled versions will live in
`external/<arch>`.
@cdecker cdecker force-pushed the separate-external-by-host branch from b234b7f to db97a44 Compare January 31, 2020 21:48
@cdecker
Copy link
Copy Markdown
Member

cdecker commented Jan 31, 2020

I allowed myself to rephrase the commit message for the wally bump.

ACK db97a44

@rustyrussell rustyrussell merged commit f9b3b96 into ElementsProject:master Feb 4, 2020
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.

4 participants