Skip to content

Commit 63e28b6

Browse files
authored
Use editpe for trampoline resource edits (#18713)
Windows trampoline resource updates currently depend on Win32 APIs that are unavailable on NanoServer and can contend with antivirus software while reopening temporary executables. Use upstream `editpe` 0.2.4 to edit PE resources in memory across all supported Windows architectures, and restore the NanoServer integration test. Closes #18663. Closes #20955.
1 parent a22198b commit 63e28b6

7 files changed

Lines changed: 530 additions & 130 deletions

File tree

‎.github/workflows/test-integration.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,27 @@ jobs:
797797
ghcr.io/astral-sh/termux-python:latest \
798798
/entrypoint.sh bash /test-termux.sh
799799
800+
integration-test-windows-nanoserver:
801+
name: "windows nanoserver"
802+
timeout-minutes: 15
803+
runs-on: windows-latest
804+
steps:
805+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
806+
with:
807+
persist-credentials: false
808+
809+
- name: "Download binary"
810+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
811+
with:
812+
name: uv-windows-x86_64-${{ inputs.sha }}
813+
814+
- name: "Run uv on Windows NanoServer"
815+
run: |
816+
docker run --rm `
817+
-v "${{ github.workspace }}:C:\uv" `
818+
mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 `
819+
pwsh -ExecutionPolicy Bypass -File C:\uv\test\integration\windows-nanoserver.ps1
820+
800821
integration-test-github-actions:
801822
name: "github actions"
802823
timeout-minutes: 10

‎Cargo.lock‎

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ data-encoding = { version = "2.6.0" }
138138
diskus = { version = "0.9.0", default-features = false }
139139
dotenvy = { version = "0.15.7" }
140140
dunce = { version = "1.0.5" }
141+
editpe = { version = "0.2.4", default-features = false, features = ["std"] }
141142
either = { version = "1.13.0" }
142143
encoding_rs_io = { version = "0.1.7" }
143144
embed-manifest = { version = "1.5.0" }

‎crates/uv-trampoline-builder/Cargo.toml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ name = "normalize-pe-timestamps"
2626
[dependencies]
2727
uv-fs = { workspace = true }
2828

29-
anyhow = {workspace = true }
30-
fs-err = {workspace = true }
29+
anyhow = { workspace = true }
30+
fs-err = { workspace = true }
3131
goblin = { workspace = true }
32-
tempfile = { workspace = true }
3332
thiserror = { workspace = true }
3433

3534
[target.'cfg(target_os = "windows")'.dependencies]
3635
async_zip = { workspace = true }
36+
editpe = { workspace = true }
3737
futures-lite = { workspace = true }
3838
windows = { workspace = true }
3939

@@ -43,6 +43,7 @@ assert_fs = { workspace = true }
4343
anyhow = { workspace = true }
4444
fs-err = { workspace = true }
4545
rcgen = { workspace = true }
46+
tempfile = { workspace = true }
4647
which = { workspace = true }
4748

4849
[lib]

0 commit comments

Comments
 (0)