-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from dagood/dev/dagood/merge-b1.16-from-1.16
[boring-1.16] Merge from 1.16
- Loading branch information
Showing
10 changed files
with
160 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/microsoft/go/_core/archive" | ||
) | ||
|
||
const description = ` | ||
This command creates a source archive of the Go submodule at HEAD. | ||
` | ||
|
||
func main() { | ||
output := flag.String("o", "", "The path of the archive file to create, including extension. Default: a tar.gz file including build number in 'eng/artifacts/bin'.") | ||
help := flag.Bool("h", false, "Print this help message.") | ||
|
||
flag.Usage = func() { | ||
fmt.Fprintf(flag.CommandLine.Output(), "Usage:\n") | ||
flag.PrintDefaults() | ||
fmt.Fprintf(flag.CommandLine.Output(), "%s\n", description) | ||
} | ||
|
||
flag.Parse() | ||
if *help { | ||
flag.Usage() | ||
return | ||
} | ||
|
||
repoRootDir, err := os.Getwd() | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
goRootDir := filepath.Join(repoRootDir, "go") | ||
|
||
if err := archive.CreateFromSource(goRootDir, *output); err != nil { | ||
panic(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
parameters: | ||
# { id, os, arch, config, distro? } | ||
builder: {} | ||
createSourceArchive: false | ||
|
||
jobs: | ||
- job: ${{ parameters.builder.id }} | ||
|
@@ -41,34 +42,30 @@ jobs: | |
Write-Host "##vso[task.setvariable variable=GO_MAKE_MAX_RETRY_ATTEMPTS]5" | ||
displayName: Increase 'make' retry attempts | ||
# Initialize stage 0 toolset ahead of time so we can track timing data separately from the | ||
# build operations. When we call this script again later, it won't download Go again. | ||
- pwsh: | | ||
. eng/utilities.ps1 | ||
Get-Stage0GoRoot | ||
displayName: Init stage 0 Go toolset | ||
- template: ../steps/init-submodule-task.yml | ||
|
||
# Create the source archive on one job only. The os choice is arbitrary. | ||
- ${{ if and(eq(parameters.createSourceArchive, true), eq(parameters.builder.config, 'buildandpack'), eq(parameters.builder.os, 'linux')) }}: | ||
- pwsh: | | ||
git config --global user.name "microsoft-golang-bot" | ||
git config --global user.email "[email protected]" | ||
# Turn the patches into commits, so HEAD includes the changes. | ||
eng/run.ps1 submodule-refresh -commits | ||
eng/run.ps1 pack-source | ||
displayName: Archive submodule source | ||
- pwsh: | | ||
function fetch_submodule() { | ||
eng/run.ps1 submodule-refresh -shallow @args | ||
} | ||
if ("$env:FETCH_BEARER_TOKEN") { | ||
fetch_submodule ` | ||
-origin 'https://[email protected]/dnceng/internal/_git/microsoft-go-mirror' ` | ||
-fetch-bearer-token $env:FETCH_BEARER_TOKEN | ||
} else { | ||
fetch_submodule | ||
} | ||
# If non-public, use access token to fetch from repo. If public, don't use the access token, | ||
# because anonymous auth is fine. | ||
${{ if ne(variables['System.TeamProject'], 'public') }}: | ||
env: | ||
FETCH_BEARER_TOKEN: $(System.AccessToken) | ||
displayName: Set up submodule from internal mirror | ||
${{ if eq(variables['System.TeamProject'], 'public') }}: | ||
displayName: Set up submodule | ||
# Apply the patches as staged changes, so the HEAD commit is the same as upstream. | ||
eng/run.ps1 submodule-refresh | ||
displayName: Apply patches | ||
# Use build script directly for "buildandpack". If we used run-builder, we would need to | ||
# download its external module dependencies. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
# Shallow checkout sources on Windows | ||
steps: | ||
- pwsh: | | ||
function fetch_submodule() { | ||
eng/run.ps1 submodule-refresh -shallow -skip-patch @args | ||
} | ||
if ("$env:FETCH_BEARER_TOKEN") { | ||
fetch_submodule ` | ||
-origin 'https://[email protected]/dnceng/internal/_git/microsoft-go-mirror' ` | ||
-fetch-bearer-token $env:FETCH_BEARER_TOKEN | ||
} else { | ||
fetch_submodule | ||
} | ||
# If non-public, use access token to fetch from repo. If public, don't use the access token, | ||
# because anonymous auth is fine. | ||
${{ if ne(variables['System.TeamProject'], 'public') }}: | ||
env: | ||
FETCH_BEARER_TOKEN: $(System.AccessToken) | ||
displayName: Set up submodule from internal mirror | ||
${{ if eq(variables['System.TeamProject'], 'public') }}: | ||
displayName: Set up submodule |