Skip to content

ci: stop shipping tier2_bfs in ADO-built release binaries#443

Merged
MGudgin merged 5 commits into
mainfrom
user/gudge/ado-drop-tier2-bfs
May 28, 2026
Merged

ci: stop shipping tier2_bfs in ADO-built release binaries#443
MGudgin merged 5 commits into
mainfrom
user/gudge/ado-drop-tier2-bfs

Conversation

@MGudgin

@MGudgin MGudgin commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

The ADO build was implicitly passing --all-features to 1ES.Build.Rust.Run@1, which has been the default behaviour of that task ever since we adopted it (commit 8875d40, 2026-03-25). That stayed harmless until commit 8c57211 (2026-05-25, merged via #410) introduced a new Cargo feature called tier2_bfs, which gates an OS-hang risk on Win 11 25H2 via bfscfg.exe and explicitly must not ship in production. Since then, every ADO-built release binary has shipped with tier2_bfs compiled in — exactly the configuration that the preflight scripts in test_scripts/T3-Workloads.ps1 and test_scripts/Win25H2Safe-Tests.ps1 are designed to refuse to run.

This PR pins the feature set explicitly on the 1ES.Build.Rust.Run@1 build task in .azure-pipelines/templates/Rust.Build.Job.yml so the task no longer falls through to its --all-features default. The feature lists are scoped by OS to match the actual feature definitions in each crate;

  • Windows (WXC): hyperlight isolation_session microvm wslc
  • Linux (LXC): hyperlight

The Cargo task input names took some iteration to nail down. The 1ES Rust virtual task documents features.allFeatures and features.activatedFeatures in features.X notation, but at the actual task inputs: level they are flat keys allFeatures and activatedFeatures, and activatedFeatures is a scalar string at the YAML schema layer (despite being documented string[]) — the 1ES task splits it internally. Reference; https://eng.ms/docs/coreai/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/buildworkflows/rust-virtual-task

Testing

Verified on ADO build 148042154 (PR check run on this branch): all 16 jobs green, total pipeline 28.7 min. The four cargo build invocations now report exactly the expected feature sets;

  • Build (x64 WXC) — cargo build ... --features hyperlight isolation_session microvm wslc
  • Build (arm64 WXC) — cargo build ... --features hyperlight isolation_session microvm wslc
  • Build (x64 LXC) — cargo build ... --features hyperlight
  • Build (arm64 LXC) — cargo build ... --features hyperlight

No --all-features and no tier2_bfs in any of them. Critical-path job Build (x64 WXC) ran in 13.4 min.

Closes #442

The `1ES.Build.Rust.Run@1` task defaults to `--all-features` when no
`features:` input is supplied. That was harmless until commit 8c57211
("feat(wxc_common): gate Tier 2 (BFS) behind tier2_bfs Cargo feature")
landed via #410 on 2026-05-26, which introduced `tier2_bfs` with the
explicit constraint that production binaries on Win 11 25H2 must NOT
carry it; otherwise the embedded `bfscfg.exe` invocation risks an OS
hang. The GH Actions workflow already respects this — its build line
in `.github/workflows/build.yml` does not pass `--all-features` — but
the ADO pipeline silently enables every feature including `tier2_bfs`,
and ships that binary via `release-binaries.zip` and the npm SDK.

Confirmed by inspecting the actual `Cargo build (1ES PT)` step log of
build 147990337 (PR #434):

    Running: cargo build --locked --offline
        --target x86_64-pc-windows-msvc --profile release --all-features

Override the task default by setting `allFeatures: false` and listing
the production feature set explicitly. This keeps every runtime backend
that IS intended for production (`hyperlight`, `isolation_session`,
`microvm`, `wslc`) compiled in while dropping `tier2_bfs`.

Lint.Job.yml is intentionally left alone; clippy with `--all-features`
gives broader coverage of conditionally compiled code and does not
produce a shipping binary.

Closes #442

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Azure DevOps (1ES) Rust build template to avoid implicitly building shipping Windows binaries with --all-features, which currently pulls in the tier2_bfs feature that must not be present in production binaries on Win 11 25H2.

Changes:

  • Adds explicit allFeatures: false plus an explicit Cargo feature list intended for production (hyperlight isolation_session microvm wslc) in the 1ES.Build.Rust.Run@1 build step.
Show a summary per file
File Description
.azure-pipelines/templates/Rust.Build.Job.yml Overrides the 1ES Rust task’s default feature selection to prevent tier2_bfs from being compiled into ADO-built Windows release binaries.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread .azure-pipelines/templates/Rust.Build.Job.yml Outdated
PR-build 148026004 confirmed `allFeatures: false` correctly drops the
task's `--all-features` default, but `features: '...'` was silently
ignored — the resulting cargo line had no `--features` at all, so the
binary lost hyperlight/isolation_session/microvm/wslc backends.

Shotgun several candidate input names in one push so the next CI run
narrows down which spelling the task actually consumes. Unknown inputs
are silently ignored by the 1ES PT task layer (already proven), so this
is safe. Once we identify the canonical name we will collapse to a
single key.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment on lines +125 to +138
# IMPORTANT: do not let the 1ES task default to `--all-features`. The
# `tier2_bfs` Cargo feature gates Tier 2 (BFS) and must NOT be
# compiled into production binaries on Win 11 25H2 (the embedded
# `bfscfg.exe` invocation risks an OS hang). See
# `.github/workflows/build.yml`, `test_scripts/T3-Workloads.ps1`,
# and `test_scripts/Win25H2Safe-Tests.ps1` for the safety model.
# Enumerate the production feature set explicitly so the shipped
# binary still carries every runtime backend except `tier2_bfs`.
#
# Shotgun across candidate input names while we identify which one
# the 1ES Rust task actually consumes (the task's source is internal
# and not browsable). Unknown inputs are silently ignored by the
# 1ES PT task layer, so listing several candidates is safe; once we
# know the canonical name we'll collapse this to a single key.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bbonaby bbonaby May 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also AI related but you should be able to get your AI agent to access this info by installing the EngHub mcp server: https://eng.ms/docs/help/announcements/mcp-server#setup-in-github-copilot-cli . That should help with all the 1ES stuff that isn't public.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the MCP was very helpful.

MGudgin and others added 3 commits May 27, 2026 22:02
Per the 1ES Rust virtual task schema (eng.ms doc), the inputs at
`1ES.Build.Rust.Run@1` level are:

    allFeatures: boolean          # default: true
    activatedFeatures: string[]

Build 148028047 confirmed `allFeatures: false` correctly drops
`--all-features` from the cargo line, but the previous commit's
`features: '...'` (and four other guessed names) were silently ignored,
so the binary lost hyperlight/isolation_session/microvm/wslc backends.

Replace the shotgun with the documented `activatedFeatures` YAML array
spelling. This should produce a cargo line of the form:

    cargo build --locked --offline --target ... --profile release \\
        --features hyperlight,isolation_session,microvm,wslc

Schema: https://eng.ms/docs/coreai/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/buildworkflows/rust-virtual-task

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build 148041192 rejected the previous commit at YAML validation:

    /.azure-pipelines/templates/Rust.Build.Job.yml (Line: 136, Col: 13):
        A sequence was not expected

Even though the 1ES Rust virtual task documents `activatedFeatures:
string[]`, AzDO task `inputs:` only accept scalar values at the YAML
schema layer; the 1ES task itself splits the scalar internally. Use a
whitespace-separated string instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build 148041225's WXC jobs got the correct cargo line:

    cargo build ... --features hyperlight isolation_session microvm wslc

But the LXC jobs failed because `lxc/Cargo.toml` only defines the
`hyperlight` feature (no microvm/isolation_session/wslc). Previously
this was hidden because `--all-features` enables only the features
defined on the package being built, and lxc only has `hyperlight`.

Split activatedFeatures by `item.os`:
  - windows (WXC) -> hyperlight isolation_session microvm wslc
  - linux   (LXC) -> hyperlight

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MGudgin
MGudgin marked this pull request as ready for review May 28, 2026 05:55
@MGudgin
MGudgin merged commit df26892 into main May 28, 2026
20 checks passed
@MGudgin
MGudgin deleted the user/gudge/ado-drop-tier2-bfs branch May 28, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants