forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
108 lines (97 loc) · 4.1 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
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
function bazel() {
Write-Output ">> bazel $args"
$global:lastexitcode = 0
$backupErrorActionPreference = $script:ErrorActionPreference
$script:ErrorActionPreference = "Continue"
& bazel.exe --bazelrc=.\nix\bazelrc @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 `
//:git-revision `
//compiler/daml-lf-ast/... `
//daml-lf/interface/... `
//language-support/java/bindings/...
bazel shutdown
bazel test `
//daml-lf/interface/... `
//language-support/java/bindings/...
}
function build-full() {
# FIXME: Until all bazel issues on Windows are resolved we will be testing only specific bazel targets
bazel build `
//:git-revision `
@com_github_grpc_grpc//:grpc `
//nix/third-party/gRPC-haskell/core:fat_cbits `
//daml-foundations/daml-tools/daml-extension:daml_extension_lib `
//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/... `
//daml-foundations/daml-tools/docs/... `
//language-support/java/testkit:testkit `
//language-support/java/bindings/... `
//language-support/java/bindings-rxjava/... `
//ledger/backend-api/... `
//ledger/ledger-api-client/... `
//ledger/ledger-api-common/... `
//ledger/ledger-api-domain/... `
//ledger/ledger-api-server-example `
//ledger-api/rs-grpc-akka/... `
//pipeline/samples/bazel/java/... `
//pipeline/samples/bazel/haskell/...
# 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/rs-grpc-akka/... `
//pipeline/samples/bazel/java/... `
//pipeline/samples/bazel/haskell/...
}
# 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"
if ($mode -eq "partial") {
build-partial
} else {
build-full
}