forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
147 lines (130 loc) · 5.65 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
param ([String]$mode = 'full')
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)"
}
function build-partial() {
bazel build `-`-experimental_execution_log_file ${ARTIFACT_DIRS}/build_partial_execution_windows.log `
//:git-revision `
//compiler/daml-lf-ast/... `
//compiler/haskell-ide-core/... `
//daml-lf/interface/... `
//language-support/java/bindings/... `
//navigator/backend/... `
//navigator/frontend/...
bazel shutdown
bazel test `
//daml-lf/interface/... `
//language-support/java/bindings/... `
//navigator/backend/...
}
function build-full() {
# 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_full_execution_windows.log `
//release:sdk-release-tarball `
//:git-revision `
@com_github_grpc_grpc//:grpc `
//3rdparty/... `
//nix/third-party/gRPC-haskell:grpc-haskell `
//daml-assistant:daml `
//daml-foundations/daml-tools/daml-extension/... `
//daml-foundations/daml-tools/da-hs-damlc-app:damlc-dist `
//daml-foundations/daml-tools/docs/... `
//daml-foundations/daml-tools/language-server-tests:lib-js `
//daml-lf/archive:daml_lf_archive_scala `
//daml-lf/archive:daml_lf_archive_protos_zip `
//daml-lf/archive:daml_lf_archive_protos_tarball `
//compiler/haskell-ide-core/... `
//compiler/daml-lf-ast/... `
//daml-lf/data/... `
//daml-lf/engine:engine `
//daml-lf/interface/... `
//daml-lf/interpreter/... `
//daml-lf/lfpackage/... `
//daml-lf/parser/... `
//daml-lf/repl/... `
//daml-lf/scenario-interpreter/... `
//daml-lf/transaction-scalacheck/... `
//daml-lf/validation/... `
//extractor:extractor-binary `
//language-support/java/testkit:testkit `
//language-support/java/bindings/... `
//language-support/java/bindings-rxjava/... `
//ledger/api-server-damlonx:api-server-damlonx `
//ledger/api-server-damlonx/reference:reference `
//ledger/backend-api/... `
//ledger/ledger-api-akka/... `
//ledger/ledger-api-client/... `
//ledger/ledger-api-common/... `
//ledger/ledger-api-domain/... `
//ledger/ledger-api-server-example/... `
//ledger/ledger-api-scala-logging/... `
//ledger/ledger-api-server-example/... `
//ledger/participant-state/... `
//ledger/participant-state-index/... `
//ledger/sandbox:sandbox `
//ledger/sandbox:sandbox-binary `
//ledger/sandbox:sandbox-tarball `
//ledger/sandbox:sandbox-head-tarball `
//ledger-api/... `
//navigator/backend/... `
//navigator/frontend/... `
//pipeline/... `
//scala-protoc-plugins/...
# 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
bazel run `
//daml-foundations/daml-tools/da-hs-damlc-app `-`- `-h
# 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
bazel test `
//daml-lf/data/... `
//daml-lf/interface/... `
//daml-lf/interpreter/... `
//daml-lf/lfpackage/... `
//daml-lf/parser/... `
//daml-lf/validation/... `
//language-support/java/bindings/... `
//language-support/java/bindings-rxjava/... `
//ledger/ledger-api-client/... `
//ledger/ledger-api-common/... `
//ledger-api/... `
//navigator/backend/... `
//pipeline/...
}
# FIXME:
# @haskell_c2hs//... `
#ERROR: C:/users/vssadministrator/_bazel_vssadministrator/w3d6ug6o/external/haskell_c2hs/BUILD.bazel:16:3: unterminated string literal at eol
#ERROR: C:/users/vssadministrator/_bazel_vssadministrator/w3d6ug6o/external/haskell_c2hs/BUILD.bazel:17:1: unterminated string literal at eol
#ERROR: C:/users/vssadministrator/_bazel_vssadministrator/w3d6ug6o/external/haskell_c2hs/BUILD.bazel:17:1: Implicit string concatenation is forbidden, use the + operator
#ERROR: C:/users/vssadministrator/_bazel_vssadministrator/w3d6ug6o/external/haskell_c2hs/BUILD.bazel:17:1: syntax error at '",
#"': expected ,
Write-Output "Running in $mode mode"
bazel shutdown
if ($mode -eq "partial") {
build-partial
} else {
build-full
}