bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23k stars 4.03k forks source link

Provide an rpm package for CentOS/RHEL/Fedora #2701

Closed Rikorose closed 6 years ago

Rikorose commented 7 years ago

Ideally the installation process would be

sudo dnf install bazel

or

sudo yum install bazel

Alternatively an standalone rpm package or an external repository for Fedora would be great.

damienmg commented 7 years ago

FTR the package already exist we need to build it as part of our release pipeline now.

katre commented 7 years ago

There's three phases to this:

1) Build an RPM of Bazel - this is done (bazel build //scripts/packages/fedora:bazel) 2) Release the RPM with Bazel releases 3) Get Bazel into Fedora/RH/CentOS's package repository - haven't even started, we'll need to learn more about what they require from packages, but I suspect the current binary (which has a number of tools packed into it) will be a problem.

rhofour commented 7 years ago

Is there anything blocking 2? As a Fedora user that alone would make my life a bit easier.

damienmg commented 7 years ago

No we need to add fedora worker to our CI but nobody got around to do it yet

sjenning commented 7 years ago

I've created a RPM for Fedora and opened a package review

https://bugzilla.redhat.com/show_bug.cgi?id=1470842

katre commented 7 years ago

Thanks! Hopefully we can get a RPM-based worker in our jenkins setup shortly for veirifcation.

katre commented 7 years ago

You may want to copy the install locations for bazel.bazelrc and the bash completion script, from https://github.com/bazelbuild/bazel/blob/5d453d93499e328d4c0ea9b8f0c6ff4bbba08b54/scripts/packages/fedora/bazel.spec

Also, I think releases.bazel.build will have faster downloads than github, but I'm not sure what the URL syntax is. @damienmg ?

damienmg commented 7 years ago

https://releases.bazel.build//release/index.html is the index, e.g.: https://releases.bazel.build/0.5.2/release

On Thu, Jul 13, 2017 at 9:55 PM katre notifications@github.com wrote:

You may want to copy the install locations for bazel.bazelrc and the bash completion script, from https://github.com/bazelbuild/bazel/blob/5d453d93499e328d4c0ea9b8f0c6ff4bbba08b54/scripts/packages/fedora/bazel.spec

Also, I think releases.bazel.build will have faster downloads than github, but I'm not sure what the URL syntax is. @damienmg https://github.com/damienmg ?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/bazelbuild/bazel/issues/2701#issuecomment-315184886, or mute the thread https://github.com/notifications/unsubscribe-auth/ADjHf7V6F4q7d0h7FIsR6iNRD529OQpzks5sNnYzgaJpZM4MhXqf .

sjenning commented 7 years ago

@katre ah, didn't know about the in-tree spec file. Thanks for the heads-up :+1: I'll update my spec file.

katre commented 7 years ago

@sjenning I added it to make a development package, but yours looks good for a releasable version. Thanks for working on it!

sjenning commented 7 years ago

@katre what is bazel-real?

katre commented 7 years ago
$ file /usr/bin/bazel /usr/bin/bazel-real
/usr/bin/bazel:      Bourne-Again shell script, ASCII text executable
/usr/bin/bazel-real: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2

The distributed bazel file is actually a shell script that checks whether there is a binary at tools/bazel, based on the current WORKSPACE. If that's not found, it executes bazel-real, which is the actual compiled binary.

sdake commented 7 years ago

@sjenning I am a provenpackager in Fedora. Bundled dependencies are not permitted in Fedora/CentOS repositories and the lag time to unbundle the dependencies will be pretty high. In the meantime, I've created a COPR and am shortly submitting a pull request to document using it for Bazel as well as a separate set of instructions for building from source.

I'm in need of this as a result of https://github.com/istio/issues/issues/56

sjenning commented 7 years ago

@sdake that sounds like the only way forward at the moment, sadly. I know @vbatts already has a COPR repo for bazel that includes EPEL https://copr.fedorainfracloud.org/coprs/vbatts/bazel/

sdake commented 7 years ago

@sjenning I did notice after I submitted https://github.com/bazelbuild/bazel/pull/3779 with a COPR build + documentation I did about a week ago, I was duplicating @vbatts work in https://github.com/bazelbuild/bazel/pull/3721, so I've asked @vbatts to include 0.5.3-1 for EPEL which at present is the recommended version of bazel for istio. Version 0.5.3 is currently absent from @vbatt's COPR for EPEL.

I would encourage you to continue work on unbundling the dependencies for Fedora/EPEL so these can go into the main distribution of EPEL. I'll be happy to provide reviews of the unbundled packages if you need. I just noticed the reviewer who took on your initial review was not satisfied with the bundled dependencies.

vbatts commented 7 years ago

@sdake https://copr.fedorainfracloud.org/coprs/vbatts/bazel/build/606023/ if you'll double check it.

sdake commented 7 years ago

@vbatts

[sdake@falkor-04 ~]$ sudo curl -o /etc/yum.repos.d/bazel.repo https://copr.fedorainfracloud.org/coprs/vbatts/bazel/repo/epel-7/vbatts-bazel-epel-7.repo
(correct output)
[sdake@falkor-04 ~]$ sudo yum install bazel-0.5.3
(correct output)
[sdake@falkor-04 istio.io]$ rpm -ql bazel
/usr/bin/bazel
/usr/share/bash-completion/completions/bazel
[sdake@falkor-04 istio.io]$ bazel help startup_options
Extracting Bazel installation...
 [bazel release 0.5.3- (@non-git)]
[sdake@falkor-04 mixer]$ make
INFO: Elapsed time: 166.209s, Critical Path: 59.34s
[sdake@falkor-04 mixer]$ cd ../pilot
[sdake@falkor-04 pilot]$ make
+ go install ./...
[sdake@falkor-04 pilot]$ 

LGTM

@vbatts - may I suggest adding a license file to the COPR rpm? Although not strictly required from a COPR POV, it is helpful to understand what licenses are used in installed packages.

TIA! -steve

excavador commented 6 years ago

I need it!

vbatts commented 6 years ago

It exists!

On Tue, Nov 7, 2017, 14:01 Oleg Tsarev notifications@github.com wrote:

I need it!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bazelbuild/bazel/issues/2701#issuecomment-342574889, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEF6ZLbzZlcGjxbwSvrTwf2-XEYEq8Tks5s0J_mgaJpZM4MhXqf .

excavador commented 6 years ago

Thank you! Yes, found description https://docs.bazel.build/versions/master/install-redhat.html Why this ticket still open?

vbatts commented 6 years ago

good question. I don't have perms to close it.