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
19 changes: 10 additions & 9 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ jobs:
working-directory: examples/${{ matrix.example }}
run: |
kraft-hyperlight --no-prompt build --plat hyperlight --arch x86_64 || true
# Fallback: kraft's source-resolution path is flaky (it sometimes
# probes + finds the repo but skips the pull and leaves
# .unikraft/unikraft empty — see memory/feedback_kraft_clean_rebuild).
# Manually clone the components and rebuild with --no-fetch/--no-update.
if [ ! -d ".unikraft/unikraft" ] || [ -z "$(ls -A .unikraft/unikraft 2>/dev/null)" ]; then
echo "::warning::kraft didn't clone unikraft sources; cloning manually"
# Fallback: kraft's source-resolution is flaky it can partially
# clone (e.g. unikraft but not libelf) or leave dirs empty. Check
# for the actual kernel output; if missing, nuke everything and
# clone + build from scratch.
if ! ls .unikraft/build/*_hyperlight-x86_64 >/dev/null 2>&1; then
echo "::warning::kraft build produced no kernel; cloning manually and rebuilding"
UK_SOURCE=$(awk '/^unikraft:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
UK_BRANCH=$(awk '/^unikraft:/{f=1} f && /version:/{print $2; exit}' kraft.yaml)
ELF_SOURCE=$(awk '/app-elfloader:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
Expand Down Expand Up @@ -300,8 +300,8 @@ jobs:
run: |
just rootfs
kraft-hyperlight --no-prompt build --plat hyperlight --arch x86_64 || true
if [ ! -d ".unikraft/unikraft" ] || [ -z "$(ls -A .unikraft/unikraft 2>/dev/null)" ]; then
echo "::warning::kraft didn't clone unikraft sources; cloning manually"
if ! ls .unikraft/build/*_hyperlight-x86_64 >/dev/null 2>&1; then
echo "::warning::kraft build produced no kernel; cloning manually and rebuilding"
UK_SOURCE=$(awk '/^unikraft:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
UK_BRANCH=$(awk '/^unikraft:/{f=1} f && /version:/{print $2; exit}' kraft.yaml)
ELF_SOURCE=$(awk '/app-elfloader:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
Expand Down Expand Up @@ -445,7 +445,8 @@ jobs:
run: |
just rootfs
kraft-hyperlight --no-prompt build --plat hyperlight --arch x86_64 || true
if [ ! -d ".unikraft/unikraft" ] || [ -z "$(ls -A .unikraft/unikraft 2>/dev/null)" ]; then
if ! ls .unikraft/build/*_hyperlight-x86_64 >/dev/null 2>&1; then
echo "::warning::kraft build produced no kernel; cloning manually and rebuilding"
UK_SOURCE=$(awk '/^unikraft:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
UK_BRANCH=$(awk '/^unikraft:/{f=1} f && /version:/{print $2; exit}' kraft.yaml)
ELF_SOURCE=$(awk '/app-elfloader:/{f=1} f && /source:/{print $2; exit}' kraft.yaml)
Expand Down
1 change: 1 addition & 0 deletions host/src/bin/pyhl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ fn fresh_seed() -> u128 {
// -- main ---------------------------------------------------------------------

fn main() -> Result<()> {
hyperlight_unikraft::pyhl::default_surrogate_count();
let cli = Cli::parse();
match cli.cmd {
Command::Setup(args) => cmd_setup(args),
Expand Down
2 changes: 1 addition & 1 deletion host/src/pyhl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use crate::{Preopen, Sandbox};
/// callers would pay on the very first sandbox. Pinning the default to 1
/// drops that to ~7 ms. Callers (or the embedding binary) can still
/// override by setting the env var before calling into `pyhl`.
fn default_surrogate_count() {
pub fn default_surrogate_count() {
if std::env::var_os("HYPERLIGHT_INITIAL_SURROGATES").is_none() {
// Safety: must be called before any sandbox is created and
// before additional threads are spawned.
Expand Down
Loading