Skip to content

Commit 491e210

Browse files
kormidedgp1130
authored andcommitted
build: use bazel for snapshot builds
(cherry picked from commit 8c65ad1)
1 parent 68dc99c commit 491e210

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ jobs:
270270
resource_class: medium
271271
steps:
272272
- custom_attach_workspace
273+
- install_python
273274
- run:
274275
name: Decrypt Credentials
275276
# Note: when changing the image, you might have to re-encrypt the credentials with a

lib/packages.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,15 @@ const packageJsonPaths = [
152152
..._findPrimaryPackageJsonFiles(path.join(__dirname, '..', 'packages'), excludeRe),
153153
];
154154

155-
function _exec(cmd: string) {
156-
return execSync(cmd).toString().trim();
155+
function _exec(cmd: string, opts?: { cwd?: string }) {
156+
return execSync(cmd, opts).toString().trim();
157157
}
158158

159159
let gitShaCache: string;
160160
function _getSnapshotHash(_pkg: PackageInfo): string {
161161
if (!gitShaCache) {
162-
gitShaCache = _exec('git log --format=%h -n1');
162+
const opts = { cwd: __dirname }; // Ensure we call git from within this repo
163+
gitShaCache = _exec('git log --format=%h -n1', opts);
163164
}
164165

165166
return gitShaCache;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@angular/compiler": "13.1.3",
7171
"@angular/compiler-cli": "13.1.3",
7272
"@angular/core": "13.1.3",
73-
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#2024033f3123cd1beed78d43ec7269467cd9fa93",
73+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a",
7474
"@angular/forms": "13.1.3",
7575
"@angular/localize": "13.1.3",
7676
"@angular/material": "13.1.3",

scripts/snapshots.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import * as fs from 'fs';
1212
import * as os from 'os';
1313
import * as path from 'path';
1414
import { PackageInfo, packages } from '../lib/packages';
15-
import build from './build';
15+
import build from './build-bazel';
1616
import create from './create';
1717

1818
// Added to the README.md of the snapshot. This is markdown.

tools/defaults.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
7070
# Version of the local package being built, generated via the `--workspace_status_command` flag.
7171
"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}",
7272
"0.0.0-EXPERIMENTAL-PLACEHOLDER": "{BUILD_SCM_EXPERIMENTAL_VERSION}",
73-
"BUILD_SCM_HASH-PLACEHOLDER": "{BUILD_SCM_COMMIT_SHA}",
73+
"BUILD_SCM_HASH-PLACEHOLDER": "{BUILD_SCM_ABBREV_HASH}",
7474
"0.0.0-ENGINES-NODE": RELEASE_ENGINES_NODE,
7575
"0.0.0-ENGINES-NPM": RELEASE_ENGINES_NPM,
7676
"0.0.0-ENGINES-YARN": RELEASE_ENGINES_YARN,

tools/snapshot_repo_filter.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load("//:constants.bzl", "SNAPSHOT_REPOS")
88
def _generate_snapshot_repo_filter():
99
filter = ""
1010
for (i, pkg_name) in enumerate(SNAPSHOT_REPOS.keys()):
11-
filter += "{sep}(..|objects|select(has(\"{pkg_name}\")))[\"{pkg_name}\"] |= \"github:{snapshot_repo}:BUILD_SCM_HASH-PLACEHOLDER\"\n".format(
11+
filter += "{sep}(..|objects|select(has(\"{pkg_name}\")))[\"{pkg_name}\"] |= \"github:{snapshot_repo}#BUILD_SCM_HASH-PLACEHOLDER\"\n".format(
1212
sep = "| " if i > 0 else "",
1313
pkg_name = pkg_name,
1414
snapshot_repo = SNAPSHOT_REPOS[pkg_name],

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@angular-devkit/core" "13.2.0-rc.1"
4343
rxjs "6.6.7"
4444

45-
"@angular-devkit/build-angular@^13.2.0-rc":
45+
"@angular-devkit/[email protected].1":
4646
version "13.2.0-rc.1"
4747
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-13.2.0-rc.1.tgz#d07eeec25c00c9ed025aa599263d98ad22d39f4a"
4848
integrity sha512-kKElUuHAocImUQmYnlkmk/8UJh8eYw7GqvcfSxIcxJ8euLS2hnavmUCexxtlPsgWmwJTdwXDnRYVCmr4n8hQqA==
@@ -203,13 +203,13 @@
203203
dependencies:
204204
tslib "^2.0.0"
205205

206-
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#2024033f3123cd1beed78d43ec7269467cd9fa93":
207-
version "0.0.0-354871956801929457d9f08482fb81f7012ed7c8"
208-
resolved "https://github.com/angular/dev-infra-private-builds.git#2024033f3123cd1beed78d43ec7269467cd9fa93"
206+
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a":
207+
version "0.0.0-c922f5b23611024bc9d94833ae147f6048ab0275"
208+
resolved "https://github.com/angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a"
209209
dependencies:
210210
"@actions/core" "^1.4.0"
211211
"@actions/github" "^5.0.0"
212-
"@angular-devkit/build-angular" "^13.2.0-rc"
212+
"@angular-devkit/build-angular" "13.2.0-rc.1"
213213
"@angular/benchpress" "0.2.1"
214214
"@babel/core" "^7.16.0"
215215
"@bazel/bazelisk" "^1.10.1"

0 commit comments

Comments
 (0)