Giter Club home page Giter Club logo

Comments (4)

juniuszhou avatar juniuszhou commented on August 23, 2024 5

Since the cross compilation doesn't work, to get the binary substrate in ARM, the workaround is to get WASM blobs in x86 platform. Then copy WASM blobs into ARM platform and complete compilation there.
I got substrate binary in AWS a1. The detail process as following:

  1. to get WASM blobs, compile substrate in x86 environment at first.
    1.1 clone source code
    git clone https://github.com/paritytech/substrate
    1.2 compile substrate, for reference:
    https://github.com/paritytech/substrate#hacking-on-substrate
    1.3 because of a bug for rust compiler, use nightly 2019-10-13
    rustup install nightly-2019-10-13
    cargo +nightly-2019-10-13 install --release

  2. switch to ARM platform then compile substrate
    2.1 clone source code
    git clone https://github.com/paritytech/substrate
    2.2 skip WASM compilation via setting
    export SKIP_WASM_BUILD='true'
    2.3 compile substrate, for reference:
    https://github.com/paritytech/substrate#hacking-on-substrate
    2.4 because of a bug for rust compiler, use nightly 2019-10-13
    rustup install nightly-2019-10-13
    cargo +nightly-2019-10-13 install --release
    2.5 until compilation stopped, there is a message about wasm_binary.rs file missing. copy the file path and edit it.
    vi target/release/build/node-runtime-XXXXXXXXXX/wasm_binary.rs
    2.6 adding two lines of code. the content should be changed according to your compilation path.
    pub const WASM_BINARY: &[u8] = include_bytes!("/home/ubuntu/code/paritytech/substrate/target/release/wbuild/node-runtime/node_runtime.compact.wasm");
    pub const WASM_BINARY_BLOATY: &[u8] = include_bytes!("/home/ubuntu/code/paritytech/substrate/target/release/wbuild/target/wasm32-unknown-unknown/release/node_runtime.wasm");
    2.7 copy target/release/wbuild folder from x86 to target/release/wbuild
    scp ...........
    2.8 continue building
    cargo +nightly-2019-10-13 install --release
    2.9 end of building, get the binary successfully.

from hacktoberfest.

juniuszhou avatar juniuszhou commented on August 23, 2024

I'd like to work on the issue and it is from real business requirement.

from hacktoberfest.

gnunicorn avatar gnunicorn commented on August 23, 2024

great, @juniuszhou , it's all yours. Let us know (best via chat or as a comment here), if there is anything you need from us or anything we can help with.

from hacktoberfest.

riusricardo avatar riusricardo commented on August 23, 2024

Nice! I'm glad to see that it worked :)

Just a reminder from our conversation.

I would like to suggest to keep it in the issue but clean your comment. Create a nice markdown format and general instructions.
It will also help if you add more details about the wasm_binary.rs file/paths.

from hacktoberfest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.