Skip to content
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

build: update to bazel 0.27.0rc5 #861

Closed

Conversation

gregmagolan
Copy link
Collaborator

@gregmagolan gregmagolan commented Jun 13, 2019

Testing against Bazel 0.27.0rc5 as I saw an unexpected error locally:

Building package typescript //:npm_package
checking deps: jasmine
all deps built
+ bazel build --workspace_status_command=../../scripts/current_version.sh //:npm_package
Starting local Bazel server and connecting to it...
DEBUG: Rule 'build_bazel_rules_typescript' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1559861420 -0700"
DEBUG: Call stack for the definition of repository 'build_bazel_rules_typescript' which is a git_repository (rule definition at /private/var/tmp/_bazel_greg/b90b17756fe48c3e5b8d42d3ed61ee61/external/bazel_tools/tools/build_defs/repo/git.bzl:252:18):
 - /Users/greg/google/gregmagolan/rules_nodejs/packages/typescript/WORKSPACE:44:1
INFO: SHA256 (https://github.com/manekinekko/rules_sass/archive/9862dfc96a4a1f66fe171ef5e043b29853e8445b.zip) = 6035f25dbcd1e5575a681f5d7b9d9821dde09fcf73ccea053d1bc1c9523b1a2a
DEBUG: Rule 'io_bazel_rules_sass' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "6035f25dbcd1e5575a681f5d7b9d9821dde09fcf73ccea053d1bc1c9523b1a2a"
DEBUG: Call stack for the definition of repository 'io_bazel_rules_sass' which is a http_archive (rule definition at /private/var/tmp/_bazel_greg/b90b17756fe48c3e5b8d42d3ed61ee61/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
 - /private/var/tmp/_bazel_greg/b90b17756fe48c3e5b8d42d3ed61ee61/external/build_bazel_rules_nodejs/package.bzl:40:5
 - /Users/greg/google/gregmagolan/rules_nodejs/packages/typescript/WORKSPACE:31:1
ERROR: /Users/greg/google/gregmagolan/rules_nodejs/packages/typescript/BUILD.bazel:71:20: **kwargs arguments are not allowed in BUILD files. Pass the arguments in explicitly.
ERROR: error loading package '': Package '' contains errors
INFO: Elapsed time: 17.784s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)

@gregmagolan
Copy link
Collaborator Author

gregmagolan commented Jun 13, 2019

replacements = dict(
        COMMON_REPLACEMENTS,
        **{
            # This BEGIN-DEV fencing is required as files pulled in from
            # @build_bazel_rules_typescript//:npm_bazel_typescript_package
            # use this alternate fencing
            "(#|\/\/)\\s+BEGIN-DEV-ONLY[\\w\W]+?(#|\/\/)\\s+END-DEV-ONLY": "",
            # Do a simple replacement needed to make the local development differ
            # from how our release is used.
            "//devserver:devserver_bin": "//devserver",
            # This file gets vendored into our repo
            "@build_bazel_rules_typescript//internal:common": "//internal:common",
        }
    ),

Creates error with Bazel 0.27.0rc5: ERROR: /Users/greg/google/gregmagolan/rules_nodejs/packages/typescript/BUILD.bazel:71:20: **kwargs arguments are not allowed in BUILD files. Pass the arguments in explicitly.

That dict() definition needs to be moved to /packages/typescript/index.bzl.

@gregmagolan
Copy link
Collaborator Author

gregmagolan commented Jun 13, 2019

In CI seeing this:

Bazel version:
bazel: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by bazel)
Exited with code 1

so looks like we'll need to update to a newer dockerized linux

UPDATE: circleci/node-10.14 images have the required lib

@Toxicable
Copy link

Just tried 0.27.0rc5 on our repo and saw this one

Traceback (most recent call last):
        File "/home/f.wiles/workspace/libs/forms/BUILD.bazel", line 13
                ng_module(name = 'forms')
        File "/home/f.wiles/.cache/bazel/_bazel_f.wiles/4e95cbad76bfb4ed000904165db39268/external/npm_angular_bazel/src/ng_module.bzl", line 602, in _ng_module_impl
                ts_providers_dict_to_struct(ng_module_impl(ctx, compile_ts))
        File "/home/f.wiles/.cache/bazel/_bazel_f.wiles/4e95cbad76bfb4ed000904165db39268/external/npm_angular_bazel/src/ng_module.bzl", line 602, in ts_providers_dict_to_struct
                ng_module_impl(ctx, compile_ts)
        File "/home/f.wiles/.cache/bazel/_bazel_f.wiles/4e95cbad76bfb4ed000904165db39268/external/npm_angular_bazel/src/ng_module.bzl", line 560, in ng_module_impl
                ts_compile_actions(ctx, is_library = True, deps = [d fo...))], <4 more arguments>)
        File "/home/f.wiles/.cache/bazel/_bazel_f.wiles/4e95cbad76bfb4ed000904165db39268/external/npm_bazel_typescript/internal/common/compilation.bzl", line 261, in ts_compile_actions
                outputs(ctx, ctx.label, srcs_files)
        File "/home/f.wiles/.cache/bazel/_bazel_f.wiles/4e95cbad76bfb4ed000904165db39268/external/npm_angular_bazel/src/ng_module.bzl", line 541, in outputs
                _expected_outs(ctx)
        File "/home/f.wiles/.cache/bazel/_bazel_f.wiles/4e95cbad76bfb4ed000904165db39268/external/npm_angular_bazel/src/ng_module.bzl", line 272, in _expected_outs
                ctx.new_file(ctx.genfiles_dir, (ctx.label.name ..."))
Use ctx.actions.declare_file instead of ctx.new_file. 
Use --incompatible_new_actions_api=false to temporarily disable this check.

@gregmagolan
Copy link
Collaborator Author

Thanks @Toxicable. Put up angular/angular#31019 to fix that.

Bazel 0.27.0 no longer allows **kwargs in BUILD files. Moved dict() definition using dict(a, **{...}) syntax in packages/typescript/BUILD.bazel to packages/typescript/index.bzl
The --noincompatible_require_ctx_in_configure_features flag is required for Bazel 0.27.0 as dev dependency io_bazel_rule_go is not yet compatible with 0.27.0
@gregmagolan
Copy link
Collaborator Author

gregmagolan commented Jun 13, 2019

Hmmmm. Now seeing

ERROR: /home/circleci/rules_nodejs/e2e/karma_typescript/BUILD.bazel:37:1: Compiling TypeScript (devmode) //:hello_world failed (Exit 1)
error TS2688: Cannot find type definition file for 'jasmine'.
error TS2688: Cannot find type definition file for 'long'.
error TS2688: Cannot find type definition file for 'node'.

on a number of e2e tests and one example. 🤔

UPDATE: This is a new failure introduced somewhere between 0.26.1 and 0.27.0rc5. Has something changed in runfiles that is now allowing typescript to see all the node_modules/@types folders but not be able to resolve them?

UPDATE 2: Tested with symlink_node_modules false in an e2e test and with no managed_directories and same failure with 0.27.0rc5 so not likely a change in that feature causing this

@gregmagolan gregmagolan mentioned this pull request Jun 14, 2019
12 tasks
@gregmagolan
Copy link
Collaborator Author

Replaced by #864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants