Source commit: a513a752ee528b3c50400dde5d86e24c694e35b5 Public tree identity: sha256:ae10e20386250d9dac200a07ef69e1944402e8cb0f9c37a249587595638b3be0
30 lines
835 B
Rust
30 lines
835 B
Rust
use clusterflux::prelude::*;
|
|
|
|
#[clusterflux::task(capabilities = "command")]
|
|
pub async fn compile(source: SourceSnapshot) -> Result<Artifact> {
|
|
let executable = fs::output("hello-clusterflux")?;
|
|
Command::new("cc")
|
|
.args([
|
|
"-Os",
|
|
"-static",
|
|
"-s",
|
|
"fixture/hello-clusterflux.c",
|
|
"-o",
|
|
executable.as_str(),
|
|
])
|
|
.cwd(source.mount()?)
|
|
.env("SOURCE_DATE_EPOCH", "0")
|
|
.network_disabled()
|
|
.run()
|
|
.await?;
|
|
fs::publish(&executable).await
|
|
}
|
|
|
|
#[clusterflux::main]
|
|
pub async fn build() -> Result<Artifact> {
|
|
let source = source::current_project().snapshot().await?;
|
|
let compile = clusterflux::spawn!(compile(source))
|
|
.on(clusterflux::env!("linux"))
|
|
.await?;
|
|
compile.join().await
|
|
}
|