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

Making arcade self buildable #1407

Merged
merged 23 commits into from
Dec 11, 2018
Merged

Making arcade self buildable #1407

merged 23 commits into from
Dec 11, 2018

Conversation

jcagme
Copy link
Contributor

@jcagme jcagme commented Nov 28, 2018

@mmitche
Copy link
Member

mmitche commented Nov 29, 2018

Is this Windows only?

eng/common/build.ps1 Outdated Show resolved Hide resolved
Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

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

🕐

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
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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).

Build.cmd Outdated Show resolved Hide resolved
eng/updatesdk.ps1 Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
eng/updatesdk.ps1 Outdated Show resolved Hide resolved
@jcagme
Copy link
Contributor Author

jcagme commented Dec 4, 2018

Test build with new Validation leg here: https://dnceng.visualstudio.com/internal/_build/results?buildId=52048

@jcagme
Copy link
Contributor Author

jcagme commented Dec 6, 2018

@tmat @chcosta after our several chats and conversations the following validates itself by using packages built locally. These packages are located in artifacts/validatesdk and will be restored from there by the official part of the build. PTAL

Test build: https://dnceng.visualstudio.com/internal/_build/results?buildId=53341

Build.cmd Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
eng/common/CIBuild.cmd Outdated Show resolved Hide resolved
eng/validatesdk.ps1 Outdated Show resolved Hide resolved
eng/validatesdk.ps1 Outdated Show resolved Hide resolved
eng/validatesdk.ps1 Outdated Show resolved Hide resolved
eng/common/CIBuild.cmd Outdated Show resolved Hide resolved
eng/validatesdk.ps1 Outdated Show resolved Hide resolved
azure-pipelines.yml Outdated Show resolved Hide resolved
eng/validate-sdk.ps1 Outdated Show resolved Hide resolved
eng/validate-sdk.ps1 Outdated Show resolved Hide resolved
@jcagme
Copy link
Contributor Author

jcagme commented Dec 10, 2018

@tmat I've added eng/Tools.props as suggested. Also, addressed the other minor details. Can you please confirm this is good to merge?

eng/Tools.props Outdated Show resolved Hide resolved
eng/Tools.props Outdated Show resolved Hide resolved
eng/common/CIBuild.cmd Outdated Show resolved Hide resolved
eng/common/build.ps1 Outdated Show resolved Hide resolved
eng/common/build.ps1 Outdated Show resolved Hide resolved
@jcagme
Copy link
Contributor Author

jcagme commented Dec 10, 2018

@chcosta can you take a final look please?

@@ -57,27 +55,31 @@ jobs:
_PublishType: none
_SignType: test
_DotNetPublishToBlobFeed : false
_Script: eng\common\cibuild.cmd
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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 


Push-Location $PSScriptRoot

$validateSdkDir = "$ArtifactsDir\validatesdk\\"
Copy link
Member

Choose a reason for hiding this comment

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

why the double backslash?

Copy link
Contributor Author

@jcagme jcagme Dec 10, 2018

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?

Copy link
Member

Choose a reason for hiding this comment

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

Use Join-Path

Copy link
Contributor Author

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

Copy link
Member

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 \

Copy link
Contributor Author

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

@@ -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"
Copy link
Member

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.

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

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

:shipit:

@jcagme jcagme merged commit 1b50ed6 into dotnet:master Dec 11, 2018
@jcagme jcagme deleted the self-build branch December 11, 2018 19:43
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