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

fix: docker: make compatible with arm platform #9363

Merged
merged 2 commits into from
Nov 9, 2022

Conversation

airenas
Copy link
Contributor

@airenas airenas commented Sep 23, 2022

Related Issues

Resolves #9362

Proposed Changes

  1. update rust installation
  2. add possibility to set FFI_BUILD_FROM_SOURCE
  3. fix hardcoded paths: x86_64-linux-gnu

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

1. update rust
2. add possibility to set FFI_BUILD_FROM_SOURCE
3. fix hardcoded paths: x86_64-linux-gnu
@airenas airenas requested a review from a team as a code owner September 23, 2022 06:32
@airenas
Copy link
Contributor Author

airenas commented Sep 23, 2022

to review by @nonsense

Dockerfile.lotus Outdated Show resolved Hide resolved
@LexLuthr
Copy link
Contributor

I am still not able to build for M1.

docker build -t lotus -f Dockerfile.lotus .

results in the below error. Maybe library variables are required?

#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a: error adding symbols: file in wrong format
#25 62.02 collect2: error: ld returned 1 exit status
#25 113.5 make: *** [Makefile:87: lotus] Error 2
------
executor failed running [/bin/sh -c make debug]: exit code: 2#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a(filcrypto-97ad2956f3b9ec65.filcrypto.664d04f7-cgu.0.rcgu.o): Relocations in generic ELF (EM: 62)
#25 62.02 /usr/bin/ld: extern/filecoin-ffi/cgo/../libfilcrypto.a: error adding symbols: file in wrong format
#25 62.02 collect2: error: ld returned 1 exit status
#25 113.5 make: *** [Makefile:87: lotus] Error 2
------
executor failed running [/bin/sh -c make debug]: exit code: 2

@airenas
Copy link
Contributor Author

airenas commented Sep 29, 2022

I am still not able to build for M1.

docker build -t lotus -f Dockerfile.lotus .

results in the below error. Maybe library variables are required?

Sorry for not mentioning it before, @LexLuthr. You need to force building the filecoin-ffi from a source. An install script of the filecoin-ffi downloads the wrong library - issue.
Please try this: docker build -t lotus -f Dockerfile.lotus --build-arg FFI_BUILD_FROM_SOURCE=1 .

@LexLuthr
Copy link
Contributor

That worked


docker images
REPOSITORY   TAG       IMAGE ID       CREATED          SIZE
lotus        latest    307b96bddf2a   40 minutes ago   619MB

Copy link
Member

@nonsense nonsense left a comment

Choose a reason for hiding this comment

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

lgtm, and it was confirmed that build now works on M1

@magik6k magik6k self-requested a review October 18, 2022 22:22
@magik6k magik6k merged commit cf6d7ef into filecoin-project:master Nov 9, 2022
ianconsolata added a commit that referenced this pull request Nov 10, 2022
@airenas airenas deleted the docker-arm branch November 21, 2022 17:33
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.

Dockerfile compatibility with arm platform
4 participants