app-containers/incus: fix cross compilation issue#36323
app-containers/incus: fix cross compilation issue#36323tormath1 wants to merge 1 commit intogentoo:masterfrom
Conversation
Pull Request assignmentSubmitter: @tormath1 app-containers/incus: @juippis, @gentoo/virtualization Linked bugsNo bugs to link found. If your pull request references any of the Gentoo bug reports, please add appropriate GLEP 66 tags to the commit message and request reassignment. If you do not receive any reply to this pull request, please open or link a bug to attract the attention of maintainers. In order to force reassignment and/or bug reference scan, please append Docs: Code of Conduct ● Copyright policy (expl.) ● Devmanual ● GitHub PRs ● Proxy-maint guide |
Pull request CI reportReport generated at: 2024-04-19 13:44 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
juippis
left a comment
There was a problem hiding this comment.
Let's only focus on 6.0.0-r1, older versions should've been dropped already from the tree. I can cherry-pick the 2 commits and squash them.
Can you show me a full build log from a successful build on arm64 system (that I guess is cross-compiled)?
| export GOPATH="${S}/_dist" | ||
| local bindir="_dist/bin" | ||
|
|
||
| if [[ "${GOARCH}" == "arm64" ]]; then |
There was a problem hiding this comment.
I wonder if this shoudn't be more generic, and if it would break things if we are non-cross compiling on arm64:
| if [[ "${GOARCH}" == "arm64" ]]; then | |
| if is_crosscompile; then |
(from toolchain.eclass)
There was a problem hiding this comment.
Thanks, I finally used the opposite (if GOARCH is not amd64) and used tc-is-cross-compile for the bash completion generation.
* explicitly call the *src_unpack * set Go installation PATH if cross compilation is detected Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
1e39411 to
31e1c44
Compare
@juippis thanks for the reply. Commits have been squashed and only It has been tested on Flatcar CI and it emerges correctly for both arch. |
| if ! tc-is-cross-compiler; then | ||
| # Generate and install shell completion files. | ||
| mkdir -p "${D}"/usr/share/{bash-completion/completions/,fish/vendor_completions.d/,zsh/site-functions/} || die | ||
| "${bindir}"/incus completion bash > "${D}"/usr/share/bash-completion/completions/incus || die | ||
| "${bindir}"/incus completion fish > "${D}"/usr/share/fish/vendor_completions.d/incus.fish || die | ||
| "${bindir}"/incus completion zsh > "${D}"/usr/share/zsh/site-functions/_incus || die | ||
| fi |
There was a problem hiding this comment.
You modify the bindir already, isn't this useless now? Whether or not crosscompiling it should resolve to by the former function.
There was a problem hiding this comment.
The issue here is more about using the produced binaries: if you target arm64 and your host is amd64 then calling the incus binary just won't work.
There was a problem hiding this comment.
I'm gonna add an ewarn here about shell completion files not being installed. Rest looks good I guess, thanks!
Pull request CI reportReport generated at: 2024-04-22 16:34 UTC There are existing issues already. Please look into the report to make sure none of them affect the packages in question: |
| if ! tc-is-cross-compiler; then | ||
| # Generate and install shell completion files. | ||
| mkdir -p "${D}"/usr/share/{bash-completion/completions/,fish/vendor_completions.d/,zsh/site-functions/} || die | ||
| "${bindir}"/incus completion bash > "${D}"/usr/share/bash-completion/completions/incus || die | ||
| "${bindir}"/incus completion fish > "${D}"/usr/share/fish/vendor_completions.d/incus.fish || die | ||
| "${bindir}"/incus completion zsh > "${D}"/usr/share/zsh/site-functions/_incus || die | ||
| fi |
There was a problem hiding this comment.
I'm gonna add an ewarn here about shell completion files not being installed. Rest looks good I guess, thanks!
|
https://bugs.gentoo.org/930496 I think I'm gonna try with @Flowdalic's suggestion about modifying the bindir only when tc-is-crosscompiler is detected. Please test it so it works once it's committed. |
Hi, in this PR we fix some cross-compilation issue in the Incus ebuild:
Let me know if I should squash the commits.
When cross-compiling to arm64, the Go environment variables were not properly set from the
go-env.eclassbecause theverify-sigsrc_unpack method was overriding the src-unpack method from thego-module.eclass.Reference: flatcar/scripts#1655