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
4 changes: 1 addition & 3 deletions .github/workflows/ValidatePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
# Cargo.lock files stale. This job updates them before code-checks runs
# `cargo fetch --locked` so that the first CI run succeeds.
update-guest-locks:
if: >-
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.actor == 'dependabot[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]'
uses: ./.github/workflows/dep_update_guest_locks.yml
secrets: inherit

Expand Down
31 changes: 2 additions & 29 deletions .github/workflows/dep_update_guest_locks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env:

permissions:
contents: read
pull-requests: read

defaults:
run:
Expand All @@ -27,28 +26,9 @@ jobs:
runs-on: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"]
timeout-minutes: 15
steps:
# Fetch metadata about the Dependabot PR
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

# Only proceed for cargo ecosystem updates
- name: Check if cargo update
id: check-ecosystem
run: |
if [ "${{ steps.metadata.outputs.package-ecosystem }}" = "cargo" ]; then
echo "is_cargo=true" >> "$GITHUB_OUTPUT"
else
echo "is_cargo=false" >> "$GITHUB_OUTPUT"
echo "Skipping non-cargo dependency update"
fi

# Get GitHub App token for pushing commits back to the PR
# Uses the same app as auto-merge-dependabot.yml
- name: Get GitHub App token
if: steps.check-ecosystem.outputs.is_cargo == 'true'
uses: actions/create-github-app-token@v2
id: get-app-token
with:
Expand All @@ -57,7 +37,6 @@ jobs:
permission-contents: write

- name: Checkout PR branch
if: steps.check-ecosystem.outputs.is_cargo == 'true'
uses: actions/checkout@v6
with:
token: ${{ steps.get-app-token.outputs.token }}
Expand All @@ -66,30 +45,25 @@ jobs:
persist-credentials: false

- name: Setup Rust toolchain
if: steps.check-ecosystem.outputs.is_cargo == 'true'
uses: hyperlight-dev/ci-setup-workflow@v1.8.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fix cargo home permissions
if: steps.check-ecosystem.outputs.is_cargo == 'true'
run: |
sudo chown -R $(id -u):$(id -g) /opt/cargo || true

- name: Update simpleguest Cargo.lock
if: steps.check-ecosystem.outputs.is_cargo == 'true'
working-directory: src/tests/rust_guests/simpleguest
run: cargo fetch

- name: Update dummyguest Cargo.lock
if: steps.check-ecosystem.outputs.is_cargo == 'true'
working-directory: src/tests/rust_guests/dummyguest
run: cargo fetch

- name: Update witguest Cargo.lock
if: steps.check-ecosystem.outputs.is_cargo == 'true'
working-directory: src/tests/rust_guests/witguest
run: cargo fetch

Expand All @@ -105,11 +79,10 @@ jobs:
# - Git Data API (Create a commit):
# https://docs.github.com/en/rest/git/commits#create-a-commit
- name: Commit and push changes via API
if: steps.check-ecosystem.outputs.is_cargo == 'true'
env:
GH_TOKEN: ${{ steps.get-app-token.outputs.token }}
APP_SLUG: ${{ steps.get-app-token.outputs.app-slug }}
DEPENDENCY_NAMES: ${{ steps.metadata.outputs.dependency-names }}
PR_TITLE: ${{ github.event.pull_request.title }}
BRANCH: ${{ github.head_ref }}
REPO: ${{ github.repository }}
run: |
Expand Down Expand Up @@ -157,7 +130,7 @@ jobs:
COMMIT_MSG=$(printf '%s\n\n%s\n%s\n\n%s' \
"chore: update guest Cargo.lock files" \
"Automatically updated by dependabot-update-guest-locks workflow." \
"Triggered by: ${DEPENDENCY_NAMES}" \
"Triggered by: ${PR_TITLE}" \
"Signed-off-by: ${SIGNOFF}")

# Create commit via API — GitHub signs it automatically since we
Expand Down
27 changes: 20 additions & 7 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/hyperlight_component_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name = "hyperlight_component_macro"
proc-macro = true

[dependencies]
wasmparser = { version = "0.244.0" }
wasmparser = { version = "0.245.1" }
quote = { version = "1.0.44" }
proc-macro2 = { version = "1.0.106" }
syn = { version = "2.0.117" }
Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_component_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Shared implementation for the procedural macros that generate Hyperlight host an
name = "hyperlight_component_util"

[dependencies]
wasmparser = { version = "0.244.0" }
wasmparser = { version = "0.245.1" }
quote = { version = "1.0.44" }
proc-macro2 = { version = "1.0.106" }
syn = { version = "2.0.117" }
Expand Down
3 changes: 1 addition & 2 deletions src/hyperlight_component_util/src/elaborate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ impl<'p, 'a> Ctx<'p, 'a> {
Ok(VariantCase {
name: Name { name: vc.name },
ty: vc.ty.as_ref().map(|ty| self.elab_value(ty)).transpose()?,
refines: vc.refines,
})
})
.collect::<Result<Vec<_>, Error<'a>>>()?;
Expand Down Expand Up @@ -433,7 +432,7 @@ impl<'p, 'a> Ctx<'p, 'a> {
Defined::Handleable(h) => Ok(Value::Borrow(h.clone())),
_ => Err(Error::HandleToNonResource),
},
ComponentDefinedType::FixedSizeList(vt, size) => {
ComponentDefinedType::FixedLengthList(vt, size) => {
Ok(Value::FixList(Box::new(self.elab_value(vt)?), *size))
}
ComponentDefinedType::Future(_) | ComponentDefinedType::Stream(_) => {
Expand Down
1 change: 0 additions & 1 deletion src/hyperlight_component_util/src/etypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ pub struct RecordField<'a> {
pub struct VariantCase<'a> {
pub name: Name<'a>,
pub ty: Option<Value<'a>>,
pub refines: Option<u32>,
}

/// valtype_e in the specification
Expand Down
1 change: 0 additions & 1 deletion src/hyperlight_component_util/src/substitute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ where
Ok(VariantCase {
name: vc.name,
ty: self.value_option(&vc.ty)?,
refines: vc.refines,
})
})
.collect()
Expand Down
16 changes: 0 additions & 16 deletions src/hyperlight_component_util/src/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ pub enum Error<'a> {
DuplicateRecordField(Name<'a>),
/// A variant has multiple cases with the same name
DuplicateVariantField(Name<'a>),
/// A variant case is marked as refining another case, but that
/// case does not exist
NonexistentVariantRefinement(u32),
/// A variant case is marked as refining another case, but its
/// associated value is not a subtype of the value of the refined
/// case
IncompatibleVariantRefinement(subtype::Error<'a>),
/// A flags has multiple flags with the same name
DuplicateFlagsName(Name<'a>),
/// An enum has multiple cases with the same name
Expand Down Expand Up @@ -181,15 +174,6 @@ impl<'p, 'a> Ctx<'p, 'a> {
|&vc| vc.name.name,
|vc| Error::DuplicateVariantField(vc.name),
)?;
for vc in vcs {
if let Some(ri) = vc.refines {
let rvc = vcs
.get(ri as usize)
.ok_or(Error::NonexistentVariantRefinement(ri))?;
self.subtype_value_option(&vc.ty, &rvc.ty)
.map_err(Error::IncompatibleVariantRefinement)?;
}
}
Ok(())
}
fn wf_value<'r>(&'r self, p: ValueTypePosition, vt: &'r Value<'a>) -> Result<(), Error<'a>> {
Expand Down
29 changes: 12 additions & 17 deletions src/tests/rust_guests/witguest/Cargo.lock

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