Skip to content

Conversation

dkurepa
Copy link
Member

@dkurepa dkurepa commented Mar 15, 2024

dotnet/source-build#4198
Adds a task that creates a VerticalAssetManifest.

Needs to be merged after #18917

.Select(attribute => attribute.ToString())
.ToHashSet();

if (assetManifestXmls.Skip(1).Any(assetManifestXml =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever

-->
<EnvironmentVariables Include="OfficialBuildId=$(OfficialBuildId)" />
<!-- The BUILD_BUILDNUMBER environmental variable is set by the AzDo agent. We're overwriting it below, so we need to save it in a different env variable -->
<EnvironmentVariables Include="VmrBuildNumber=$(BUILD_BUILDNUMBER)"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you actually want this in the root build.proj and not the repo-project build proj. since the VerticalManifest publish is not specific to a repo project. That probably means you don't have to set an env var, just use BUILD_BUILDNUMBER

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, I think it should be based off OfficialBuildId. That should be set at some level to BUILD_BUILDNUMBER.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defined the OfficialBuildId property in the base Directory.Build.props. My msbuild knowledge might be wrong here, but I think it will have the value we want it to when we're calling the PublishVerticalManifest task, since the values set in repo-projects will be reset

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, so this is for future use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we need it for the PublishVerticalManifest task, to set the correct BuildId. But it looks like it's not working as I thought it should. The OfficialBuildId is not getting set to anything after we're done with repo-projs. Think we'll have to save it in a different property before we start building

using System.Xml.Linq;

namespace Microsoft.DotNet.SourceBuild.Tasks.PublishVerticalManifest
namespace Microsoft.DotNet.SourceBuild.Tasks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a source-build task. Consider renaming this to something like Microsoft.DotNet.UnifiedBuild.Tasks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this would force you to rename everything, so I'm ok with keeping this name for now.

…eBuild.Tasks.MergeAssetManifests/PublishVerticalManifest.cs
@ViktorHofer ViktorHofer enabled auto-merge (squash) March 26, 2024 14:37
<Target Name="MergeAssetManifests" AfterTargets="Build">
<PropertyGroup>
<MergedAssetManifestOutputPath>$(ArtifactsDir)VerticalManifest.xml</MergedAssetManifestOutputPath>
<VmrBuildNumber>$(BUILD_BUILDNUMBER)</VmrBuildNumber>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this property after L7 in this file and see if that changes anything.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should work there, before we go into repo-projects

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a repo changes this env var?!? Super weird.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, no idea why it's not available now. Looks like we stopped publishing binlogs..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this variable mentioned anywhere else in the code.. I reverted back to the Build.props change

@ViktorHofer ViktorHofer merged commit ca9773f into dotnet:main Mar 26, 2024
<!-- The predefined environmental variable `BUILD_BUILDNUMBER` is getting overwritten in repo-projects,
so save it in a different varialbe-->
<PropertyGroup>
<VmrBuildNumber>$(BUILD_BUILDNUMBER)"</VmrBuildNumber>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the extra " wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants