Skip to content

Commit 34300d0

Browse files
Using testnative when running in the CI
1 parent ec80c80 commit 34300d0

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

build_tools/build/src/engine.rs

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,11 @@ pub enum EngineLauncher {
180180
/// The binary inside the engine distribution will be built as an optimized native image
181181
Native,
182182
/// The binary inside the engine distribution will be built as native image with assertions
183+
/// enabled but no debug information
184+
TestNative,
185+
/// The binary inside the engine distribution will be built as native image with assertions
183186
/// enabled and debug information
184-
DebugNative,
187+
TestDebugNative,
185188
/// The binary inside the engine distribution will be a shell script
186189
#[default]
187190
Shell,
@@ -191,11 +194,20 @@ impl FromStr for EngineLauncher {
191194
type Err = anyhow::Error;
192195

193196
fn from_str(s: &str) -> Result<Self> {
194-
match s {
195-
"native" => Ok(Self::Native),
196-
"debugnative" => Ok(Self::DebugNative),
197-
"shell" => Ok(Self::Shell),
198-
_ => bail!("Invalid Engine Launcher type: {}", s),
197+
if s == "shell" {
198+
Ok(Self::Shell)
199+
} else if s.contains("native") {
200+
if s.contains("test") {
201+
if s.contains("debug") {
202+
Ok(Self::TestDebugNative)
203+
} else {
204+
Ok(Self::TestNative)
205+
}
206+
} else {
207+
Ok(Self::Native)
208+
}
209+
} else {
210+
bail!("Invalid Engine Launcher type: {}", s)
199211
}
200212
}
201213
}
@@ -204,7 +216,8 @@ impl From<EngineLauncher> for String {
204216
fn from(value: EngineLauncher) -> Self {
205217
match value {
206218
EngineLauncher::Native => "native".to_string(),
207-
EngineLauncher::DebugNative => "debugnative".to_string(),
219+
EngineLauncher::TestNative => "testnative".to_string(),
220+
EngineLauncher::TestDebugNative => "testdebugnative".to_string(),
208221
EngineLauncher::Shell => "shell".to_string(),
209222
}
210223
}
@@ -214,7 +227,8 @@ impl Display for EngineLauncher {
214227
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
215228
match *self {
216229
EngineLauncher::Native => write!(f, "native"),
217-
EngineLauncher::DebugNative => write!(f, "debugnative"),
230+
EngineLauncher::TestNative => write!(f, "testnative"),
231+
EngineLauncher::TestDebugNative => write!(f, "testdebugnative"),
218232
EngineLauncher::Shell => write!(f, "shell"),
219233
}
220234
}

build_tools/build/src/engine/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl RunContext {
200200
sbt.call_arg("syntax-rust-definition/Runtime/managedClasspath").await?;
201201
}
202202
if self.config.build_native_runner {
203-
env::ENSO_LAUNCHER.set(&engine::EngineLauncher::DebugNative)?;
203+
env::ENSO_LAUNCHER.set(&engine::EngineLauncher::TestNative)?;
204204
}
205205

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

0 commit comments

Comments
 (0)