#59402 closed defect (worksforme)

llvm and clang +assertions ?

Reported by: mouse07410 (Mouse) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), larryv (Lawrence Velázquez)
Port: clang-9.0

Description

Not a "real" bug report, but a confusion.

Both llvm-x.0 and clang-x.0 support variant +assertions. Of course, none of the ports cares to describe what those variants mean, or what they could/should be used for. Leaving the user to guess, because they don't always correspond to the upstream build options/flags.

So, here's the question: if I'm not actually debugging either LLVM or Clang themselves - does it make sense to install, e.g., clang-9.0 +assertions? Would that variant be of any use compiling/debugging a user's program?

Also, please consider updating port description (unfortunately, applies to ALL the ports in the MacPorts set!) to contain a few words about what each variant does, and how it differs from the main/plain port.

P.S. I'm surprised there aren't more questions/complaints like this.

Change History (4)

comment:1 Changed 19 months ago by kencu (Ken)

Assertions are useful for debugging clang, llvm, and lldb themselves. They can point to a very specific place where there is an error. There are many WWW articles, eg <http://pgbovine.net/programming-with-asserts.htm>.

Jeremy has them "on" for the devel versions only, as they slow down the code quite a bit.

comment:2 Changed 19 months ago by mouse07410 (Mouse)

Ken, thank you, understood.

But this is about one flag/variant: +assertions. There's +analyzer... And (almost) every port has a bunch of flags that aren't that obvious, and (of course!) aren't documented/described.

I assume creating a new port is not a simple/minute task. Given that complexity, it surprises the heck out of me that the MacPorts contributors don't bother to spend a few minutes more documenting those variants in the port description, and MacPorts maintainers do not require such documentation.

comment:3 Changed 16 months ago by kencu (Ken)

Actually there are descriptions, but you have to specifically ask for them, e.g.:

$ port variants clang-9.0
clang-9.0 has the variants:
[+]analyzer: Install clang static analyzer
   assertions: Enable assertions for error detection (has performance impacts,
               especially on JIT)
   debug: Enable debug binaries
[+]defaultlibcxx: default to -stdlib=libc++ if not otherwise specified
[+]libstdcxx: -stdlib=macports-libstdc++ searches for MacPorts libstdc++
   universal: Build for multiple architectures

comment:4 Changed 16 months ago by kencu (Ken)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.