Public release release-b215a8f6e506

Source commit: b215a8f6e506fafa38755d1c14e89e5a52c82f9f

Public tree identity: sha256:23ba19e9f6e902cbfb4ed34cd7f9e1aaa39945e9b61946b879d7254b3f033502
This commit is contained in:
Clusterflux release 2026-07-19 14:57:40 +02:00
commit f8bf4e94cc
221 changed files with 81096 additions and 0 deletions

View file

@ -0,0 +1,13 @@
[package]
name = "hello-build"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish = false
[lib]
crate-type = ["rlib", "cdylib"]
[dependencies]
clusterflux = { package = "clusterflux-sdk", path = "../../crates/clusterflux-sdk" }

View file

@ -0,0 +1,18 @@
# Hello build
The primary Clusterflux example snapshots this project, compiles a real static C
executable in the declared offline Linux environment, and publishes the
executable as a retained artifact.
Run it with:
~~~bash
clusterflux bundle inspect --project examples/hello-build
clusterflux run --project examples/hello-build build
clusterflux artifact list --process <process-id>
clusterflux artifact download <artifact-id> --to ./hello-clusterflux
chmod +x ./hello-clusterflux
./hello-clusterflux
~~~
The final command prints hello from a real Clusterflux build.

View file

@ -0,0 +1,3 @@
FROM docker.io/library/alpine:3.20
RUN apk add --no-cache build-base tar zstd
WORKDIR /workspace

View file

@ -0,0 +1,6 @@
#include <stdio.h>
int main(void) {
puts("hello from a real Clusterflux build");
return 0;
}

View file

@ -0,0 +1,30 @@
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
}