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

Bazel bash completion script requires git repo to build on macOS via MacPorts #4671

Closed
missa-prime opened this issue Feb 21, 2018 · 1 comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug

Comments

@missa-prime
Copy link

Description of the problem / feature request:

After version 0.5.2, a git repo is required to build the Bazel bash completion script on macOS when attempting to install Bazel via MacPorts. The Portfile contains workaround code that deletes a temporary folder and creates a dummy repo to prevent the installation from failing. I'm not sure why all of this is necessary in the first place though.

Feature requests: what underlying problem are you trying to solve with this feature?

N/A

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Make sure JDK 8 or newer is installed
  2. Ensure that /etc/gitconfig file exists and user.name and user.email fields are populated
  3. Install MacPorts from here
  4. Remove the code below from /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/bazel/Portfile:
# Get ready to build the bash completion script
file delete -force /var/tmp/_${name}_root

# build fails if it does not recognize this dir as a git repo
system -W ${worksrcpath} "git init"
system -W ${worksrcpath} "git add ."
system -W ${worksrcpath} "git commit -m GitRepo"
  1. sudo port install bazel at a terminal prompt to install bazel

What operating system are you running Bazel on?

macOS 10.12.6

What's the output of bazel info release?

ERROR: The 'info' command is only supported from within a workspace.

Since I don't have a workspace handy, I'll provide the output of bazel version:

Build label: 0.9.0- (@non-git)
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Aug 1 19:08:22 +50104 (1518980756902)
Build timestamp: 1518980756902
Build timestamp as int: 1518980756902

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

Bazel was built from source while being installed with MacPorts.

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

N/A

Have you found anything relevant by searching the web?

No.

Any other information, logs, or outputs that you want to share?

Here is the type of error output you should see (assuming stdout and stderr are directed to a file) without the git repo:

Build successful! Binary is here: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bazel/bazel/work/bazel-0.9.0-dist/output/bazel
xinstall: chdir(/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bazel/bazel/work/bazel-0.9.0-dist/output)
xinstall: bazel -> /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bazel/bazel/work/bazel-0.9.0-dist/bazel
Extracting Bazel installation...
.....................
Loading: 
Loading: 0 packages loaded
Analyzing: target //scripts:bazel-complete.bash (3 packages loaded)
Analyzing: target //scripts:bazel-complete.bash (4 packages loaded)
Analyzing: target //scripts:bazel-complete.bash (73 packages loaded)
Analyzing: target //scripts:bazel-complete.bash (75 packages loaded)
Analyzing: target //scripts:bazel-complete.bash (195 packages loaded)
INFO: Analysed target //scripts:bazel-complete.bash (195 packages loaded).
INFO: Found 1 target...
[0 / 2] [-----] BazelWorkspaceStatusAction stable-status.txt
ERROR: Process exited with status 128: Process exited with status 128
fatal: Not a git repository (or any of the parent directories): .git
Target //scripts:bazel-complete.bash failed to build
INFO: Elapsed time: 25.182s, Critical Path: 0.14s
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
Error: Failed to build bazel: child process exited abnormally
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bazel/bazel/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port bazel failed
@missa-prime missa-prime changed the title Bazel bash completion script requires git repo to build on MacOS via MacPorts Bazel bash completion script requires git repo to build on macOS via MacPorts Feb 21, 2018
@aehlig aehlig added type: bug P3 We're not considering working on this, but happy to review a PR. (No assignee) category: misc > release / binary labels Feb 26, 2018
@aiuto aiuto added the team-Bazel General Bazel product/strategy issues label Dec 10, 2018
@dslomov dslomov added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website and removed category: misc > release / binary team-Bazel General Bazel product/strategy issues labels Jul 23, 2019
@jin
Copy link
Member

jin commented Apr 17, 2020

According to the printed error (Error: Follow https://guide.macports.org/#project.tickets to report a bug.), please file a bug with MacPorts instead.

@jin jin closed this as completed Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
Development

No branches or pull requests

5 participants