-
Notifications
You must be signed in to change notification settings - Fork 361
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
Making arcade self buildable #1407
Conversation
Is this Windows only? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
eng/updatesdk.ps1
Outdated
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile $nugetExe | ||
|
||
Write-Host "Adding local nuget source..." | ||
& $nugetExe sources add -Name arcade-local -Source $packagesSource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? You can just pass the local directory path directly to RestoreSources, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried just passing /p:RestoreResouces
and the initial Arcade SDK is not restored. Thing like Versions.props
have $(RestoreResources)
and that is how the value is propagated. NuGet.config
doesn't have this, also, a source in NuGet.config
is not just the path but also a key
name so I wonder how would /p:RestoreResouces
work for NuGet.props
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the source for a custom SDK can come from a props file or property today, I think only NuGet.config is supported as the source for a custom SDK. At least that was my understanding like 6 months ago, perhaps this limitation has been fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is the case still
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about setting /p:RestoreConfigFile=Local.NuGet.config
, where Local.NuGet.config
would be one that points to the local package (you can generate the file to temp dir in the PS script).
Test build with new Validation leg here: https://dnceng.visualstudio.com/internal/_build/results?buildId=52048 |
@tmat @chcosta after our several chats and conversations the following validates itself by using packages built locally. These packages are located in Test build: https://dnceng.visualstudio.com/internal/_build/results?buildId=53341 |
@tmat I've added |
@chcosta can you take a final look please? |
azure-pipelines.yml
Outdated
@@ -57,27 +55,31 @@ jobs: | |||
_PublishType: none | |||
_SignType: test | |||
_DotNetPublishToBlobFeed : false | |||
_Script: eng\common\cibuild.cmd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might just do something like this for "_Script"
variables:
- name: _Script:
value: eng\common\cibuild.cmd
- name: _ValidateSdkArgs
value: ''
strategy:
matrix:
Build_Debug:
_BuildConfig: Debug
_PublishType: none
_SignType: test
_DotNetPublishToBlobFeed: false
Build_Release:
_BuildConfig: Release
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
_PublishType: none
_SignType: test
_DotNetPublishToBlobFeed : false
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
_PublishType: blob
_SignType: real
_DotNetPublishToBlobFeed : true
_Script: eng\validate-sdk.cmd
_ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken)
I think that will resolve correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, way better!
eng/Tools.props
Outdated
build can restore the local packages.--> | ||
<RestoreSources Condition="'$(ArcadeSelfTest)' == 'true'"> | ||
$(RestoreSources); | ||
$(ArtifactsDir)validatesdk\packages\$(Configuration)\NonShipping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like a strange and fragile coupling. Couldn't this just be something like...
<PropertyGroup>
<ResourceSources>
$(RestoreSources);
$(AdditionalRestoreSources);
</ResourceSources>
</PropertyGroup>
and then this line in validate-sdk.ps1...
. .\common\build.ps1 -configuration $configuration @Args /p:ArcadeSelfTest=true
… becomes...
. .\common\build.ps1 -configuration $configuration @Args /p:AdditionalRestoreSources=$packagesSource
eng/validate-sdk.ps1
Outdated
|
||
Push-Location $PSScriptRoot | ||
|
||
$validateSdkDir = "$ArtifactsDir\validatesdk\\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the double backslash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was originally a typo but when fixing it I realized that somewhere in the process last \
is removed ending up in folders like "validatesdktoolset". I searched the source and could not find a place where this could happen. $properties
in build.ps1
does receive the correct value so is probably something MSBuild does is stripping that last '' from the path. @tmat do you know what might be causing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Join-Path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Join-Path had no effect. Again, I think this is been removed in MSBuild rather than at the PS1 level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to do a check at https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Arcade.Sdk/tools/RepoLayout.props#L54 and ensure the path provided properly ends with a \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually based on the last change we won't need to set the ArtifactDir anymore so this is a no-op now
eng/common/build.sh
Outdated
@@ -27,6 +27,8 @@ usage() | |||
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')" | |||
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')" | |||
echo "" | |||
echo "Optional settings:" | |||
echo " -logFileName <value> Binlog file name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solves: #917
Test build: https://dnceng.visualstudio.com/internal/_build/results?buildId=49482