Bug 221114 - devel/bazel fix build on i386
Summary: devel/bazel fix build on i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Richard Gallamore
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2017-07-31 08:21 UTC by Klaus Aehlig
Modified: 2017-08-17 21:42 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback+
koobs: merge-quarterly?


Attachments
patch for deve/bazel to fix build on i386 (1.41 KB, patch)
2017-07-31 08:21 UTC, Klaus Aehlig
aehlig: maintainer-approval+
Details | Diff
patch for deve/bazel to fix build on i386 (2.07 KB, patch)
2017-08-08 21:51 UTC, Klaus Aehlig
aehlig: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Aehlig 2017-07-31 08:21:27 UTC
Created attachment 184864 [details]
patch for deve/bazel to fix build on i386

On 32-bit systems, the C-based implementation of singlejar (a tool embedded into bazel) cannot be used, as that implementation assumes (at various places) that it runs on a 64-bit system. Therefore, fall back to the java implementation on those systems.
Comment 1 Klaus Aehlig 2017-07-31 08:24:16 UTC
Example of the log of a failed build: http://beefy10.nyi.freebsd.org/data/110i386-default/446906/logs/bazel-0.5.3.log
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2017-08-01 09:18:37 UTC
Thank you Klaus

Could you please confirm that this change (and thus the port) passes QA (portlint/poudriere)
Comment 3 Klaus Aehlig 2017-08-01 10:42:54 UTC
(In reply to Kubilay Kocak from comment #2)

The port passes portlint (the port is a master port, hence the ?= for MAINTAINER is OK and the only occurrence of a plain "file" is in the error message in the BROKEN statement).

I don't have a 32-bit system at hand, but I can confirm the following.
- The port still build cleanly on am64 and the resulting binary works (not surprising, as nothing changed there).
- It also builds cleanly and works if the EXTRA_PATCH is applied unconditionally.

What the extra patch does, is switching back to the java-implementation of singlejar that was also used in the previous bazel release everywhere (hence also was successfully used on i386). So I'm pretty confident that this solves the issue, but I didn't do a QA run on i386. Hence I would appreciate, if an i386 QA run would be done.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2017-08-01 10:52:42 UTC
Thank you for clarification Klaus.

For what its worth, poudriere does allow testing of i386 (and other arch) on amd64 hosts, and in the long-run is well worth having around and using, particular for confirming correct 'packaging'.
Comment 6 Klaus Aehlig 2017-08-07 08:25:09 UTC
(In reply to Richard Gallamore from comment #5)

Thanks for the report. I'm currently setting up an i386 test environment and will update the patch once I fixed all i386 failures.
Comment 7 Klaus Aehlig 2017-08-08 21:51:19 UTC
Created attachment 185169 [details]
patch for deve/bazel to fix build on i386

Completed the patch, to also fix the incorrect call to nanosleep. With that patch I could successfully build a working bazel on i386 (FreeBSD 11). The nanosleep patch is also upstreamed, see 
https://bazel-review.googlesource.com/c/14991
Comment 8 Richard Gallamore freebsd_committer freebsd_triage 2017-08-09 19:14:45 UTC
(In reply to Klaus Aehlig from comment #7)
Is this this port have slave ports attached to it?
Comment 9 Richard Gallamore freebsd_committer freebsd_triage 2017-08-09 19:19:04 UTC
Never mind, it does.
Comment 10 Jov 2017-08-10 01:47:56 UTC
(In reply to Richard Gallamore from comment #9)
yes, it is devel/bazel-clang38
Comment 11 commit-hook freebsd_committer freebsd_triage 2017-08-10 18:36:41 UTC
A commit references this bug:

Author: ultima
Date: Thu Aug 10 18:35:47 UTC 2017
New revision: 447714
URL: https://svnweb.freebsd.org/changeset/ports/447714

Log:
  * Fix build on i386
  * Cleanup Makefile

  PR:		221114
  Submitted by:	Klaus Aehlig (maintainer)
  Reviewed by:	matthew (mentor)
  Approved by:	matthew (mentor)
  MFH:		2017Q3
  Differential Revision:	https://reviews.freebsd.org/D11937

Changes:
  head/devel/bazel/Makefile
  head/devel/bazel/files/extra-i386_src_BUILD
Comment 12 Richard Gallamore freebsd_committer freebsd_triage 2017-08-11 07:30:31 UTC
Committed, pending MFH authorization.
Comment 13 commit-hook freebsd_committer freebsd_triage 2017-08-17 21:35:10 UTC
A commit references this bug:

Author: ultima
Date: Thu Aug 17 21:34:56 UTC 2017
New revision: 448196
URL: https://svnweb.freebsd.org/changeset/ports/448196

Log:
  MFH: r445987 r446868 r447714

  * Update to 0.5.3
  * Fix build on i386
  * Cleanup Makefile

  PR:		221114
  Submitted by:	Klaus Aehlig (maintainer)
  Reviewed by:	matthew (mentor)
  Approved by:	matthew (mentor)
  Differential Revision:	https://reviews.freebsd.org/D11937

  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2017Q3/
  branches/2017Q3/devel/bazel/Makefile
  branches/2017Q3/devel/bazel/distinfo
  branches/2017Q3/devel/bazel/files/extra-i386_src_BUILD
  branches/2017Q3/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_python__stub__template.txt
  branches/2017Q3/devel/bazel/files/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_python_stub__template.txt
Comment 14 Richard Gallamore freebsd_committer freebsd_triage 2017-08-17 21:42:33 UTC
MFH complete, thanks!