-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bazel 1.1 #3249
Bazel 1.1 #3249
Conversation
61217f0
to
7a37811
Compare
e56d098
to
c7d64cb
Compare
Fixes ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/daml-lf/archive/BUILD.bazel:150:1: in deps attribute of scala_test rule //daml-lf/archive:daml_lf_archive_reader_tests_test_suite_src_test_scala_com_digitalasset_daml_lf_archive_DecodeV1Spec.scala: '//daml-lf/archive:daml_lf_1.6_archive_proto_srcs' does not have mandatory providers: 'JavaInfo'. Since this rule was created by the macro 'da_scala_test_suite', the error might have been caused by the macro implementation ```
Bazel 1.1.0 fails on missing hashes.
Modifying sources in-place can cause issues on Windows, where build actions are not sandboxed and changes on sources can affect other build steps.
The bazel-genfiles symlink has been removed since Bazel 1.0. See bazelbuild/bazel#8651
b8e89f2
to
cbc54a3
Compare
77ebdfc
to
c1e1d1b
Compare
There are some issues with
or
However, these are unrelated to this PR and for now worked around with c1e1d1b. |
@@ -20,3 +20,4 @@ index 0349e31bb3..d2e7408dbf 100644 | |||
+#define _WIN32_WINNT 0x0A00 | |||
|
|||
#include <windows.h> | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel now uses an internal implementation instead of shelling out to patch
. This internal implementation is a bit less lenient than patch
and complains about this missing newline.
|
||
# Separate package and target (if present). | ||
- package_target = pattern_str[2:].split(":", maxsplit = 2) | ||
+ package_target = pattern_str[2:].split(":", 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update rules_haskell in a separate PR, at which point this patch will be unnecessary..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you so much for doing this!
@@ -67,6 +67,10 @@ build:darwin --host_platform=@rules_haskell//haskell/platforms:darwin_x86_64_nix | |||
# and GHC's gcc on Windows | |||
build:windows --crosstool_top=@rules_haskell_ghc_windows_amd64//:cc_toolchain | |||
|
|||
# Bazel 1.0 disabled the bash test-runner on Windows. However, some of our | |||
# test-cases are implemented as bash scripts and rely on the bash test-runner. | |||
build:windows --noincompatible_windows_native_test_wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR but could we work around this by having some wrapper binary that then calls bash internally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to address this is turn things like client_server_test
into a macro that generates a script file and then calls sh_test|binary
on that. Another is to use cc_toolchain.link|compile
to generate a binary that calls the shell script. I think the former is the better approach. I've experimented with both and the latter caused some issues with the test-environment not matching what the test-cases expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks for the explanation!
* bazel: 0.28.1 --> 1.1.0 * bazel-watcher sha256 * Fix missing line in patch * proto_source_root --> strip_import_prefix See bazelbuild/bazel#7153 for details. * Update rules_nixpkgs Required to avoid errors of the form ``` ERROR: An error occurred during the fetch of repository 'node_nix': parameter 'sep' may not be specified by name, for call to method split(sep, maxsplit = None) of 'string' ``` and ``` ERROR: An error occurred during the fetch of repository 'node_nix': Traceback (most recent call last): File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149 _execute_or_fail(repository_ctx, <3 more arguments>) File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail fail(<1 more arguments>) Cannot build Nix attribute 'nodejs'. Command: [/Users/runner/.nix-profile/bin/nix-build, /private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/node_nix/nix/bazel.nix, "-A", "nodejs", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/nixpkgs/nixpkgs"] Return code: 1 Error output: src/main/tools/process-tools.cc:173: "setitimer": Invalid argument ``` * Update rules_scala * .proto has been removed, use [ProtoInfo] instead See https://docs.bazel.build/versions/1.1.0/be/protocol-buffer.html#proto_library * python3_nix add nix_file attribute To avoid the following error ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/BUILD:66:1: //:nix_python3_runtime depends on @python3_nix//:bin/python in repository @python3_nix which failed to fetch. no such package '@python3_nix//': Traceback (most recent call last): File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149 _execute_or_fail(repository_ctx, <3 more arguments>) File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail fail(<1 more arguments>) Cannot build Nix attribute 'python3'. Command: [/home/aj/.nix-profile/bin/nix-build, "-E", "import <nixpkgs> { config = {}; overlays = []; }", "-A", "python3", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs"] Return code: 1 Error output: error: anonymous function at /home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs.nix:3:1 called with unexpected argument 'config', at (string):1:1 ``` * rules_haskell unnamed string.split(_, maxsplit = _) The keyword argument may no longer be named. * string.replace(_, _, maxsplit = _) may not be named * Move proto sources from deps to data Fixes ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/daml-lf/archive/BUILD.bazel:150:1: in deps attribute of scala_test rule //daml-lf/archive:daml_lf_archive_reader_tests_test_suite_src_test_scala_com_digitalasset_daml_lf_archive_DecodeV1Spec.scala: '//daml-lf/archive:daml_lf_1.6_archive_proto_srcs' does not have mandatory providers: 'JavaInfo'. Since this rule was created by the macro 'da_scala_test_suite', the error might have been caused by the macro implementation ``` * Define sha256 for haskell_ghc__paths Bazel 1.1.0 fails on missing hashes. * Disable --incompatible_windows_native_test_wrapper * //compiler/daml-extension don't modify sources Modifying sources in-place can cause issues on Windows, where build actions are not sandboxed and changes on sources can affect other build steps. * bazel-genfiles --> bazel-bin The bazel-genfiles symlink has been removed since Bazel 1.0. See bazelbuild/bazel#8651 * Mark dev_env_tool repository rule as configure See https://docs.bazel.build/versions/1.1.0/skylark/lib/globals.html#repository_rule * Move data deps into data attribute * Mark dev_env_tool as local = True * Manually fetch @makensis_dev_env
Update to the latest Bazel version 1.1.0
rules_scala
andrules_nixpkgs
are updated for compatibility.rules_haskell
is patched for compatibility. It will be updated in a separate PR.kwargs
).CreateProcessW
. Unfortunately, various tests, includingclient_server_test
, are implemented as bash scripts which cannot be executed withCreateProcessW
. Therefore, we disable this new default and use the bash test wrapper. See--incompatible_windows_native_test_wrapper
.cc_wrapper
not working in Cabal packages on Windows forrules_haskell
.deps
attribute.This is no longer legal in Bazel 1.1, instead these need to go into the
data
attribute.Pull Request Checklist
NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.