Add TarDirectory and Untar tasks for creating and extracting tar archives#14451
Add TarDirectory and Untar tasks for creating and extracting tar archives#14451ViktorHofer with Copilot wants to merge 28 commits into
Conversation
|
Hello @copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
…rammar Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
|
@copilot looks like the current code falls back to not use gzip when a compression type is passed in that's unrecognized. Given that we will expand this matrix, I would throw an error if an unrecognized compression type is passed in instead of silently falling back to not use gzip. |
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Done — an unrecognized |
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
… in TrimStart Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
The stage1 and stage2 CI builds both default their binary log to Build.binlog, so publishing them to the same artifacts location collides. Declare ci/binaryLog/excludeCIBinarylog as first-class parameters, forward them to both stage builds, and pass -binaryLogName Build.stage2.binlog to stage2 when a binlog will actually be produced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2a6b38b1-0da7-488f-9938-3ac1051e15e2
Moving the stage 1 artifacts aside relocated its Build.binlog out of the published artifacts/log directory, so CI only published the stage 2 binlog. Copy the stage 1 binlog back as Build.stage1.binlog right after the move (best-effort; skipped when no binlog was produced). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2a6b38b1-0da7-488f-9938-3ac1051e15e2
Instead of copying just the stage 1 binlog, copy the whole stage 1 log directory back into artifacts/log after the move, so CI publishes all stage 1 logs alongside the stage 2 ones. Runs before the stage 2 build, so it won't clobber stage 2 output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2a6b38b1-0da7-488f-9938-3ac1051e15e2
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
… enum Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
|
@copilot add an |
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Added the |
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
|
@copilot fix the build failures |
Co-authored-by: ViktorHofer <7412651+ViktorHofer@users.noreply.github.com>
Fixed the build failure. The CI break was |
|
@baronfel if you have some time would you taking a look? The tasks are now using the new task types that you mentioned. Not a high priority at all at the moment. |
Adds a
TarDirectoryinbox task that produces.tar(and optionally.tar.gz) archives from a directory, mirroring the existingZipDirectorytask. SinceSystem.Formats.Tarrequires .NET, the task is authored as .NET-only and is unavailable in Visual Studio / MSBuild.exe.Context
The existing
ZipDirectory/Unziptasks have no tar equivalent. The maintainer discussion settled on shipping this as the first .NET (core)-only inbox task, provided theUsingTaskis authored to only bind on the .NET runtime.Changes Made
TarDirectorytask (src/Tasks/TarDirectory.cs): creates a tar fromSourceDirectorytoDestinationFileviaSystem.Formats.Tar. Parameters mirrorZipDirectory:Overwrite,FailIfNotIncremental, plus an optionalCompression(Nonedefault, orGZip).MSB4322) unlessOverwrite="true".Compressionvalues warn (MSB4324) and fall back to an uncompressed tar.zstdwas omitted as it isn't in the BCL.TarDirectory.cscompiles only for.NETCoreApp; theUsingTaskinMicrosoft.Common.tasksis registered withRuntime="NET"andCondition="'$(MSBuildRuntimeType)' == 'Core'".MSB4321–MSB4330inStrings.resx, synced to all.xlffiles.TarDirectory_Tests.cs(net-only) covering plain/GZip creation, overwrite, and the error/warning paths.FailIfNotIncrementalbehavior indocumentation/specs/question.md.Testing
Unit tests in
TarDirectory_Tests.cs; also verified end-to-end via the bootstrap MSBuild that emitted.tarand.tar.gzarchives readable by the systemtarutility.Notes
Two Code Review comments were intentionally left to stay byte-for-byte consistent with
ZipDirectory: the "Question" doc-comment terminology, and reusing theCommentresource for question-mode output. Open to diverging if reviewers prefer.