Bug 220475

Summary: [NEW PORT] devel/bear: Tool that generates a compilation database for clang tooling
Product: Ports & Packages Reporter: Jov <amutu>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Only Me CC: pi
Priority: --- Keywords: feature
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
bear.shar
none
bear.shar
none
bear.shar none

Description Jov 2017-07-05 09:54:53 UTC
Created attachment 184067 [details]
bear.shar

Bear is a tool that generates a compilation database for clang tooling. The
JSON compilation database is used in the clang project to provide information
on how a single compilation unit is processed. With this, it is easy to re-run
the compilation with alternate programs. One way to get a compilation database
is to use cmake as the build tool. Passing -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
to cmake generates the compile_commands.json file into the current directory.
For non-cmake projects, Bear generates the JSON file during the build process.
The concept behind Bear is: to execute the original build command and intercept
the exec calls issued by the build tool. To achieve that, Bear uses the
LD_PRELOAD or DYLD_INSERT_LIBRARIES mechanisms provided by the dynamic linker.

WWW: https://github.com/rizsotto/Bear

QA:
portlint -AC
looks fine.

poudriere testport passed on 11.0R-amd64
Comment 1 Jov 2017-07-06 03:43:38 UTC
Created attachment 184106 [details]
bear.shar

add PKGNAMEPREFIX
Comment 2 Jov 2017-07-12 07:44:58 UTC
Created attachment 184297 [details]
bear.shar

remove tmp file from port dir
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2017-07-12 10:19:59 UTC
testbuilds@work
Comment 4 Kurt Jaeger freebsd_committer freebsd_triage 2017-07-16 17:50:54 UTC
I build it in poudriere, worked on current, 11.0amd64, but fails to build
on 10.3 i386,
because lang/erlang | erlang-19.3.6.1,4 failed in build

Should erlang build on 10.3 i386 ?
 
The log can be found at

http://people.freebsd.org/~pi/logs/erlang-19.3.6.1,4.log
Comment 5 Jov 2017-07-22 10:33:23 UTC
(In reply to Kurt Jaeger from comment #4)
Hi Kurt, thank you for your taking.
I test this port on 10.3 i386 poudriere, it passed, this is log: https://raw.githubusercontent.com/amutu/data/master/py27-bear-2.3.6.log

And this port does not depend on erlang, would you please check again?
Comment 6 Kurt Jaeger freebsd_committer freebsd_triage 2017-07-23 08:00:32 UTC
I found the cause. There was a former devel/bear port, which was renamed to erlang-bear, see this line in /usr/ports/MOVED:

devel/bear|devel/erlang-bear|2015-06-27|Renamed with erlang- prefix

And if I started the build via poudriere, it found the MOVED line and
started to build erlang-bear. Ouch.
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-07-23 08:05:24 UTC
A commit references this bug:

Author: pi
Date: Sun Jul 23 08:05:01 UTC 2017
New revision: 446457
URL: https://svnweb.freebsd.org/changeset/ports/446457

Log:
  New port: devel/bear

  Bear is a tool that generates a compilation database for clang
  tooling. The JSON compilation database is used in the clang project
  to provide information on how a single compilation unit is processed.
  With this, it is easy to re-run the compilation with alternate
  programs. One way to get a compilation database is to use cmake as
  the build tool. Passing -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to cmake
  generates the compile_commands.json file into the current directory.
  For non-cmake projects, Bear generates the JSON file during the
  build process.

  The concept behind Bear is: to execute the original build command
  and intercept the exec calls issued by the build tool. To achieve
  that, Bear uses the LD_PRELOAD or DYLD_INSERT_LIBRARIES mechanisms
  provided by the dynamic linker.

  WWW: https://github.com/rizsotto/Bear

  PR:		220475
  Submitted by:	Jov <amutu@amutu.com>

Changes:
  head/MOVED
  head/devel/Makefile
  head/devel/bear/
  head/devel/bear/Makefile
  head/devel/bear/distinfo
  head/devel/bear/pkg-descr
  head/devel/bear/pkg-plist
Comment 8 Kurt Jaeger freebsd_committer freebsd_triage 2017-07-23 08:06:14 UTC
Committed, thanks!