Skip to content

Commit

Permalink
CI: disable sbt server autostart, but if it tries to start, force it (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu-tow committed Feb 17, 2024
1 parent fe0f904 commit 2e06b4b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/build/src/engine/sbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ impl CommandProvider for Context {
}
// This prevents https://github.com/sbt/sbt-assembly/issues/496
cmd.env(ide_ci::env::known::LC_ALL, ide_ci::env::known::C_UTF8);
// This prevents https://github.com/sbt/sbt/issues/6777#issuecomment-1613316167
cmd.set_env(ide_ci::programs::sbt::SBT_SERVER_FORCESTART, &true)?;
// Again. Preferably there should be no sbt server spawned at all.
cmd.apply(&sbt::ServerAutostart(false));
Ok(cmd)
}
}
Expand Down
19 changes: 19 additions & 0 deletions build/ci_utils/src/programs/sbt.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
use crate::prelude::*;

use crate::define_env_var;
use crate::program::command::Manipulator;



define_env_var! {
/// Force the SBT server to start, avoiding `ServerAlreadyBootingException`.
/// See: https://github.com/sbt/sbt/issues/6777#issuecomment-1613316167
SBT_SERVER_FORCESTART, bool;
}

#[derive(Clone, Copy, Debug)]
pub struct ServerAutostart(pub bool);
impl Manipulator for ServerAutostart {
fn apply<C: IsCommandWrapper + ?Sized>(&self, command: &mut C) {
let arg = "sbt.server.autostart";
let arg = format!("-D{arg}={}", self.0);
command.arg(arg);
}
}

macro_rules! strong_string {
($name:ident($inner_ty:ty)) => {
paste::paste! {
Expand Down

0 comments on commit 2e06b4b

Please sign in to comment.