Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ slog-term = "2.7"
slog-async = "2.7"
slog-envlogger = "2.2"
toml = "0.8"
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "bdaaf207c7d7f9a6d905a3589eb8e159aa78df12" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "02fdf06bb279fc1b1393f993b90cbe84b7e9f281" }
libc = "0.2"
tokio = { version = "1.44.2", features = ["full"] }
tokio-tungstenite = "0.21"
Expand All @@ -45,3 +45,10 @@ oxnet = { version = "0.1.1", default-features = false }
indicatif = "0.17.11"
xz2 = "0.1.7"
camino-tempfile = "1.1.1"
cargo_toml = "0.22.1"
quote = "1.0.40"
prettyplease = "0.2"
syn = "2.0"
sha2 = "0.10.8"
anstyle = "1.0.10"
base16ct = { version = "0.2.0", features = ["alloc"] }
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@ development environment for networked systems.
recommended. While nested virt can be made to work, it often requires wizardry
and is known to have flaky behaviors.

## Installing

Install `propolis-server`. The`get-propolis.sh` script can also be used to
automatically install propolis-server form the current Falcon CI build.

Set up propolis, firmware and OS base images.
```
./get-propolis.sh
./get-ovmf.sh
./setup-base-images.sh
```

Falcon-enabled propolis builds are kicked out by Propolis CI. See
[this run](https://github.com/oxidecomputer/propolis/runs/18723647907)
as an example.

## QuickStart

To get a ready-to-go Falcon project use the
Expand Down
15 changes: 0 additions & 15 deletions get-ovmf.sh

This file was deleted.

9 changes: 0 additions & 9 deletions get-propolis.sh

This file was deleted.

5 changes: 5 additions & 0 deletions import-raw-img.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# This script is useful for importing a raw image onto your local system for
# testing the construction of a new falcon image. This is not necessary for
# falcon images that have been uploaded to the falcon image bucket. Those
# images are automatically managed by falcon.

set -o xtrace
set -o errexit
set -o pipefail
Expand Down
12 changes: 9 additions & 3 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name = "libfalcon"
version = "0.1.0"
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
thiserror.workspace = true
anyhow.workspace = true
Expand Down Expand Up @@ -33,7 +31,15 @@ camino.workspace = true
reqwest.workspace = true
indicatif.workspace = true
xz2.workspace = true
anstyle = "1.0.10"
anstyle.workspace = true
sha2.workspace = true
base16ct.workspace = true

[dev-dependencies]
camino-tempfile.workspace = true

[build-dependencies]
cargo_toml.workspace = true
quote.workspace = true
prettyplease.workspace = true
syn.workspace = true
46 changes: 46 additions & 0 deletions lib/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//! This file generates a rust file with a single constant in it,
//! PROPOLIS_REV, that holds the git revision of propolis that
//! this build expects. The expected revision is pulled from
//! the workspace Cargo.toml. This constant is used to automatically
//! download propolis from buildomat CI artifacts as a part of
//! the topology preflight process, ensuring that the propolis binary
//! we use matches the propolis API revision falcon was built against.

use cargo_toml::Manifest;
use quote::quote;
use std::env;
use std::fs;
use std::path::Path;

fn main() {
get_propolis_version();
}

fn get_propolis_version() {
let manifest = Manifest::from_path("../Cargo.toml")
.expect("read workspace Cargo.toml");

let workspace = manifest.workspace.expect("get workspace");

let propolis = workspace
.dependencies
.get("propolis-client")
.expect("build.rs: get propolis client dependency");

let Some(rev) = propolis.git_rev() else {
panic!("build.rs: expected git rev for propolis client");
};

let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("propolis_version.rs");

let tokens = quote! { const PROPOLIS_REV: &str = #rev; };

let file: syn::File =
syn::parse2(tokens).expect("build.rs: parse generated code");
let code = prettyplease::unparse(&file);

fs::write(&dest_path, code).unwrap();

println!("cargo::rerun-if-changed=../Cargo.toml");
}
Loading