Can't build Rust when invoked through Maven with a `sleeper builder` command
patchwork01 opened this issue · comments
Description
When we build the system inside a sleeper builder
Docker container, e.g. with scripts/build/buildForTest.sh
, this usually works without a problem. Running from outside the container seems to produce strange failures, like sleeper builder ./sleeper/scripts/build/buildForTest.sh
or sleeper builder ./sleeper/scripts/test/nightly/updateAndRunTests.sh ...
.
When run this way, when Maven gets to the compaction-rust module and tries to invoke the cross
command with exec-maven-plugin
, we see an exception like java.io.IOException: Cannot run program "cross" (in directory "/sleeper-builder/sleeper/java/../rust"): error=2, No such file or directory
.
Steps to reproduce
- Install Sleeper CLI
- Run
sleeper builder
and check out the Git repository at/sleeper-builder/sleeper
- From outside the builder, run
sleeper builder ./sleeper/scripts/build/buildForTest.sh
- See error
Expected behaviour
The build should happen the same whether you ran it from a shell in the Docker image, or as the command for the Docker image execution. It should pass.
Screenshots/Logs
[ERROR] Command execution failed.
java.io.IOException: Cannot run program "cross" (in directory "/sleeper-builder/sleeper/java/../rust"): error=2, No such file or directory
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1143)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1073)
at org.codehaus.mojo.exec.ExtendedExecutor.launch (ExtendedExecutor.java:62)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:295)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:253)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:884)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:844)
at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:450)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
at java.lang.Thread.run (Thread.java:840)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.ProcessImpl.forkAndExec (Native Method)
at java.lang.ProcessImpl.<init> (ProcessImpl.java:314)
at java.lang.ProcessImpl.start (ProcessImpl.java:244)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1110)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1073)
at org.codehaus.mojo.exec.ExtendedExecutor.launch (ExtendedExecutor.java:62)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:295)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:253)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:884)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:844)
at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:450)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
at java.lang.Thread.run (Thread.java:840)
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.3.0:exec (Invoke Rust Cargo build (Linux x86_64)) on project compaction-rust: Command execution failed.: Cannot run program "cross" (in directory "/sleeper-builder/sleeper/java/../rust"): error=2, No such file or directory -> [Help 1]