From 2aabb09468b82aef2d3450ea94444e4430e7bf47 Mon Sep 17 00:00:00 2001 From: Howard Wu Date: Wed, 31 Mar 2021 22:14:03 -0700 Subject: [PATCH 1/3] Adds a noconfig feature for release builds --- .cargo/config | 2 +- .github/workflows/release.yml | 6 +++--- Cargo.toml | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.cargo/config b/.cargo/config index 7c6d594717..932cf0b635 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,2 +1,2 @@ -[target.'cfg(not(target_arch = "wasm32"))'] +[target.'cfg(any(not(target_arch = "wasm32"), feature = "release"))'] rustflags = ["-C", "target-cpu=native"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f65b75fc4f..0dfacf2351 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Build Leo run: | - cargo build --all --release && strip target/release/leo + cargo build --all --release --features noconfig && strip target/release/leo env: CARGO_NET_GIT_FETCH_WITH_CLI: true @@ -67,7 +67,7 @@ jobs: - name: Build Leo run: | - cargo build --all --release && strip target/release/leo + cargo build --all --release --features noconfig && strip target/release/leo env: CARGO_NET_GIT_FETCH_WITH_CLI: true @@ -118,7 +118,7 @@ jobs: - name: Build Leo run: | - cargo build --all --release + cargo build --all --release --features noconfig env: CARGO_NET_GIT_FETCH_WITH_CLI: true diff --git a/Cargo.toml b/Cargo.toml index 38dc4f2418..46f2e3d7cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -155,8 +155,10 @@ version = "0.5" version = "0.11.2" [features] -default = [ ] +default = [] ci_skip = [ "leo-compiler/ci_skip" ] +# This feature flag is used to disable `target-cpu=native` in `.cargo/config`. +noconfig = [] [profile.release] opt-level = 3 From 54192f25895bff9fe32e043e25d8aa0c2a40d237 Mon Sep 17 00:00:00 2001 From: Howard Wu Date: Wed, 31 Mar 2021 23:14:01 -0700 Subject: [PATCH 2/3] Update CI to 1.51 --- .circleci/config.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b8dd6eeddb..6099e4ae35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,7 +44,7 @@ jobs: rust-stable: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - checkout @@ -62,7 +62,7 @@ jobs: rust-nightly: docker: - - image: howardwu/snarkos-ci:2021-01-31 + - image: howardwu/snarkos-ci:2021-03-25 resource_class: xlarge steps: - checkout @@ -77,8 +77,8 @@ jobs: leo-executable: docker: - - image: cimg/rust:1.50.0 - resource_class: xlarge + - image: cimg/rust:1.51.0 + resource_class: 2xlarge steps: - checkout - setup_environment: @@ -95,7 +95,7 @@ jobs: leo-new: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -108,7 +108,7 @@ jobs: leo-init: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -121,7 +121,7 @@ jobs: leo-clean: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -134,7 +134,7 @@ jobs: leo-setup: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -147,7 +147,7 @@ jobs: leo-add-remove: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -160,7 +160,7 @@ jobs: leo-login-logout: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -173,7 +173,7 @@ jobs: leo-clone: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: @@ -186,7 +186,7 @@ jobs: leo-publish: docker: - - image: cimg/rust:1.50.0 + - image: cimg/rust:1.51.0 resource_class: xlarge steps: - attach_workspace: From 2a2b9994d0bc7de410efa9df9beb66957ac44402 Mon Sep 17 00:00:00 2001 From: Howard Wu Date: Wed, 31 Mar 2021 23:20:10 -0700 Subject: [PATCH 3/3] Lock the cargo file --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6099e4ae35..4dc51b709b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,7 +78,7 @@ jobs: leo-executable: docker: - image: cimg/rust:1.51.0 - resource_class: 2xlarge + resource_class: xlarge steps: - checkout - setup_environment: @@ -86,7 +86,7 @@ jobs: - run: name: Build and install Leo no_output_timeout: 30m - command: cargo install --path . --root . + command: cargo install --path . --root . --locked - persist_to_workspace: root: ~/ paths: project/