[
https://issues.apache.org/jira/browse/HADOOP-20090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18146851#comment-18146851
]
ASF GitHub Bot commented on HADOOP-20090:
-----------------------------------------
GauthamBanasandra opened a new pull request, #9006:
URL: https://github.com/apache/hadoop/pull/9006
### Description of PR
[HADOOP-20090](https://issues.apache.org/jira/browse/HADOOP-20090). After
HADOOP-20087,
`dev-support/docker/Dockerfile_windows_10` checks the JDK, Maven, CMake,
zstd and MSYS2 downloads
against SHA-512 digests, but takes Visual Studio Build Tools, Git and pip
from whatever is current when
the image is built, and installs Git through Chocolatey's unpinned install
script. This pins each of
them by version and hash, for the GitHub Actions Windows build
(HADOOP-19857) and the Jenkins Windows
nightly alike:
- **Visual Studio Build Tools:** the fixed-version bootstrapper for 16.11.63
from Microsoft's
[release history
page](https://learn.microsoft.com/en-us/visualstudio/releases/2019/history),
checked by SHA-512, instead of `aka.ms/vs/16/release/vs_buildtools.exe`,
which installs the newest
release. Microsoft publishes no digest for it, but the SHA-256 in its
download URL matches the file.
The installer's exit code is now checked (0, or 3010 for a pending reboot).
- **Git:** PortableGit 2.56.0(4) in `C:\Git`, checked by SHA-512 and
cross-checked with the SHA-256
that Git for Windows publishes, replaces Chocolatey (`iex` of
`chocolatey.org/install.ps1`) and its
`git.install` package. The self-extractor exits 0 even when Git's
post-install step fails, so the
RUN checks that the step finished. `http.sslBackend schannel` and
`credential.helper manager` are
set as `git.install` set them; PortableGit's own credential helper opens a
dialog.
`C:\Git\bin\bash.exe`, which the jenkinsfile and BUILDING.txt use, is
where it was.
- **vcpkg:** checked out at the commit that the `2026.07.29` tag names (the
`builtin-baseline` in
`vcpkg.json`) rather than at the tag. `vcpkg.exe` is downloaded and
checked by SHA-512 instead of by
`bootstrap-vcpkg.bat`, whose downloader accepts any file with a trusted
Authenticode signature,
whoever signed it.
- **Python:** the installer is checked by SHA-512. `get-pip.py` installs pip
24.0 and setuptools
65.5.1 offline, from wheels checked by SHA-512, where it used to fetch
them from PyPI by version
alone. `install-python.ps1` and `install-pip.ps1` stop on the first
failure, as they do in the
upstream Dockerfile they come from. python-dateutil, which Yetus
releasedocmaker imports, was
installed unpinned; it is now 2.8.1, as in the Linux images, installed
with six from
`pkg-resolver/requirements-windows.txt` with `--require-hashes --no-deps`
and then `pip check`.
- **rsync:** MSYS2's popt is added. `rsync.exe` imports `msys-popt-0.dll`,
which Git for Windows does
not ship, so rsync could not start in the image, and the Yetus
`--archive-list` step, which ignores
rsync's exit status, archived nothing. The RUN now checks that rsync
starts and copies files. The
older OpenSSL and zstd DLLs are no longer copied over Git's own.
- **Layers and checks:** each tool is downloaded, checked, installed,
verified and cleaned up in one
RUN, so no installer is left in a lower layer, and the exit codes of the
JDK and Visual C++ 2010
installers are checked.
- **PATH:** set once, in the machine PATH, instead of by seven `setx` calls
for the build user.
- **Size:** the image shrinks from about 16.9 GB to 14.4 GB (6.6 GB to 5.8
GB compressed), and the
ltsc2019 image from 16.0 GB to 14.2 GB. BUILDING.txt now says about 14 GB.
Each new pin was published at least 7 days ago, as SECURITY.md requires.
#### Git for Windows 2.56.1
Git for Windows 2.56.1, a security release published on 10 November, cleared
the 7-day cooldown
on 17 November, after this commit was tested. I will add it here as a second
commit once a fork run
has tested it.
### How was this patch tested?
In my fork, with a trial GitHub Actions workflow that is not part of this
change. GitHub keeps the
logs for 90 days. Sizes are in decimal GB; the run summaries print GiB.
- [Fork run
44132140332](https://github.com/GauthamBanasandra/hadoop/actions/runs/44132140332)
tested this commit.
- The default (ltsc2022) image built on windows-2022: 14.4 GB, 5.8 GB
compressed (13.45 and
5.41 GiB in the run summary), down from 16.9 and 6.6 GB.
- It then passed full `-Pnative-win` builds (120/120 modules, with
`-DskipTests`) and the native
smoke test (`TestHdfsNativeCodeLoader` with `-Drequire.test.libhadoop`)
on windows-2022 and
windows-2025 under process isolation, and on windows-2022 under Hyper-V
isolation.
- The Windows-specific unit tests ran on windows-2022: 12 classes in
hadoop-common, hadoop-hdfs
and hadoop-yarn-common, 275 tests, no failures, 33 skipped, as with the
HADOOP-20087 image.
- The ltsc2019 image that Jenkins builds was built under Hyper-V on
windows-2022
(10.0.17763.9488, 14.2 GB, down from 16.0 GB). It passed the same full
build and smoke test
under Hyper-V, which no earlier run had tried. That job shows as failed
only because its last
step, a log upload in the trial workflow, was given paths the upload
action rejects; the step
before it logged "ltsc2019: the build, the binaries and the smoke test
passed".
- [Fork run
43631843328](https://github.com/GauthamBanasandra/hadoop/actions/runs/43631843328)
tested this change before review, with Visual Studio 16.11.62 and pip and
setuptools fetched by
version, with the same results apart from the ltsc2019 build, which it did
not run.
- Not tested: the Jenkins nightly's own path, `jenkins.sh` under Yetus. The
fork runs build the
ltsc2019 image that Jenkins builds, but run Maven directly.
### For code changes:
- [x] Does the title of this PR start with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: N/A
- [ ] New dependencies: none
- [ ] LICENSE/NOTICE: N/A
### AI Tooling
- [x] The PR includes the phrase "Contains content generated by Claude Code"
- [x] My use of AI contributions follows the ASF legal policy
https://www.apache.org/legal/generative-tooling.html
Contains content generated by Claude Code.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> Pin Visual Studio, Git, vcpkg and Python in the Windows build image by
> version and hash
> ---------------------------------------------------------------------------------------
>
> Key: HADOOP-20090
> URL: https://issues.apache.org/jira/browse/HADOOP-20090
> Project: Hadoop Common
> Issue Type: Task
> Components: hadoop-common
> Affects Versions: 3.5.0
> Reporter: Gautham Banasandra
> Assignee: Gautham Banasandra
> Priority: Major
> Fix For: 3.5.0
>
>
> {{dev-support/docker/Dockerfile_windows_10}} pins the JDK, Maven, CMake, zstd
> and MSYS2 downloads by SHA-512, but the rest of the image is not pinned:
> * Visual Studio Build Tools come from the {{aka.ms/vs/16/release}}
> bootstrapper, which installs whatever 16.11 release is newest when the image
> is built.
> * Git comes from Chocolatey: the image runs {{chocolatey.org/install.ps1}}
> unpinned, then {{choco install git.install}}, which takes whichever Git for
> Windows release the package currently names.
> * vcpkg is checked out by tag, and {{bootstrap-vcpkg.bat}} downloads
> {{vcpkg.exe}} through a helper that checks only that the file carries a
> trusted signature, not whose.
> * {{install-python.ps1}} does not check the installer's hash, and {{pip
> install python-dateutil}} takes the newest release: 4.0.0 since 1 November
> (plus its new dependency tzdata), not the 2.8.1 that the Linux images use.
> Some install steps also pass when they fail: {{install-python.ps1}} and
> {{install-pip.ps1}} exit 0 when a download fails, and the exit code of the
> Visual C++ 2010 redistributable's installer is not checked. And {{rsync.exe}}
> imports {{msys-popt-0.dll}}, which neither Git for Windows nor the image
> provides.
> This change:
> * Visual Studio Build Tools: the fixed-version bootstrapper for 16.11.62,
> which installs that release, with a SHA-512 check.
> * Git: PortableGit 2.56.0.4, with a SHA-512 check, extracted to {{C:\Git}},
> the path the Jenkins Windows job and BUILDING.txt already use. This replaces
> Chocolatey and git.install. The step checks that PortableGit's post-install
> script ran, and sets {{http.sslBackend}} and {{credential.helper}} as
> git.install did.
> * vcpkg: checked out by commit (the one the 2026.07.29 tag names, which is
> also the manifest's builtin-baseline), with {{vcpkg.exe}} downloaded directly
> and checked by SHA-512.
> * Python: a SHA-512 check for the installer. {{install-python.ps1}} and
> {{install-pip.ps1}} stop on any failure and check the installed versions, and
> get-pip no longer adds the unpinned {{wheel}} package. pip installs
> python-dateutil 2.8.1 and six 1.17.0 from a requirements file with hashes
> ({{\--require-hashes}}, {{\--no-deps}}), then runs {{pip check}}.
> * rsync: add MSYS2's popt, which provides {{msys-popt-0.dll}}, and check that
> {{rsync.exe}} starts. Stop copying MSYS2's libopenssl 3.5.2 and libzstd DLLs
> over the ones Git for Windows ships (OpenSSL 3.5.9, and an identical zstd).
> * Download, check, install, verify and clean up each tool in one RUN, so no
> installer or archive stays in a lower layer, and check the exit codes of the
> Visual Studio, JDK and Visual C++ 2010 installers.
> * Set PATH once, for all users, instead of seven per-user {{setx}} calls.
> * Copy only the Python scripts and the requirements file from
> {{pkg-resolver}}, so changes to the Linux scripts there no longer invalidate
> the Windows image's later layers.
> * BUILDING.txt: the image is now about 14 GB.
> Every version chosen is at least 7 days old, as SECURITY.md's cooldown
> requires ({{.github/dependabot.yml}} uses 7 days). Git for Windows 2.56.1, a
> security release, qualifies on 17 November; the pull request will move to it
> then.
> *Testing*
> [Fork run
> 43631843328|https://github.com/GauthamBanasandra/hadoop/actions/runs/43631843328]
> tested this change on top of HADOOP-20087, with the trial GitHub Actions
> workflow in my fork that is not part of this change. The pull request links a
> run of its final version. Sizes are in decimal GB; the run summaries print
> GiB.
> * The default (ltsc2022) image built on windows-2022 in 39 minutes: 14.4 GB,
> 5.8 GB compressed, down from 16.9 GB and 6.6 GB with HADOOP-20087 alone. As
> the build user, the image has Visual Studio 16.11.62, git 2.56.0.windows.4
> and rsync 3.5.1 (which starts), and pip lists only pip 24.0, setuptools
> 65.5.1, python-dateutil 2.8.1 and six 1.17.0, with {{pip check}} passing.
> Nothing is left in {{C:\}} or {{C:\ProgramData}} apart from the installed
> tools.
> * The ltsc2019 image, the Jenkins path, built under Hyper-V on windows-2022
> (10.0.17763.9488): 14.2 GB, down from 16.0 GB. Its entry point, rsync and
> {{pip check}} ran.
> * Full {{\-Pnative-win}} builds and the native smoke test passed on
> windows-2022 and windows-2025 under process isolation and on windows-2022
> under Hyper-V isolation. The Windows-specific unit tests passed on
> windows-2022: 12 classes, 275 tests, no failures, 33 skipped, with the same
> six methods excluded as for HADOOP-20087.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]