Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
run: pnpm install --frozen-lockfile

# the CLAP prober, the LV2 measurer, their interposer and the fixture plugins the tests qualify;
# deps/ also holds openmixer's copy of the measurer, which the parity test runs beside ours, and
# omx-clap-core's LV2 feature provider at the packages' floor, built for the measurer to link
# deps/ also holds omx-clap-core's LV2 feature provider at the packages' floor, built for the measurer to link
# asan: the measurer under AddressSanitizer, which the leak check runs
- name: Build the native tools
run: |
Expand Down
16 changes: 6 additions & 10 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,21 @@ Its host features are omx-clap-core's LV2 feature provider, the static `libomx-c
header: `pkg-config omx-clap-lv2` (`omx-clap-lv2-devel`, `libomx-clap-lv2-dev`), else `make deps`
fetches omx-clap-core at the packages' floor, builds the archive against the fetched CLAP headers and
installs it into `native/deps/omx-clap-lv2`.
That header is also what openmixer's copy of the LV2 measurer reads (kept in
`native/parity/openmixer` as it was at the commit it was taken from, each file's blob id in `BLOBS`),
so the build carries that copy, `native/build/parity/lv2_measure`, beside ours:

```
make -C native deps all # native/build/clap-qualify, lv2_measure, rt_interpose.so, fixtures/
```

The native tests run the build; without it they skip, except on CI, where a missing build fails. The
parity test runs both LV2 measurers on the fixture bundles and wants the same bytes from each, once
the three things only ours prints are taken out of its line: the `host` object, the
`featureOptions` object and the soak's `maxRmsDbfs` (the soak case lifts the sweep's bound, so both
sweep the same range).
The native tests run the build; without it they skip, except on CI, where a missing build fails.
`make -C native asan` builds the measurer under AddressSanitizer, `native/build/asan/lv2_measure`,
which the leak check runs on every way out of it (a measurement, a soak, a plugin that will not
instantiate). It is not part of `all`, so a package build needs no libasan.

`make -C native install DESTDIR=... LIBEXECDIR=...` installs the prober, the measurer and the
interposer (not the fixtures): exactly `NATIVE_TOOLS` in `src/qualify-declarations.ts`. The command
`make -C native install DESTDIR=... LIBEXECDIR=...` installs the prober, the measurer, the
interposer and the LV2 host probe (not the fixtures): exactly `NATIVE_TOOLS` in
`src/qualify-declarations.ts`. The host probe (`lv2_host_probe <bundle> [uri]`) loads a worker plugin
through lilv and drives it as a host does, so a console that exports an LV2 plugin tests that
plugin's host-facing half with it. The command
and `tools/lv2-measure.mjs` look for each by its setting (`OMX_CLAP_QUALIFY`, `OMX_LV2_MEASURE`,
`OMX_RT_INTERPOSE`), then in `native/build/`, then in the directories the packages install into
(`NATIVE_TOOL_DIRS`). An installed package has no `native/build/`; in a checkout, its own build wins
Expand Down
22 changes: 6 additions & 16 deletions native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
# make -C native deps fetch the CLAP and plugin-hostd headers at the pinned tags into deps/, the
# omx-contract header the LV2 measurer reads its rates from, and omx-clap-core's
# LV2 feature provider (libomx-clap-lv2), built and installed into deps/
# build/parity/lv2_measure openmixer's LV2 measurer (parity/openmixer, kept as it was there), built with
# these flags when deps/ holds that header: the parity test runs it beside ours
# make -C native install DESTDIR=... LIBEXECDIR=... the prober, the measurer and the interposer, for a package
# make -C native install DESTDIR=... LIBEXECDIR=... the prober, the measurer, the interposer and the LV2 host
# probe, for a package
#
# The CLAP headers come from `pkg-config clap` (Fedora clap-devel), else deps/clap; plugin-hostd's pin
# header from `pkg-config plugin-hostd` (plugin-hostd-devel), else deps/plugin-hostd. omx-contract's limits
Expand All @@ -30,8 +29,8 @@ BUILD ?= build

CLAP_REF := 1.2.6
PLUGIN_HOSTD_REF := v0.1.4
# the omx-contract `make deps` fetches where no omx-contract-devel is installed: the packages' floor, so both builds
# read the same contract. The rates are the same in 2.3.0, which openmixer's copy (parity/openmixer/BLOBS) was built against.
# the omx-contract `make deps` fetches where no omx-contract-devel is installed: the packages' floor, so the build
# reads the contract the packages do.
OMX_CONTRACT_VERSION := 2.10.1
# the omx-clap-core whose LV2 feature provider `make deps` builds where no omx-clap-lv2-devel is installed: the
# packages' floor
Expand Down Expand Up @@ -82,8 +81,6 @@ all: $(BUILD)/clap-qualify $(BUILD)/lv2_measure $(BUILD)/lv2_host_probe $(BUILD)
$(BUILD)/fixtures/fail-alloc.so \
$(BUILD)/fixtures/lv2/rt-safe.lv2/gain.so $(BUILD)/fixtures/lv2/rt-unsafe.lv2/gain.so \
$(BUILD)/fixtures/lv2/host-faithfulness.lv2/host-faithfulness.so
@# asked when the recipe runs, so `make deps all` builds it from what deps just fetched
@if [ -f deps/omx-contract/include/omxcontract/omx_contract_limits.h ]; then $(MAKE) --no-print-directory $(BUILD)/parity/lv2_measure; fi

$(BUILD) $(BUILD)/fixtures:
mkdir -p $@
Expand All @@ -94,8 +91,6 @@ $(BUILD)/clap-qualify: clap-qualify.c rt-interpose.h | $(BUILD)

LV2_MEASURE_SRC := lv2-measure.c lv2-measure-options.c lv2-measure-pin.c
LV2_MEASURE_HDR := lv2-measure-options.h lv2-measure-pin.h rt-interpose.h
# openmixer's copy, as it was taken: its own features unit
PARITY_SRC := lv2-measure.c lv2-measure-features.c lv2-measure-pin.c

# as openmixer built it: no FMA contraction, so a figure is the same on every architecture and compiler
$(BUILD)/lv2_measure: $(LV2_MEASURE_SRC) $(LV2_MEASURE_HDR) | $(BUILD)
Expand All @@ -115,12 +110,6 @@ $(BUILD)/lv2_measure_options_test: lv2_measure_options.test.c lv2-measure-option
$(CC) $(CPPFLAGS) $(CFLAGS) -Werror $(OMX_CLAP_LV2_CFLAGS) $(LV2_CFLAGS) -I. $(LDFLAGS) -o $@ lv2_measure_options.test.c \
lv2-measure-options.c $(OMX_CLAP_LV2_LIBS) -ldl -lpthread

# named lv2_measure too: the measurer leaves frames of its own binary, by that name, out of an event's owner
$(BUILD)/parity/lv2_measure: $(addprefix parity/openmixer/,$(PARITY_SRC)) parity/omx_console_limits.h | $(BUILD)
mkdir -p $(@D)
$(CC) $(CPPFLAGS) $(CFLAGS) -ffp-contract=off -Iparity -Ideps/omx-contract/include $(PLUGIN_HOSTD_CFLAGS) \
$(LILV_CFLAGS) $(LDFLAGS) -o $@ $(addprefix parity/openmixer/,$(PARITY_SRC)) $(LILV_LIBS) -lpthread -lm -ldl

$(BUILD)/lv2_host_probe: lv2-host-probe.c | $(BUILD)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LILV_CFLAGS) $(LDFLAGS) -o $@ $< $(LILV_LIBS) -lpthread -lm

Expand Down Expand Up @@ -179,11 +168,12 @@ deps:

# the fixtures are the tests' own, never installed; the interposer is executable so rpm strips it (dh_fixperms clears the bit)
# exactly src/qualify-declarations.ts's NATIVE_TOOLS (src/native-install-dirs.test.ts holds the two together)
install: $(BUILD)/clap-qualify $(BUILD)/lv2_measure $(BUILD)/rt_interpose.so
install: $(BUILD)/clap-qualify $(BUILD)/lv2_measure $(BUILD)/rt_interpose.so $(BUILD)/lv2_host_probe
install -d $(DESTDIR)$(LIBEXECDIR)
install -m 0755 $(BUILD)/clap-qualify $(DESTDIR)$(LIBEXECDIR)/clap-qualify
install -m 0755 $(BUILD)/lv2_measure $(DESTDIR)$(LIBEXECDIR)/lv2_measure
install -m 0755 $(BUILD)/rt_interpose.so $(DESTDIR)$(LIBEXECDIR)/rt_interpose.so
install -m 0755 $(BUILD)/lv2_host_probe $(DESTDIR)$(LIBEXECDIR)/lv2_host_probe

clean:
rm -rf $(BUILD)
Expand Down
4 changes: 2 additions & 2 deletions native/fetch-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Copyright (C) 2026 Pau Aliagas <linuxnow@gmail.com>
#
# The headers the prober builds against, each at a release tag: the CLAP SDK and plugin-hostd (its pin.h).
# The omx-contract C header both LV2 measurers (ours and openmixer's copy, parity/openmixer) read their
# rates from, at the version the packages require, for a build with no omx-contract-devel installed.
# The omx-contract C header the LV2 measurer reads its rates from, at the version the packages require,
# for a build with no omx-contract-devel installed.
# omx-clap-core's LV2 feature provider, the static libomx-clap-lv2 and its header, at the version the
# packages require, built against the fetched CLAP headers and installed into <dir>/omx-clap-lv2, for a
# build with no omx-clap-lv2-devel installed.
Expand Down
9 changes: 0 additions & 9 deletions native/parity/omx_console_limits.h

This file was deleted.

8 changes: 0 additions & 8 deletions native/parity/openmixer/BLOBS

This file was deleted.

180 changes: 0 additions & 180 deletions native/parity/openmixer/lv2-measure-features.c

This file was deleted.

Loading
Loading