Skip to content

Allow installing older Bazel versions from the custom Bazel APT repository #128

Closed

Description

@mishas

When using the Bazel custom APT repository (recommended) method for installing Bazel on Debian/Ubuntu, it's only possible to install the latest version:

> apt-get install bazel=0.5.3
[...]
E: Version '0.5.3' for 'bazel' was not found
> apt-get install bazel=0.5.4
[...]
The following additional packages will be installed:
[...]

Looking at the Packages file (http://storage.googleapis.com/bazel-apt/dists/stable/jdk1.8/binary-amd64/Packages), it indeed only contains one package with Version 0.5.4.

Since there're many breaking changes (most of them are welcome :) ) in every new version, we must have a way to install a specific, older, version.

Note: This ticket is a copy of the bazelbuild/bazel#3813 ticket, as per @katre's request.

Activity

  1. removed their assignment
    on Sep 27, 2017
  2. AnomalRoil commented on Jan 3, 2018

    @AnomalRoil

    This would really be a good thing. Any update regarding the current status of this issue?

  3. galv commented on Jan 6, 2018

    @galv

    Agree that this would be very useful. One normally considers "stable" to mean that new releases will have only bug fixes and backwards compatible changes. Right now, bazel's "stable" releases don't meet that definition of stable.

  4. added a commit that references this issue on Jan 8, 2018
  5. drigz commented on Jan 9, 2018

    @drigz
    Contributor

    A workaround is to manually install the dependencies and then install the .deb from GitHub:

    apt-get install -y --no-install-recommends \
       bash-completion \
       g++ \
       zlib1g-dev \
     && curl -LO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel_${BAZEL_VERSION}-linux-x86_64.deb" \
     && dpkg -i bazel_*.deb
    
  6. philwo commented on Jan 12, 2018

    @philwo
    Member

    I agree that this sounds like a useful thing to have. I’ll see that we get this done.

  7. zhanwenchen commented on Apr 15, 2018

    @zhanwenchen

    Any update? I confirm that 0.12.0 breaks the tensorflow source installation but 0.11.1 doesn't, as the tensorflow thread documents.

  8. georgewfraser commented on Aug 13, 2018

    @georgewfraser

    The bazel upgrade 4 hours ago just broke our build. If we could pin a specific version we could work around this, now we're scrambling.

  9. philwo commented on Sep 10, 2018

    @philwo
    Member

    We'll make individual versions available on the repository and also our Homebrew tap in the future, but we aren't there yet - sorry!

  10. figroc commented on Nov 22, 2018

    @figroc

    your new releases break tensorflow building constantly

  11. terradolor commented on Feb 27, 2019

    @terradolor

    Few days after releasing tensorflow 1.13 there is a new bazel 0.23 which breaks the compilation.
    So no tensorflow release (and probably not event master) could be compiled with bazel from apt repository, since it contains only 0.23.

  12. jin commented on Feb 27, 2019

    @jin
    Member

    Can we work with Tensorflow to integrate https://github.com/philwo/bazelisk and have a .bazelversion in their repository? @philwo @laurentlb @fweikert

  13. terradolor commented on Feb 28, 2019

    @terradolor

    I tried to find .deb for older releases ...
    I have Ubuntu 16.04 so my start point is apt source deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8

    It leads to following links:

    http://storage.googleapis.com/bazel-apt
    http://storage.googleapis.com/bazel-apt/dists/stable/Release
    http://storage.googleapis.com/bazel-apt/dists/stable/Release.gpg
    http://storage.googleapis.com/bazel-apt/dists/stable/jdk1.8/binary-amd64/Packages
    http://storage.googleapis.com/bazel-apt/dists/stable/jdk1.8/binary-amd64/Packages.gz
    http://storage.googleapis.com/bazel-apt/dists/stable/jdk1.8/binary-amd64/Release
    http://storage.googleapis.com/bazel-apt/pool/jdk1.8/b/bazel/bazel_0.23.0_amd64.deb
    

    There are also files

    http://storage.googleapis.com/bazel-apt/pool/jdk1.8/b/bazel/bazel_0.22.0_amd64.deb
    http://storage.googleapis.com/bazel-apt/pool/jdk1.8/b/bazel/bazel_0.21.0_amd64.deb
    

    So all older releases could be downloaded without any issue.

    Problem is that it is not possible to verify files by gpg signature to confirm they are from legitimate source. Packages file only contains the latest bazel build, so:

    • apt isn't able to offer older package versions
    • we are not able to manually download older .deb, verify signature and hashes, install it using dpkg

    (Then apt-mark hold bazel would stay on working version as a "hotfix" of permanently broken builds. Although I personally don't like it, I have to choose the lesser evil, because I really need to compile things.)

    IMO regenerating Packages file to contain hashes for all .deb would fix this issue. Feasible?

  14. fweikert commented on Feb 28, 2019

    @fweikert
    Member
    1. If Bazel releases still break TF constantly, maybe we should increase the test coverage on our CI?
    2. We're using https://github.com/philwo/bazelisk on Bazel CI to run arbitrary versions of Bazel. As Jin already pointed out you can simply specify the desired version in a central file (or via env variables). Would this help?
  15. terradolor commented on Mar 1, 2019

    @terradolor

    Short version ...

    Maybe.
    But I think that this ticket is about availability of older versions from apt repository.
    So if older versions are provided through "binary installer" method, then why not to provide the same through "custom APT repository"?


    TL;DR version ...
    (Please take into account that my comments are based just on few months of compiling TF as a user, I'm neither TF developer nor experienced bazel user.)

    1. If Bazel releases still break TF constantly, maybe we should increase the test coverage on our CI?

    It you have the capacity to do it then why not. It might help to identify issues and help to move from deprecated to current stable bazel features.

    On the other hand, my uneducated opinion ...
    If there is a frequent need to use exact bazel versions (resp. tools like bazelisk) then there is a insufficient level of backward compatibility.
    Even if you one day push some version to upstream debian/ubuntu then it will be rarely usable because this single version won't be compatible with projects one needs to compile.
    So instead of going around it it might be more beneficial for the users to provide stronger and longer backward compatibility guarantee. And also increase the convenience of installation (apt, apt in upstream).

  16. meteorcloudy commented on Dec 21, 2022

    @meteorcloudy
    Member

    Please consider using Bazelisk as it's the recommended tool if you want to switch between Bazel versions conveniently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions