diff --git a/.cargo/config.toml b/.cargo/config.toml index 1bf997d519..0aaf0bbf6c 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,9 +1,9 @@ -[target.'cfg(target_arch = "x64_64")'] +[target.'cfg(target_arch = "x86_64")'] # Require AES-NI on x86-64 by default -rustflags = "-C target-feature=+aes" +rustflags = ["-C", "target-feature=+aes"] [target.'cfg(target_arch = "aarch64")'] # TODO: Try to remove once https://github.com/paritytech/substrate/issues/11538 is resolved # TODO: AES flag is such that we have decent performance on ARMv8, remove once `aes` crate bumps MSRV to at least # 1.61: https://github.com/RustCrypto/block-ciphers/issues/373 -rustflags = "--cfg aes_armv8" +rustflags = ["--cfg", "aes_armv8"] diff --git a/.dockerignore b/.dockerignore index 983f1aefff..68d5d1fb0c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ * +!/.cargo !/crates !/domains !/orml diff --git a/.github/workflows/snapshot-build.yml b/.github/workflows/snapshot-build.yml index 1936bf354b..3a3bfff9a2 100644 --- a/.github/workflows/snapshot-build.yml +++ b/.github/workflows/snapshot-build.yml @@ -91,7 +91,7 @@ jobs: - os: ${{ fromJson(github.repository_owner == 'subspace' && '["self-hosted", "ubuntu-20.04-x86-64"]' || 'ubuntu-20.04') }} target: x86_64-unknown-linux-gnu suffix: ubuntu-x86_64-v2-${{ github.ref_name }} - rustflags: "-C target-cpu=x86-64-v2" + rustflags: "-C target-cpu=x86-64-v2 -C target-feature=+aes" - os: ${{ fromJson(github.repository_owner == 'subspace' && '["self-hosted", "ubuntu-20.04-x86-64"]' || 'ubuntu-20.04') }} target: aarch64-unknown-linux-gnu suffix: ubuntu-aarch64-${{ github.ref_name }} @@ -115,7 +115,7 @@ jobs: - os: ${{ fromJson(github.repository_owner == 'subspace' && '["self-hosted", "windows-server-2022-x86-64"]' || 'windows-2022') }} target: x86_64-pc-windows-msvc suffix: windows-x86_64-v2-${{ github.ref_name }} - rustflags: "-C target-cpu=x86-64-v2" + rustflags: "-C target-cpu=x86-64-v2 -C target-feature=+aes" runs-on: ${{ matrix.build.os }} env: PRODUCTION_TARGET: target/${{ matrix.build.target }}/production diff --git a/Dockerfile-bootstrap-node b/Dockerfile-bootstrap-node index 4eea003fd7..b5c9e62f6b 100644 --- a/Dockerfile-bootstrap-node +++ b/Dockerfile-bootstrap-node @@ -25,6 +25,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml diff --git a/Dockerfile-bootstrap-node.aarch64 b/Dockerfile-bootstrap-node.aarch64 index 0688457823..e338397b70 100644 --- a/Dockerfile-bootstrap-node.aarch64 +++ b/Dockerfile-bootstrap-node.aarch64 @@ -25,6 +25,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml diff --git a/Dockerfile-farmer b/Dockerfile-farmer index e12882b465..186be74565 100644 --- a/Dockerfile-farmer +++ b/Dockerfile-farmer @@ -25,6 +25,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml diff --git a/Dockerfile-farmer.aarch64 b/Dockerfile-farmer.aarch64 index f65198b7a3..42a0dc0e33 100644 --- a/Dockerfile-farmer.aarch64 +++ b/Dockerfile-farmer.aarch64 @@ -25,6 +25,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml diff --git a/Dockerfile-node b/Dockerfile-node index 7b78a40ef9..dd50db59ae 100644 --- a/Dockerfile-node +++ b/Dockerfile-node @@ -25,6 +25,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml diff --git a/Dockerfile-node.aarch64 b/Dockerfile-node.aarch64 index fc47adc9bf..55693d3816 100644 --- a/Dockerfile-node.aarch64 +++ b/Dockerfile-node.aarch64 @@ -25,6 +25,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml diff --git a/Dockerfile-runtime b/Dockerfile-runtime index cca3d8cd80..6be061e62c 100644 --- a/Dockerfile-runtime +++ b/Dockerfile-runtime @@ -24,6 +24,7 @@ RUN \ RUN /root/.cargo/bin/rustup target add wasm32-unknown-unknown +COPY .cargo /code/.cargo COPY Cargo.lock /code/Cargo.lock COPY Cargo.toml /code/Cargo.toml COPY rust-toolchain.toml /code/rust-toolchain.toml