Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild task for creating Tar files #7944

Open
stan-sz opened this issue Sep 5, 2022 · 18 comments
Open

MSBuild task for creating Tar files #7944

stan-sz opened this issue Sep 5, 2022 · 18 comments
Labels
Area: Tasks Issues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll. gathering-feedback The issue requires feedback in order to be planned, please comment if the feature is useful for you Partner request triaged

Comments

@stan-sz
Copy link
Contributor

stan-sz commented Sep 5, 2022

With .Net 7 support for tar apis, is it feasible to create an equivalent of (Un)ZipDirectory tasks for handling .tar files in the upcoming MSBuild release?

@stan-sz stan-sz added the needs-triage Have yet to determine what bucket this goes in. label Sep 5, 2022
@danmoseley
Copy link
Member

Cc @carlossanlop fyi

@KalleOlaviNiemitalo
Copy link

Would such a task be able to work when MSBuild is run on .NET Framework? System.Formats.Tar doesn't appear to target anything compatible with that.

https://github.com/dotnet/runtime/blob/eecb02807867cad56cd05badddef65e432248b75/src/libraries/System.Formats.Tar/src/System.Formats.Tar.csproj#L3

@danmoseley
Copy link
Member

No it would only work on .NET 7 and later. I believe that would mean .NET SDK 7.0.something and later, targeting any version.

@rainersigwald
Copy link
Member

We don't yet have any inbox tasks that are .NET (core) only, which might be enough to delay this. But I think it sounds like a reasonable idea.

@KalleOlaviNiemitalo
Copy link

If a task that requires .NET is added and a user tries to run it on .NET Framework, I hope it will log an error saying that the task doesn't support .NET Framework, rather than MSB4036.

<trans-unit id="MissingTaskError">
<source>MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with &lt;UsingTask&gt; in the project file, or in the *.tasks files located in the "{1}" directory.</source>
<note>{StrBegin="MSB4036: "}LOCALIZATION: &lt;UsingTask&gt; and "*.tasks" should not be localized.</note>
</trans-unit>

@rainersigwald
Copy link
Member

@KalleOlaviNiemitalo Yes, if the UsingTask is authored correctly (that is, specifies that the task is .NET-only).

@KalleOlaviNiemitalo
Copy link

I see, you added support for Runtime="NET" in #6994. It doesn't seem to be documented yet, so I filed https://github.com/MicrosoftDocs/visualstudio-docs/issues/8436.

@baronfel
Copy link
Member

baronfel commented Sep 7, 2022

This is a great idea, and we should do it.

However, this task would require a .NET 7 Runtime, which brings up an interesting conundrum. That would require MSBuild to update its Target Framework to net7.0, but for support reasons we really really try to keep components that ship in the .NET SDK to Long-Term-Support Target Frameworks. We're having a discussion about the mechanics of this later this week, but in general because of SDK and Visual Studio support cycles and overlaps (or lack thereof) between the two, we try to limit the amount of STS (short-term support)-only features we use in the product to enable us to fallback to run on supported runtimes when the STS stables go out of support.

That would mean that this Task would either need to be conditioned somehow, or wait until we start targeting net8.0 for MSBuild (which would be something like the 17.8 MSBuild/VS version numbers if memory serves).

@benvillalobos
Copy link
Member

In that case, blocked on #7790 and should be conditioned. We can add this to the next spring planning and discuss it then. Conditioning out the task should be easy enough.

@benvillalobos benvillalobos added this to the .NET 8.0 milestone Sep 15, 2022
@benvillalobos benvillalobos removed the needs-triage Have yet to determine what bucket this goes in. label Sep 15, 2022
@stan-sz
Copy link
Contributor Author

stan-sz commented Nov 18, 2022

@benvillalobos can this work be scheduled for a minor release still in 7.0 timeframe (before .NET 8.0)?

@rainersigwald
Copy link
Member

@stan-sz MSBuild releases on the .NET SDK and Visual Studio cadence, so can add features ~quarterly.

@stan-sz
Copy link
Contributor Author

stan-sz commented Nov 21, 2023

A kind reminder about this feature request, @benvillalobos and @rainersigwald. Thanks!

@rainersigwald rainersigwald removed this from the .NET 8.0 milestone Nov 27, 2023
@rainersigwald rainersigwald added Area: Tasks Issues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll. Partner request needs-triage Have yet to determine what bucket this goes in. labels Nov 27, 2023
@rainersigwald
Copy link
Member

@stan-sz Are you ok with this only working in dotnet build, and not working in Visual Studio/MSBuild.exe?

@alexrp
Copy link

alexrp commented Dec 12, 2023

I would also love to see this. I'm currently doing this, which is... not great, for multiple reasons. (It only working in dotnet build would be fine in my case, since these projects are never evaluated/built from anything else, for whatever that's worth.)

@stan-sz
Copy link
Contributor Author

stan-sz commented Dec 18, 2023

@stan-sz Are you ok with this only working in dotnet build, and not working in Visual Studio/MSBuild.exe?

Yes

@stan-sz
Copy link
Contributor Author

stan-sz commented Jan 23, 2024

@rainersigwald - a kind reminder so this task makes it to the release. Thanks!

@maridematte maridematte added triaged gathering-feedback The issue requires feedback in order to be planned, please comment if the feature is useful for you and removed needs-triage Have yet to determine what bucket this goes in. labels Oct 15, 2024
@just-ero
Copy link

just-ero commented Jan 25, 2025

This feature would be very helpful for automating use of the WASI SDK, releases of which are archived using the Tarball format.

@KalleOlaviNiemitalo
Copy link

.NET TaskHost #4834 sprouted a number of sub-issues yesterday. If those were implemented, I imagine tar files could be created even if the build was started from MSBuild.exe or Visual Studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Tasks Issues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll. gathering-feedback The issue requires feedback in order to be planned, please comment if the feature is useful for you Partner request triaged
Projects
None yet
Development

No branches or pull requests

9 participants