Wednesday, November 09, 2022

Re: new: devel/codechecker static analysis infrastructure built on LLVM

On 2022/11/09 10:30, Stefan Hagen wrote:
> Stuart Henderson wrote (2022-11-08 23:48 WET):
> > On 2022/11/08 22:12, Stefan Hagen wrote:
> > > Stuart Henderson wrote (2022-11-08 20:37 WET):
> > > > here are some tweaks, it looks like it will be too much pain to turn
> > > > it into a proper python.port.mk port but we can get a bit closer and use
> > > > some more bits of the ports framework.
> > > >
> > > > I also wondered if it should it be installed (or aliased) to CodeChecker
> > > > to match the case of the usage commands etc?
> > >
> > > I don't have a hard opinion on this. Moritz preferred it lowercase and
> > > I think it's more common, too. But the --help output and documentation
> > > shows CodeChecker.
> >
> > I prefer lowercase too, but the mismatch feels a bit wrong :)
> >
> > > Attached is a codechecker version that incorporates sthens feedback and
> > > also reworks the the file handling in a way I like even better.
> >
> > That allows files to get copied into WRKDIR which haven't gone through
> > the usual distinfo hash-checking process, I think it's better to use
> > the explicit filenames when copying from FULLDISTDIR (even if that
> > is using a subdirectory)
> >
> > > I had to add PARALLEL_MAKE_FLAGS, because with sthens version of
> > > ALL_TARGET = package package_api, make would try to build both targets
> > > at the same time, which caused issues here and I had to "make" the port
> > > twice for it to succeed.
> >
> > Do you have MAKE_JOBS set in mk.conf? You'll run into problems with
> > quite a few ports doing that. (If not, I don't know why it would try to
> > build in parallel).
>
> Indeed I do. And I prefer ports to work with it. So if you don't mind we
> can keep that line in?

This is not what PARALLEL_MAKE_FLAGS is meant for ..

PARALLEL_MAKE_FLAGS
Used when DPB_PROPERTIES contains 'parallel'. Flags to pass to
MAKE_PROGRAM to yield a parallel build. Defaults to
-j${MAKE_JOBS}. Mostly set to empty by ports that use other
mechanisms for setting the number of jobs.

And the only ports in the tree which set it, are using it for the intended
purpose (they are explicitly building parallel and have a different way to
set it).

Maybe we could use some other mechanism to signal that a port can't build
parallel but I don't think this is it (and we aren't doing it anywhere else in
the tree). But I think that's a separate discussion we should have before we
do anything special in individual ports.

FWIW I've used this before (but normally these days I type MAKE_JOBS=x by hand,
where X depends on what else the machine's doing at the time..) which makes
use of the one mechanism that we do have in ports to signal that a build is
parallel-safe:

.if defined(DPB_PROPERTIES) && ${DPB_PROPERTIES:Mparallel}
MAKE_JOBS=6
.endif

> Attached the updated version with copying the explicit file names. The
> rest is unchanged.
>
> The changed bits:
>
> post-extract:
> ${INSTALL_DATA_DIR} ${STATIC_DIR}
> ${INSTALL_DATA} ${FULLDISTDIR}/codemirror.min.{js,css} \
> ${FULLDISTDIR}/codemirror.LICENSE \
> ${FULLDISTDIR}/clike.min.js ${STATIC_DIR}/

I'm happy with that.

No comments:

Post a Comment