forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
94 lines (84 loc) · 3.59 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
.\dev-env\windows\bin\dadew.ps1 install
.\dev-env\windows\bin\dadew.ps1 sync
.\dev-env\windows\bin\dadew.ps1 enable
if (!(Test-Path .\.bazelrc.local)) {
Set-Content -Path .\.bazelrc.local -Value 'build --config windows'
}
$ARTIFACT_DIRS = if ("$env:BUILD_ARTIFACTSTAGINGDIRECTORY") { $env:BUILD_ARTIFACTSTAGINGDIRECTORY } else { Get-Location }
function bazel() {
Write-Output ">> bazel $args"
$global:lastexitcode = 0
$backupErrorActionPreference = $script:ErrorActionPreference
$script:ErrorActionPreference = "Continue"
& bazel.exe @args 2>&1 | %{ "$_" }
$script:ErrorActionPreference = $backupErrorActionPreference
if ($global:lastexitcode -ne 0 -And $args[0] -ne "shutdown") {
Write-Output "<< bazel $args (failed, exit code: $global:lastexitcode)"
throw ("Bazel returned non-zero exit code: $global:lastexitcode")
}
Write-Output "<< bazel $args (ok)"
}
# ScalaCInvoker, a Bazel worker, created by rules_scala opens some of the bazel execroot's files,
# which later causes issues on Bazel init (source forest creation) on Windows. A shutdown closes workers,
# which is a workaround for this problem.
bazel shutdown
# FIXME: Until all bazel issues on Windows are resolved we will be testing only specific bazel targets
bazel build `-`-experimental_execution_log_file ${ARTIFACT_DIRS}/build_execution_windows.log `
//release:sdk-release-tarball `
//release/windows-installer:windows-installer `
//:git-revision `
@com_github_grpc_grpc//:grpc `
@haskell_c2hs//... `
//3rdparty/... `
//nix/third-party/gRPC-haskell:grpc-haskell `
//daml-assistant/... `
//daml-foundations/... `
//compiler/... `
//daml-lf/... `
//extractor/... `
//language-support/codegen-common:test `
//language-support/codegen-main/... `
//language-support/hs/bindings/... `
//language-support/java/... `
//language-support/scala/... `
//ledger/... `
//ledger-api/... `
//navigator/backend/... `
//navigator/frontend/... `
//scala-protoc-plugins/...
bazel shutdown
bazel run `
//daml-foundations/daml-tools/da-hs-damlc-app `-`- `-h
bazel shutdown
bazel test `-`-experimental_execution_log_file ${ARTIFACT_DIRS}/test_execution_windows.log `
//daml-lf/... `
//language-support/codegen-common:test `
//language-support/java/... `
//language-support/scala/... `
//ledger/ledger-api-client/... `
//ledger/ledger-api-common/... `
//ledger-api/... `
//navigator/backend/... `
//daml-assistant/... `
//daml-foundations/daml-ghc:daml-ghc-deterministic `
//daml-foundations/daml-ghc:compile-subdir `
//daml-foundations/daml-ghc:bond-trading-memory `
//daml-foundations/daml-ghc:compile-empty `
//daml-foundations/daml-ghc:daml-ghc-deterministic `
//daml-foundations/daml-ghc:examples-memory `
//daml-foundations/daml-ghc:module-tree-memory `
//daml-foundations/daml-ghc:tasty-test `
//daml-foundations/daml-tools/da-hs-daml-cli `
//daml-foundations/daml-tools/da-hs-damlc-app/... `
//compiler/lsp-tests/...
# Disabled since there seems to be an issue with starting up the scenario service.
# See https://github.com/digital-asset/daml/issues/1354
# //daml-foundations/daml-ghc:daml-ghc-shake-test-ci
#
# Disabled due to scenario service issue mentioned above and
# encoding issues for daml-foundations/daml-ghc/tests/Unicode.daml
# See: https://github.com/digital-asset/daml/issues/1421
# //daml-foundations/daml-ghc:daml-ghc-test-all
# //daml-foundations/daml-ghc:daml-ghc-test-dev