Git Product home page Git Product logo

Comments (10)

fcorange avatar fcorange commented on July 17, 2024 1

(Edit: same setup worked fine on ubuntu. Seems to be a mac env related issue.)

Did a bit digging into this issue.

Environment:
OS: Mac OS Catalina 10.15.5
Bazel version 3.1.0
.bazelrc and WORKSPACE from current README.md @ HEAD (3245b6f)

Error occurred when trying to build bzl (bazel build @dbx_build_tools//build_tools:bzl):

ERROR: While resolving toolchains for target @dbx_build_tools//build_tools/py:check_conflicts: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.

Adding --toolchain_resolution_debug to the build command gives more details:

INFO: ToolchainResolution:     Toolchain constraint @platforms//os:os has value @platforms//os:ios, which does not match value @platforms//os:linux from the target platform @dbx_build_tools//build_tools/cc:linux-x64-drte-off
INFO: ToolchainResolution:   Rejected toolchain @local_config_cc//:cc-compiler-watchos_x86_64, because of target platform mismatch
INFO: ToolchainResolution:   No toolchains found

It seems that the error has something to do with execution platform. I commented out build --host_platform @dbx_build_tools//build_tools/cc:linux-x64-drte-off line in .bazelrc file and this time it gave a different error:

ERROR: .../dbx_build_tools/build_tools/BUILD:68:1: in dbx_py_binary rule @dbx_build_tools//build_tools:bzl:
Traceback (most recent call last):
	File ".../dbx_build_tools/build_tools/BUILD", line 68
		dbx_py_binary(name = 'bzl')
	File ".../dbx_build_tools/build_tools/py/py.bzl", line 610, in _dbx_py_binary_impl
		dbx_py_binary_base_impl(ctx, <1 more arguments>)
	File ".../dbx_build_tools/build_tools/py/py.bzl", line 659, in dbx_py_binary_base_impl
		emit_py_binary(ctx, main = main, <10 more arguments>)
	File ".../dbx_build_tools/build_tools/py/common.bzl", line 416, in emit_py_binary
		conflict_args.add_all(<2 more arguments>)
map_each must be a function that accepts a single positional argument

from dbx_build_tools.

armooo avatar armooo commented on July 17, 2024

I think part of the problem could be the README.md pinning a version from Dec 11 but was updated to use python38. What version of dbx_build_tools and bazel are you using?

from dbx_build_tools.

fcorange avatar fcorange commented on July 17, 2024

I was following the README here https://github.com/dropbox/dbx_build_tools/blob/master/README.md

I tried both latest Bazel (3.5.1) and 1.1.0, both returned similar errors.

from dbx_build_tools.

armooo avatar armooo commented on July 17, 2024

Can you give this WORKSPACE a try? If it works I will make sure to update the README.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "dbx_build_tools",
    urls = ["https://github.com/dropbox/dbx_build_tools/archive/master.tar.gz"],
    strip_prefix = "dbx_build_tools-master",
)

load('@dbx_build_tools//build_tools/bazel:external_workspace.bzl', 'drte_deps')

drte_deps()

register_toolchains(
    "@dbx_build_tools//thirdparty/cpython:drte-off-27-toolchain",
    "@dbx_build_tools//thirdparty/cpython:drte-off-38-toolchain",
)

from dbx_build_tools.

fcorange avatar fcorange commented on July 17, 2024

No luck :( still hitting the first error I mentioned above. Tried on both Bazel 1.1.0 and 3.5.1. Guess I'll just input my issue to bazelbuild/bazel#10134. Thanks for looking though!

from dbx_build_tools.

benjaminp avatar benjaminp commented on July 17, 2024

I think we would have to know all the Bazel options in play to debug this.

from dbx_build_tools.

fcorange avatar fcorange commented on July 17, 2024

I switched to a different environment (with Bazel 1.1.0) and with @armooo 's suggested WORKSPACE it now emits a different error:

ERROR: .../dbx_build_tools/build_tools/bzl_lib/itest/BUILD:27:1: in dbx_sh_binary rule @dbx_build_tools//build_tools/bzl_lib/itest:bzl-itest-init:
Traceback (most recent call last):
	File ".../dbx_build_tools/build_tools/bzl_lib/itest/BUILD", line 27
		dbx_sh_binary(name = 'bzl-itest-init')
	File ".../dbx_build_tools/build_tools/sh/sh.bzl", line 9, in dbx_sh_binary_impl
		write_runfiles_tmpl(ctx, <2 more arguments>)
	File ".../dbx_build_tools/build_tools/bazel/runfiles.bzl", line 50, in write_runfiles_tmpl
		is_windows(ctx)
	File ".../dbx_build_tools/build_tools/windows/windows.bzl", line 2, in is_windows
		ctx.target_platform_has_constraint(<1 more arguments>)
	File ".../dbx_build_tools/build_tools/windows/windows.bzl", line 2, in ctx.target_platform_has_constraint
		platform_common.ConstraintValueInfo
object of type 'platform_common' has no field 'ConstraintValueInfo'
ERROR: Analysis of target '@dbx_build_tools//build_tools:bzl' failed; build aborted: Analysis of target '@dbx_build_tools//build_tools/bzl_lib/itest:bzl-itest-init' failed; build aborted

For last week's experiment I was basically trying with a fresh Bazel (3.5.1) installation from brew. Not sure what other Bazel options you might need to debug this issue.

from dbx_build_tools.

benjaminp avatar benjaminp commented on July 17, 2024

1.1.0 is really old and definitely will not work.

from dbx_build_tools.

benjaminp avatar benjaminp commented on July 17, 2024

I should have mentioned earlier that various things like our CPython are Linux-specific today. So, even if this immediate toolchain problem is overcome, there will be more failures.

from dbx_build_tools.

fcorange avatar fcorange commented on July 17, 2024

Thanks, yes I've since switched to a Ubuntu image running in a containerized env and it works fine now.

I did run into an issue though with latest master head, I've attached details in #11.

from dbx_build_tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.