diff --git a/WORKSPACE b/WORKSPACE index 131759b1d6..e64e376df1 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -788,15 +788,6 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -# Install all Bazel dependencies of the @npm packages -load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") - -install_bazel_dependencies() - -load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace") - -ts_setup_workspace() - # TODO use fine-grained managed dependency yarn_install( name = "daml_extension_deps", diff --git a/azure-cron.yml b/azure-cron.yml index 3b7e2be050..12312f1a59 100644 --- a/azure-cron.yml +++ b/azure-cron.yml @@ -148,7 +148,7 @@ jobs: # This produces out/src/extension.js bazel run @nodejs//:yarn bazel run @nodejs//:yarn compile - bazel run --run_under="cd $PWD && " @daml_extension_deps//vsce/bin:vsce -- publish $GITHUB -p $MARKETPLACE_TOKEN + bazel run --run_under="cd $PWD && " @daml_extension_deps//vsce/bin:vsce -- publish --yarn $GITHUB -p $MARKETPLACE_TOKEN else if [[ "$GITHUB" == "$MARKET" ]]; then echo "Version on marketplace is already the latest ($GITHUB)." diff --git a/build.ps1 b/build.ps1 index 062a4e22e0..6efa12ef82 100644 --- a/build.ps1 +++ b/build.ps1 @@ -48,6 +48,9 @@ function bazel() { # 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 +# Temporary to workaround rules_nodejs update. +bazel clean --expunge +rm -Recurse -Force -ErrorAction Ignore node_modules # Prefetch nodejs_dev_env to avoid permission denied errors on external/nodejs_dev_env/nodejs_dev_env/node.exe # It isn’t clear where exactly those errors are coming from. diff --git a/build.sh b/build.sh index 613ccfe4f4..5ae9fcdd36 100755 --- a/build.sh +++ b/build.sh @@ -27,6 +27,10 @@ if [ -n "$SANDBOX_PID" ]; then kill "$SANDBOX_PID" fi +# Temporary to workaround rules_nodejs update. +bazel clean --expunge +rm -rf node_modules + # Bazel test only builds targets that are dependencies of a test suite so do a full build first. bazel build //... --build_tag_filters "$tag_filter" diff --git a/compatibility/build-release-artifacts-windows.ps1 b/compatibility/build-release-artifacts-windows.ps1 index ed0facae8f..6bc4ce758c 100644 --- a/compatibility/build-release-artifacts-windows.ps1 +++ b/compatibility/build-release-artifacts-windows.ps1 @@ -37,6 +37,9 @@ function bazel() { bazel shutdown +# Temporary to workaround rules_nodejs update. +bazel clean --expunge +rm -Recurse -Force -ErrorAction Ignore node_modules bazel fetch @nodejs_dev_env//... bazel build ` `-`-experimental_execution_log_file ${ARTIFACT_DIRS}/build_execution_windows.log ` diff --git a/compatibility/build-release-artifacts.sh b/compatibility/build-release-artifacts.sh index 32d4ec2a94..e0b0a25847 100755 --- a/compatibility/build-release-artifacts.sh +++ b/compatibility/build-release-artifacts.sh @@ -17,6 +17,9 @@ eval "$(./dev-env/bin/dade-assist)" # before fetching it in another step. HEAD_TARGET_DIR=${1:-compatibility/head_sdk} +# Temporary to workaround rules_nodejs update. +bazel clean --expunge +rm -rf node_modules bazel build \ //release:sdk-release-tarball \ //ledger/ledger-api-test-tool:ledger-api-test-tool_deploy.jar diff --git a/compiler/daml-extension/BUILD.bazel b/compiler/daml-extension/BUILD.bazel index 275f644529..6a2195c97f 100644 --- a/compiler/daml-extension/BUILD.bazel +++ b/compiler/daml-extension/BUILD.bazel @@ -103,7 +103,9 @@ genrule( sed -i 's/"name": "daml"/"name": "daml-bundled"/' package.json $$DIR/$(location //:yarn) $$DIR/$(location //:yarn) compile - $$DIR/$(location @daml_extension_deps//vsce/bin:vsce) package -o $$DIR/$@ + # vsce needs Yarn or NPM in path and for some reason NPM + # fails to find npm-cli.js so we use Yarn. + PATH=$$(dirname $$DIR/$(location //:yarn)):$$PATH $$DIR/$(location @daml_extension_deps//vsce/bin:vsce) package --yarn -o $$DIR/$@ """.format(npm = npm_version), tools = [ "//:yarn", diff --git a/deps.bzl b/deps.bzl index 0b0485962a..3427170ab0 100644 --- a/deps.bzl +++ b/deps.bzl @@ -40,8 +40,8 @@ buildifier_version = "3.3.0" buildifier_sha256 = "f11fc80da0681a6d64632a850346ed2d4e5cbb0908306d9a2a2915f707048a10" zlib_version = "1.2.11" zlib_sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff" -rules_nodejs_version = "1.6.0" -rules_nodejs_sha256 = "f9e7b9f42ae202cc2d2ce6d698ccb49a9f7f7ea572a78fd451696d03ef2ee116" +rules_nodejs_version = "2.0.1" +rules_nodejs_sha256 = "0f2de53628e848c1691e5729b515022f5a77369c76a09fbe55611e12731c90e3" rules_jvm_external_version = "2.8" rules_jvm_external_sha256 = "79c9850690d7614ecdb72d68394f994fef7534b292c4867ce5e7dec0aa7bdfad" rules_go_version = "0.23.6" diff --git a/package.json b/package.json index e0f37b427d..7876524bce 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,7 @@ "url": "^0.11.0" }, "devDependencies": { - "@bazel/bazel": "2.1.0", - "@bazel/hide-bazel-files": "1.6.0", - "@bazel/typescript": "1.6.0" + "@bazel/hide-bazel-files": "1.7.0", + "@bazel/typescript": "2.0.1" } } diff --git a/yarn.lock b/yarn.lock index adbf25d6fb..e561b668cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,46 +2,15 @@ # yarn lockfile v1 -"@bazel/bazel-darwin_x64@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-2.1.0.tgz#c36c37080841618f142996884f07ac0e3d6a9598" - integrity sha512-9waB/6UT6JmQh8qxlRK9IfSY4Ef+4iGwy5eYK2hoc1zXYDnnZoZoC4eXiq68cWTpyCcT7SNGEb9B3wL5Y5rA9A== - -"@bazel/bazel-linux_x64@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-2.1.0.tgz#3185cc3d2533641d6a539bf613247d628425ebf0" - integrity sha512-ag6ZwYMJblf1YuPhNRAMyCYf164mY8jhdIwPSVFI1CMiBRnSDJBkSg7rVIczPh+8Gp7TDqAno9MMTnfUXzxogA== - -"@bazel/bazel-win32_x64@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-2.1.0.tgz#013960fe506ddb8dc08f5d54b52420c818eb4264" - integrity sha512-Y6cs3frmCqoAsrDmEp0msyS8VYE13JvjVoyvdIXTOh5Cc4fOeWzSPb02VS08asaV1jCnOQbv15Ud286hcxAvxg== - -"@bazel/bazel@2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-2.1.0.tgz#25a4d3b4171bfb637374133d29878bbcb36b4c92" - integrity sha512-3Dhs0uJ69ImqC+VIRcifnptPXytxCNWHqyTMFYf0F5AJCVHHW7uRE0tt3Vhm5BseFpdOsjqcghgxGzR/yo10qw== - dependencies: - "@bazel/hide-bazel-files" latest - optionalDependencies: - "@bazel/bazel-darwin_x64" "2.1.0" - "@bazel/bazel-linux_x64" "2.1.0" - "@bazel/bazel-win32_x64" "2.1.0" - -"@bazel/hide-bazel-files@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.6.0.tgz#4dfc610734934f43e1e7c97a26da7b4f2ec8f47f" - integrity sha512-RSu6I5yVVtjDP6PTkhDVvqOC+KJf8t4Uo2qCLxGjunLVt4guqKLt3KQX+dEU/qVn5vECXGTprDSNk+c9G6hDmg== - -"@bazel/hide-bazel-files@latest": +"@bazel/hide-bazel-files@1.7.0": version "1.7.0" resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.7.0.tgz#7cb140c23c4269d6464c24be0a2acf0241d2a31d" integrity sha512-pvdyRX/EsU8n+oElFb+OZ9i5M48HNFR+Z4D3vc0qDGiJ8oly9fZcUb2gbw4CzyeovJz0IzjSxjqMS6cp5gKoeg== -"@bazel/typescript@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-1.6.0.tgz#8dfd29e71bcf917d5f9cb67f19ac4dcfc9082439" - integrity sha512-vAKuwy1Hgl+t3M3sH/G0oqHRYN35TdENj+0lsCI3x7EbSzyI6cbA3YQrLrlyvdScksqOpZa3PZ3UBGqfJJq2DA== +"@bazel/typescript@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-2.0.1.tgz#f99405ce53e2d16a98f9b66da42bff9f5c055c24" + integrity sha512-zoaxp57m8WbBILv8MlNEcRf1xRbtvAyDAy2nekEy2RhvCx96slZ5+JJIQJ7AW6teb37iqvurg1OvNZsO/1bc7Q== dependencies: protobufjs "6.8.8" semver "5.6.0"