bazelisk | A user-friendly launcher for Bazel

 by   bazelbuild Go Version: v1.17.0 License: Apache-2.0

kandi X-RAY | bazelisk Summary

kandi X-RAY | bazelisk Summary

bazelisk is a Go library. bazelisk has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Bazelisk is a wrapper for Bazel written in Go. It automatically picks a good version of Bazel given your current working directory, downloads it from the official server (if required) and then transparently passes through all command-line arguments to the real Bazel binary. You can call it just like you would call Bazel.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              bazelisk has a medium active ecosystem.
              It has 1486 star(s) with 277 fork(s). There are 33 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 74 open issues and 114 have been closed. On average issues are closed in 78 days. There are 15 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of bazelisk is v1.17.0

            kandi-Quality Quality

              bazelisk has 0 bugs and 0 code smells.

            kandi-Security Security

              bazelisk has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              bazelisk code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              bazelisk is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              bazelisk releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 2160 lines of code, 140 functions and 14 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bazelisk
            Get all kandi verified functions for this library.

            bazelisk Key Features

            No Key Features are available at this moment for bazelisk.

            bazelisk Examples and Code Snippets

            Retrieve bazel version .
            pythondot img1Lines of Code : 29dot img1License : Non-SPDX (Apache License 2.0)
            copy iconCopy
            def retrieve_bazel_version():
              """Retrieve installed bazel version (or bazelisk).
            
              Returns:
                The bazel version detected.
              """
              bazel_executable = which('bazel')
              if bazel_executable is None:
                bazel_executable = which('bazelisk')
                if ba  

            Community Discussions

            QUESTION

            Why can't my programs find resource files when using bazel run //package
            Asked 2022-Apr-11 at 19:07

            I apologise if the title is a bit vague - I didn't know how else to phrase it.

            I am quite new to Bazel but one thing that I don't quite understand is why my program fails to find the resource files I specify using the data attribute for the cc_binary rule

            For context I am trying to follow Lazy Foo's SDL2 tutorials and I have a directory structure somewhat like this

            ...

            ANSWER

            Answered 2022-Apr-11 at 19:07

            Use the C++ runfiles library to find them. Add the dependency in your BUILD file:

            Source https://stackoverflow.com/questions/71826978

            QUESTION

            Install specific version of Bazel with Bazelisk
            Asked 2021-Dec-08 at 08:05

            I am trying to use Bazel to rebuild Tensorflow with compiler flags, but have been getting errors.

            In the documentation explaining how to build Tensorflow from the source, they say that Bazelisk will download the correct version for Tensorflow... but when I was getting the errors, I decided to check the Bazel version and it said 4.2.2 (which is the latest version). The tested builds the Bazel version is only 3.7.2 for 2.7 version of Tensorflow (which is what I am using)...

            Is there a way to use Bazelisk to install version 3.7.2? Or do I have to manually download Bazel and add it to the path?

            • If so, how do I do it? The way I installed it before was just downloading and running the .exe file from the website... and there wasn't any opportunity to enter a version for Bazel...
            • If not, how do I uninstall Bazelisk? I tried looking for a way to uninstall, but couldn't find anything...
            ...

            ANSWER

            Answered 2021-Dec-08 at 08:05

            Bazelisk will look in the WORKSPACE root for a file named .bazelversion (see here). This file is supposed to contain the Bazel version number you want to use.

            There are also other options to tell Bazelisk which version to use: How does Bazelisk know which Bazel version to run?

            To use for instance Bazel 0.26.1 you can Bazelisk this way:

            Source https://stackoverflow.com/questions/70265961

            QUESTION

            How to get all task results in Bazel output
            Asked 2021-Sep-28 at 23:41

            I'm running Bazel (via Bazelisk) in CI and struggling to get reasonable output from builds. I'd like to see the result of all tests and/or targets in the output (even if they were completed by the cache) so developers can be sure the thing they've written is being tested.

            The most obvious thing would be to set the --show_task_finish flag, but unfortunately that flag doesn't seem to work. I haven't found any flag that will reliably print out the results of tests or targets. I unfortunately cannot print stdout/stderr from tests that pass as they generate too much output.

            For example, some slightly redacted output I encountered recently is nearly completely useless if I want to be sure a specific target was tested:

            ...

            ANSWER

            Answered 2021-Sep-28 at 21:46

            It looks like with --test_summary=detailed, Bazel prints information only about failed tests: https://docs.bazel.build/versions/main/command-line-reference.html#flag--test_summary

            Using the default value of short for --test_summary gives all the targets:

            Source https://stackoverflow.com/questions/69368528

            QUESTION

            Building mediapipe fails with both GCC and Clang
            Asked 2021-Sep-21 at 15:57

            I am trying to build Hello World example of Mediapipe in C++. These are my exports in .bash_profile:

            ...

            ANSWER

            Answered 2021-Sep-21 at 15:57

            mediapipe depends on an old version of abseil c++ that does not include a commit necessary to work on newer libstdc++ versions. So, com_google_absl in the mediapipe WORKSPACE needs an update.

            Source https://stackoverflow.com/questions/69266921

            QUESTION

            compiling tensorflow with debug shows an error about non existing bazel-out
            Asked 2021-Sep-20 at 15:08

            I am trying to build the pip package for a certain 2.x version detailed here.

            After running:

            ...

            ANSWER

            Answered 2021-Sep-20 at 15:08

            It could be either because python is not installed, or it is not linked to /usr/bin/python. The latter can be fixed by sudo ln -s /usr/bin/python3 /usr/bin/python.

            Source https://stackoverflow.com/questions/69223760

            QUESTION

            Bazel Remote Cache not working with certificates/TLS
            Asked 2021-Aug-10 at 20:43

            I'm runnig Bazel remote cache from https://github.com/buchgr/bazel-remote inside docker, by runnig the following commands to start the http and grpc server:

            ...

            ANSWER

            Answered 2021-Aug-10 at 20:43

            For grpcs, your problem is the hostname the client is using doesn't match the certificate. When I connect to localhost (like those directions default to), it works:

            Source https://stackoverflow.com/questions/68731040

            QUESTION

            Setting MacOS target version for Bazel build
            Asked 2021-Jul-02 at 15:37

            I'm trying to build the TensorFlow Lite C library on MacOS 11.4. I need the built library to be able to run on MacOS 10.13 or newer. However, something in the build toolchain sets the target OS to 11.3, so that the full compile commands printed by -s look like this

            ...

            ANSWER

            Answered 2021-Jul-02 at 15:37

            The way that works is Bazel command line option --macos_minimum_os (or related --macos_minimum_os).

            It's right there in the documentation if you know what to search for, but apparently not discoverable by Google. I found it by reading Bazel source.

            Source https://stackoverflow.com/questions/68222241

            QUESTION

            How do I select the runtime in bazel for Python and pip?
            Asked 2021-May-15 at 02:49

            I'm trying to build an app on Ubuntu 20.04, where python3 points to Python3.8, and I'm building aganist Python3.6

            I have the following runtime in the same directory of WORKSPACE.

            ...

            ANSWER

            Answered 2021-May-15 at 02:49

            py_runtime usually must be used with py_runtime_pair and toolchain . See the example in the py_runtime_pair documentation. That example, slightly modified to apply to the OP would look like:

            Source https://stackoverflow.com/questions/67512066

            QUESTION

            Build and run Go using cgo using bazel
            Asked 2021-Mar-03 at 00:05

            There is simple cgo project available on this page. It relies on pre-built c shared library and it works great when using go build, with minor changes to make it buildable.

            I wanted to use Bazel for the same thing.

            Used source code is same as on this github link, without using hello.c file. With all said, final code looked like below.

            ...

            ANSWER

            Answered 2021-Mar-03 at 00:05

            are c libraries built automatically? My assumption is that those are not.

            Why? Tests from the offical repo shows, that it is done automatically

            is it possible to use cc_library rule to build shared library that can be used in cgo? if so, how to connect those?

            See example from here

            Source https://stackoverflow.com/questions/66441622

            QUESTION

            Bazel linker not finding function defines
            Asked 2021-Feb-11 at 17:51

            I've been able to make a fair amount of progress in trying to add Bazel build files to enable the building of the gennorm2 tool in ICU. Here is my work-in-progress PR using the Bazel target //icu4c/source/tools/gennorm2.

            I'm currently getting stuck when running bazelisk build //icu4c/source/tools/gennorm2 --verbose_failures --sandbox_debug with these errors.

            They reference functions defined in urename.h. As I understand it, urename.h is also used to rename certain functions by appending a suffix with the version number (_68), but I defined a preprocessor constant U_DISABLE_RENAMING to disable that specific behavior. This only had the effect of changing the names of the undefined function names in the error output, but otherwise not changing it (ex: errors now complain of u_errorName instead of u_errorName_68).

            The part that puzzles me is why the error output claims that these symbols are not found. As you can see, the target //icu4c/source/tools/gennorm2 depends on //icu4c/source/common:platform, which in turn depends on //icu4c/source/common:headers, which includes the field hdrs = glob(["unicode/*.h", "unicode/*.h",]), which should be matching /icu4c/source/common/unicode/urename.h.

            In case it helps, this is the verbose log output when running make VERBOSE=1 using the current autotools-based configure + make build on a fresh checkout of ICU.

            ...

            ANSWER

            Answered 2021-Feb-11 at 17:51

            A teammate was able to take a look and help me reason through the errors and ultimately fix them.

            The first thing is to acknowledge that it is indeed a linker error, which can see by noticing the error message references the linker program ld.

            This is important because we previously spent time in the wrong place by debugging the compile configs as if the problem happened during the compile phase before the linker phase. (But I learned about one way to debug compile problems is taking the raw GCC command given by --verbose_failures --sandbox_debug and replacing -c with -E and changing the argument of -o to a .txt file in /tmp to save the output what the compiler sees for that file after all the includes are recursively inlined). This means that my attempts to solve the problem by specifying preprocessor defines for the compile-phase were misguided.

            The project's documentation on dependencies revealed that I had mis-specified a dependency on one of the targets to specify only the headers (//icu4c/source/common:headers) instead of the relevant definitions and headers (//icu4c/source/common:platform).

            After doing that, we solved another problem that was small and interesting. The gennorm2 target depends on code to get the current year (ex: for printing out help messages that include the copyright statement with the year range). As an i18n library, ICU has code to get that, somewhere in //icu4c/source/i18n:icu4ci18n. This creates an excessive amount of code dependencies for an isolated use case (and will cause problems for follow-on work), so we replaced the block of code in gennorm2 calling those calendar year fns (ucal_open, ucal_getNow, ucal_setMillis, ucal_get, ucal_close) with the libc date library function to give us the year as a number, and added linkopts = ["-ldl"] to link in the dl date library.

            Source https://stackoverflow.com/questions/66111709

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install bazelisk

            On MacOS, you can brew install bazelisk. This adds both bazelisk and bazel to the PATH. Binary and source releases are provided on our Releases page. You can download one of these and add it to your PATH manually. Bazelisk is also published to npm. Frontend developers may want to install it with npm install -g @bazel/bazelisk. You will notice that it serves an analogous function for Bazel as the nvm utility which manages your version of Node.js.
            Install it as the bazel binary in your PATH (e.g. copy it to /usr/local/bin/bazel). Never worry about upgrading Bazel to the latest version again.
            Check it into your repository and recommend users to build your software via ./bazelisk build //my:software. That way, even someone who has never used Bazel or doesn't have it installed can build your software.
            As a company using Bazel or as a project owner, add a .bazelversion file to your repository. This will tell Bazelisk to use the exact version specified in the file when running in your workspace. The fact that it's versioned inside your repository will then allow for atomic upgrades of Bazel including all necessary changes. If you install Bazelisk as bazel on your CI machines, too, you can even test Bazel upgrades via a normal presubmit / pull request. It will also ensure that users will not try to build your project with an incompatible version of Bazel, which is often a cause for frustration and failing builds. (But see the note below about ensuring your developers install Bazelisk.)

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bazelbuild/bazelisk.git

          • CLI

            gh repo clone bazelbuild/bazelisk

          • sshUrl

            git@github.com:bazelbuild/bazelisk.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link