Skip to content

Commit

Permalink
Using testnative when running in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Jan 23, 2025
1 parent ec80c80 commit 34300d0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions build_tools/build/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ pub enum EngineLauncher {
/// The binary inside the engine distribution will be built as an optimized native image
Native,
/// The binary inside the engine distribution will be built as native image with assertions
/// enabled but no debug information
TestNative,
/// The binary inside the engine distribution will be built as native image with assertions
/// enabled and debug information
DebugNative,
TestDebugNative,
/// The binary inside the engine distribution will be a shell script
#[default]
Shell,
Expand All @@ -191,11 +194,20 @@ impl FromStr for EngineLauncher {
type Err = anyhow::Error;

fn from_str(s: &str) -> Result<Self> {
match s {
"native" => Ok(Self::Native),
"debugnative" => Ok(Self::DebugNative),
"shell" => Ok(Self::Shell),
_ => bail!("Invalid Engine Launcher type: {}", s),
if s == "shell" {
Ok(Self::Shell)
} else if s.contains("native") {
if s.contains("test") {
if s.contains("debug") {
Ok(Self::TestDebugNative)
} else {
Ok(Self::TestNative)
}
} else {
Ok(Self::Native)
}
} else {
bail!("Invalid Engine Launcher type: {}", s)
}
}
}
Expand All @@ -204,7 +216,8 @@ impl From<EngineLauncher> for String {
fn from(value: EngineLauncher) -> Self {
match value {
EngineLauncher::Native => "native".to_string(),
EngineLauncher::DebugNative => "debugnative".to_string(),
EngineLauncher::TestNative => "testnative".to_string(),
EngineLauncher::TestDebugNative => "testdebugnative".to_string(),
EngineLauncher::Shell => "shell".to_string(),
}
}
Expand All @@ -214,7 +227,8 @@ impl Display for EngineLauncher {
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
match *self {
EngineLauncher::Native => write!(f, "native"),
EngineLauncher::DebugNative => write!(f, "debugnative"),
EngineLauncher::TestNative => write!(f, "testnative"),
EngineLauncher::TestDebugNative => write!(f, "testdebugnative"),
EngineLauncher::Shell => write!(f, "shell"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion build_tools/build/src/engine/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl RunContext {
sbt.call_arg("syntax-rust-definition/Runtime/managedClasspath").await?;
}
if self.config.build_native_runner {
env::ENSO_LAUNCHER.set(&engine::EngineLauncher::DebugNative)?;
env::ENSO_LAUNCHER.set(&engine::EngineLauncher::TestNative)?;
}

// TODO: Once the native image is production ready, we should switch to
Expand Down

0 comments on commit 34300d0

Please sign in to comment.