Public dry run dryrun-309831e1e021

Source commit: 309831e1e021f962c118452336776fd9a94025f9

Public tree identity: sha256:6fa95c1745579bd6256dbeb3d476db0b07c2f24aa9213b0f7783ce1adfc8aca5
This commit is contained in:
Disasmer release dry run 2026-07-03 16:07:13 +02:00
commit f22d0a5791
113 changed files with 39348 additions and 0 deletions

View file

@ -0,0 +1,17 @@
[package]
name = "launch-build-demo"
version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
[lib]
path = "src/build.rs"
crate-type = ["rlib", "cdylib"]
[dependencies]
disasmer = { package = "disasmer-sdk", path = "../../crates/disasmer-sdk" }
serde.workspace = true
[dev-dependencies]
futures-executor.workspace = true

View file

@ -0,0 +1,11 @@
# Launch Build Demo
This demo is the MVP build workflow expressed as Rust source code. It uses `env!("linux")`, recognizes `env!("windows")` when a Windows development node is attached, spawns debugger-visible virtual tasks, and returns artifact/source handles instead of moving large bytes through task arguments.
The Linux environment is defined by `envs/linux/Containerfile`. The Windows environment is a user-attached development contract and does not claim secure managed Windows sandboxing.
Inspect the bundle metadata:
```bash
disasmer bundle inspect --project examples/launch-build-demo
```

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,2 @@
# User-attached Windows development execution contract for the MVP.
# This is not a managed untrusted Windows sandbox.

View file

@ -0,0 +1,97 @@
use disasmer::{Artifact, EnvRef, SourceSnapshot};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct BuildReport {
pub linux_thread: u64,
pub package_thread: u64,
pub linux_artifact: Artifact,
pub package_artifact: Artifact,
pub source: SourceSnapshot,
}
pub fn linux_env() -> EnvRef {
disasmer::env!("linux")
}
pub fn windows_env() -> EnvRef {
disasmer::env!("windows")
}
#[disasmer::task]
pub fn compile_linux() -> Artifact {
Artifact {
id: "artifact://linux/app.tar.zst".to_owned(),
}
}
#[disasmer::task]
#[unsafe(no_mangle)]
pub extern "C" fn task_add_one(input: i32) -> i32 {
input + 1
}
#[disasmer::task]
pub fn package_release() -> Artifact {
Artifact {
id: "artifact://package/release.tar.zst".to_owned(),
}
}
#[disasmer::main]
pub fn build_main() -> &'static str {
"launch-build-demo"
}
pub async fn run_build_workflow() -> BuildReport {
let linux = disasmer::spawn::task(compile_linux)
.name("compile linux")
.env(linux_env())
.start()
.await;
let package = disasmer::spawn::task(package_release)
.name("package artifacts")
.env(linux_env())
.start()
.await;
let linux_thread = linux.virtual_thread_id();
let package_thread = package.virtual_thread_id();
let linux_artifact = linux.join().await;
let package_artifact = package.join().await;
BuildReport {
linux_thread,
package_thread,
linux_artifact,
package_artifact,
source: SourceSnapshot {
digest: "source://local-checkout".to_owned(),
},
}
}
#[cfg(test)]
mod tests {
use futures_executor::block_on;
use super::*;
#[test]
fn flagship_workflow_is_rust_source_with_spawned_virtual_tasks() {
assert_eq!(build_main(), "launch-build-demo");
assert_eq!(task_add_one(41), 42);
assert_eq!(linux_env().name, "linux");
assert_eq!(windows_env().name, "windows");
let report = block_on(run_build_workflow());
assert_ne!(report.linux_thread, report.package_thread);
assert_eq!(report.linux_artifact.id, "artifact://linux/app.tar.zst");
assert_eq!(
report.package_artifact.id,
"artifact://package/release.tar.zst"
);
assert_eq!(report.source.digest, "source://local-checkout");
}
}