From 3f8a16138d6a0c0805a2b66f149d9a48201d6d8e Mon Sep 17 00:00:00 2001 From: oddgrd <29732646+oddgrd@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:00:47 +0100 Subject: [PATCH 1/2] feat: build tests in release profile, limit build workers --- deployer/src/deployment/queue.rs | 9 +++++++++ service/src/loader.rs | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/deployer/src/deployment/queue.rs b/deployer/src/deployment/queue.rs index a76fe83c3..93503e9ee 100644 --- a/deployer/src/deployment/queue.rs +++ b/deployer/src/deployment/queue.rs @@ -4,6 +4,7 @@ use super::{Built, QueueReceiver, RunSender, State}; use crate::error::{Error, Result, TestError}; use crate::persistence::{LogLevel, SecretRecorder}; +use cargo::util::interning::InternedString; use cargo_metadata::Message; use chrono::Utc; use crossbeam_channel::Sender; @@ -312,6 +313,14 @@ async fn run_pre_deploy_tests( ansi: false, }; + // We set the tests to build with the release profile since deployments compile + // with the release profile by default. This means crates don't need to be + // recompiled in debug mode for the tests, reducing memory usage during deployment. + compile_opts.build_config.requested_profile = InternedString::new("release"); + + // Build tests with a maximum of 8 workers. + compile_opts.build_config.jobs = 8; + let opts = TestOptions { compile_opts, no_run: false, diff --git a/service/src/loader.rs b/service/src/loader.rs index 223871251..d48aceeb3 100644 --- a/service/src/loader.rs +++ b/service/src/loader.rs @@ -178,6 +178,12 @@ fn get_compile_options(config: &Config, release_mode: bool) -> anyhow::Result Date: Fri, 9 Dec 2022 11:12:39 +0100 Subject: [PATCH 2/2] fix: typo in manifests --- codegen/Cargo.toml | 2 +- common/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 7a91fd0f9..770e3a87d 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -2,7 +2,7 @@ name = "shuttle-codegen" version = "0.7.2" edition.workspace = true -licence.workspace = true +license.workspace = true description = "Proc-macro code generator for the shuttle.rs service" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/common/Cargo.toml b/common/Cargo.toml index de8106048..0869eacac 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -2,7 +2,7 @@ name = "shuttle-common" version.workspace = true edition.workspace = true -licence.workspace = true +license.workspace = true description = "Common library for the shuttle platform (https://www.shuttle.rs/)" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html