Page MenuHomeFreeBSD

devel/lua-language-server: Verbose builds and sortof support ccache
Needs ReviewPublic

Authored by adamw on Wed, Apr 22, 3:53 AM.
Tags
None
Referenced Files
F153890735: updated.diff
Fri, Apr 24, 1:55 PM
F153854445: D56566.diff
Fri, Apr 24, 6:48 AM
Unknown Object (File)
Wed, Apr 22, 7:13 AM

Details

Summary

This accomplishes a couple things:

  1. Enables verbose builds for both the luamake and luals build phases
  2. Supports ccache during the luamake build phase

The verbose builds should happen; we always want to see the actual commands wherever possible.

The ccache support looks kludgey because it is kludgey, but it’s an approach that’s used in multiple ports, and ${CCACHE_BIN} defaults to ”” for precisely this scenario.

That said, I haven’t yet figured out how to get that into the LuaLS build phase. It seems like it’s driven by a generated file, but that file is created during the build phase, so it’s really unclear when (and *how*) to patch the file.

IIRC, this is how the lua-language-server built during its prehistoric phase—the luamake phase is ccache’d, and the luals phase is not.

Anyway, Dave what are your thoughts on this?

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

adamw requested review of this revision.Wed, Apr 22, 3:53 AM

I think the thing you need to patch for the full build is in luamake: 3rd/luamake/scripts/globals.lua

Unlike my patch for samurai there already exists a globals.compiler though. But I would just change the whole thing to your %CC%
globals.compiler = %CC$%

I mean why do tests when we can just set it direct since we know?

I like everything else. I haven't tried this because I still haven't set up ccache 😦

I haven't tried this because I still haven't set up ccache 😦

Just in case, and because it's real simple, here are the steps to do so:

devel/ccache4 OPTIONS:

STATIC=on

/usr/local/etc/poudriere.conf:

CCACHE_STATIC_PREFIX=/usr/local
CCACHE_DIR=<wherever>

That sets up a shared cache between all poudriere jails (I use ${BASEFS}/ccache). You can also override CCACHE_DIR or just set it individually in each /usr/local/etc/poudriere.d/<jail>-poudriere.conf. If you build as non-root, read the poudriere.conf description for BUILD_AS_NON_ROOT for instructions about ownership.

Just install that ccache4 package with STATIC enabled on the host, and you're good to go.

Well first off, changing globals.compiler doesn't work because that is a string to a module to import.
But it does look like we can just add golbals.cc = "%CC%" to that file to get the desired result.

At least I can see it switches from "clang" to "cc" as it builds. (going to be a while before I get time to set up ccache). But if you have time to try I'll attach the updated diff that still works without ccache: