Skip to content

Commit

Permalink
Verify ./runner executable on all supported OSes (#10329)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach authored Jun 25, 2024
1 parent 0cde0e7 commit a5af0c2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 615 deletions.
17 changes: 12 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2581,12 +2581,19 @@ lazy val `engine-runner` = project
)
}

val exec =
s"$jlink --module-path ${modules.mkString(":")} --output $smallJdkDirectory --add-modules $NI_MODULES,$JDK_MODULES,$DEBUG_MODULES,$PYTHON_MODULES"
val exitCode = scala.sys.process.Process(exec).!

var jlinkArgs = Seq(
"--module-path",
modules.mkString(File.pathSeparator),
"--output",
smallJdkDirectory.toString(),
"--add-modules",
s"$NI_MODULES,$JDK_MODULES,$DEBUG_MODULES,$PYTHON_MODULES"
)
val exitCode = scala.sys.process.Process(jlink.toString(), jlinkArgs).!
if (exitCode != 0) {
throw new RuntimeException(s"Cannot execute smalljdk.sh")
throw new RuntimeException(
s"Failed to execute $jlink ${jlinkArgs.mkString(" ")} - exit code: $exitCode"
)
}
libDirs.foreach(libDir =>
IO.copyDirectory(
Expand Down
5 changes: 4 additions & 1 deletion build/build/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ pub struct BuildConfigurationFlags {
/// Used to check that benchmarks do not fail on runtime, rather than obtaining the results.
pub execute_benchmarks_once: bool,
pub build_engine_package: bool,
/// Build the experimental native Engine Runner.
/// Build the NI Engine Runner.
pub build_native_runner: bool,
/// Build the experimental Espresso+NI Engine Runner.
pub build_espresso_runner: bool,
pub build_launcher_package: bool,
pub build_project_manager_package: bool,
pub build_launcher_bundle: bool,
Expand Down Expand Up @@ -218,6 +220,7 @@ impl Default for BuildConfigurationFlags {
build_engine_package: false,
build_launcher_package: false,
build_native_runner: false,
build_espresso_runner: false,
build_project_manager_package: false,
build_launcher_bundle: false,
build_project_manager_bundle: false,
Expand Down
16 changes: 9 additions & 7 deletions build/build/src/engine/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,15 @@ impl RunContext {
debug!("Building and testing native engine runners");
runner_sanity_test(&self.repo_root, None).await?;
ide_ci::fs::remove_file_if_exists(&self.repo_root.runner)?;
let enso_java = "espresso";
sbt.command()?
.env(ENSO_JAVA, enso_java)
.arg("engine-runner/buildNativeImage")
.run_ok()
.await?;
runner_sanity_test(&self.repo_root, Some(enso_java)).await?;
if self.config.build_espresso_runner {
let enso_java = "espresso";
sbt.command()?
.env(ENSO_JAVA, enso_java)
.arg("engine-runner/buildNativeImage")
.run_ok()
.await?;
runner_sanity_test(&self.repo_root, Some(enso_java)).await?;
}
}

// Verify Integrity of Generated License Packages in Distributions
Expand Down
6 changes: 3 additions & 3 deletions build/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ impl Processor {
arg::backend::Command::CiCheck {} => {
let config = enso_build::engine::BuildConfigurationFlags {
build_benchmarks: true,
// Windows is not yet supported for the native runner.
build_native_runner: enso_build::ci::big_memory_machine()
&& TARGET_OS != OS::Windows,
build_native_runner: true,
// Espresso+NI needs to be checked only on a single platform.
build_espresso_runner: TARGET_OS == OS::Linux,
execute_benchmarks: {
// Run benchmarks only on Linux.
let mut ret = BTreeSet::new();
Expand Down
Loading

0 comments on commit a5af0c2

Please sign in to comment.