Skip to content

Commit 8c65ad1

Browse files
committed
build: use bazel for snapshot builds
1 parent 10adcea commit 8c65ad1

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
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
@@ -69,7 +69,7 @@
6969
"@angular/compiler": "14.0.0-next.0",
7070
"@angular/compiler-cli": "14.0.0-next.0",
7171
"@angular/core": "14.0.0-next.0",
72-
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#2024033f3123cd1beed78d43ec7269467cd9fa93",
72+
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a",
7373
"@angular/forms": "14.0.0-next.0",
7474
"@angular/localize": "14.0.0-next.0",
7575
"@angular/material": "14.0.0-next.0",

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: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
"@angular-devkit/core" "13.2.0"
5252
rxjs "6.6.7"
5353

54-
"@angular-devkit/build-angular@^13.2.0-rc":
55-
version "13.2.0"
56-
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-13.2.0.tgz#5880890b5083a31f96d237ffee5f82af6fcc11a8"
57-
integrity sha512-cHnm/P7uKJjKh2BCN8gnnd240J5z3IesQyRAx88kFSlL5sKCGyGoAYKAjU585/lllIXjtFXSR/S2d/cHg8ShKw==
54+
"@angular-devkit/[email protected].1":
55+
version "13.2.0-rc.1"
56+
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-13.2.0-rc.1.tgz#d07eeec25c00c9ed025aa599263d98ad22d39f4a"
57+
integrity sha512-kKElUuHAocImUQmYnlkmk/8UJh8eYw7GqvcfSxIcxJ8euLS2hnavmUCexxtlPsgWmwJTdwXDnRYVCmr4n8hQqA==
5858
dependencies:
5959
"@ampproject/remapping" "1.1.1"
6060
"@angular-devkit/architect" "0.1302.0"
@@ -212,14 +212,13 @@
212212
dependencies:
213213
tslib "^2.0.0"
214214

215-
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#2024033f3123cd1beed78d43ec7269467cd9fa93":
216-
version "0.0.0-354871956801929457d9f08482fb81f7012ed7c8"
217-
uid "2024033f3123cd1beed78d43ec7269467cd9fa93"
218-
resolved "https://github.com/angular/dev-infra-private-builds.git#2024033f3123cd1beed78d43ec7269467cd9fa93"
215+
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a":
216+
version "0.0.0-c922f5b23611024bc9d94833ae147f6048ab0275"
217+
resolved "https://github.com/angular/dev-infra-private-builds.git#3a34722a82fb0e8cd3fa00dfc5476767a35e021a"
219218
dependencies:
220219
"@actions/core" "^1.4.0"
221220
"@actions/github" "^5.0.0"
222-
"@angular-devkit/build-angular" "^13.2.0-rc"
221+
"@angular-devkit/build-angular" "13.2.0-rc.1"
223222
"@angular/benchpress" "0.2.1"
224223
"@babel/core" "^7.16.0"
225224
"@bazel/bazelisk" "^1.10.1"

0 commit comments

Comments
 (0)