Commit Graph

14 Commits

Author SHA1 Message Date
mikkeli 054deea900 ci: gate pushes on a build of both feature sets
Adds the minimal check a plugin repo actually needs: does it still build,
and do the identity strings still agree.

Both feature sets are built rather than just the default, because the
`vst3` cfg gates are exactly the kind of thing that rots — a default build
never compiles the Vst3Plugin impl, so a break there would otherwise
surface only when someone tried to ship a VST3. The bundle step is
included for the same reason: `cargo build` never exercises the xtask
bundler, and bundler.toml drifting from the crate name is invisible until
you try to produce an artifact.

The branding check runs first because it needs no toolchain and finishes
in under a second, so a half-landed rename fails before a build is spent
on it.

Performance testing is deliberately absent. Realtime cost is only
meaningful against an audio deadline, and `Plugin::process()` cannot be
called from a test at all: `ProcessContext` requires a `&Transport`, whose
constructor and fields are `pub(crate)` to nih_plug, so no external crate
can implement the trait. A static lint for locks in the audio path was
considered and dropped — `lock` and `borrow` are ordinary identifiers, not
reserved words, so a substring search matches every occurrence of "block"
in DSP code while missing `println!`, `recv()` and `Condvar::wait()`,
which are the likelier offenders. `assert_process_allocs` remains the real
guarantee, and it only fires in a debug build inside a host.

Verified by running the exact step sequence as the gitea-runner user under
the service's environment.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-31 22:27:35 +09:00
mikkeli 1dc45dc235 Merge branch 'chore/relicense-gpl3'
Relicense to GPL-3.0-or-later to match the plugins built from this template,
and credit the ISC-licensed NIH-plug upstream the skeleton derives from.
2026-08-31 22:01:51 +09:00
mikkeli 9c0e31d783 chore: relicense to GPL-3.0-or-later and credit the ISC upstream
Apache-2.0 was the wrong declaration for two independent reasons.

Enabling the `vst3` feature links vst3-sys, which is GPLv3-or-later by its
own authors' choice — they describe their port as a derivative of
Steinberg's SDK that "was not made in isolation", so the obligation holds
regardless of any question about Steinberg's own rights. Gating the
feature kept the default build clean, but plugins built from this template
are intended to ship VST3, so GPL is where they land anyway. Declaring it
up front is more honest than deferring the decision to every clone.

Separately, parts of src/lib.rs derive from Robbert van der Helm's
NIH-plug cookiecutter template and its `gain` example, both ISC. ISC's one
condition is that its copyright and permission notice travel with all
copies, and this repo carried neither — a compliance gap that existed
regardless of the GPL question. ISC is GPL-compatible, so the notice is
retained in a new NOTICE file rather than superseded.

The `vst3` feature stays opt-in, but its rationale changes: it is no
longer about licence compliance, only about not pulling a sizeable
dependency into a CLAP-only build. The Cargo.toml comment said otherwise
and would have misled the next reader.

Also corrects the README's claim that you must "accept Steinberg's VST3
SDK licence". No SDK source is vendored or redistributed here, so there is
nothing to accept at build time. The real constraint is vst3-sys's GPLv3,
plus Steinberg's separate trademark in "VST" — a different regime from
copyright that no source licence resolves.

Copyright in the Irene <irene@novoyuuparosk.org> commits is held by the
repository owner (an agent identity), so no third-party agreement was
needed for this relicense.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-31 22:00:33 +09:00
mikkeli 6dc67c0931 Merge branch 'feat/branding-checker-structural-names'
Extend the branding checker over descriptions and Rust type names, and fix
two bugs the tests for it exposed: a stale scan that silently passed
outside a git checkout, and a TODO count that broke once it reached zero.
2026-08-29 10:29:14 +09:00
mikkeli 3acab7bf7e feat: check descriptions and Rust type names for branding drift
The checker covered the identity strings a host sees, but not two other
kinds of template residue.

Descriptions: `Cargo.toml`'s `description` and `CLAP_DESCRIPTION` both
shipped as placeholders, and the latter surfaces in some host browsers.

Type names: `MyPlugin` and `PluginParams` appear at nine sites between
the struct definitions, the three trait impls, the two export macros and
the params field. Missing one is a compile error rather than silent drift,
so this is a convenience rather than a safety net - but naming the site
beats reading rustc, and the `Vst3Plugin` impl sits behind a cfg, so a
default build never reports it at all. Renaming the types is optional:
leave the canonical values alone and the checks stay green.

TODO markers are reported at a new informational level that never counts
toward pass/fail. They are legitimate while building, so failing on them
would just train you to ignore the run - but a finished plugin should not
quietly ship with five of them.

Two bugs surfaced while testing this:

- The stale scan drew its file list from `git ls-files`, which returns
  nothing outside a checkout. In an exported tarball every stale spelling
  was therefore reported absent - the section passed hardest exactly when
  it could see least. It now falls back to `find` and says which source
  it used.
- `grep -c` prints 0 and exits 1 when there are no matches, so the TODO
  count's `|| echo 0` appended a second zero and produced an unparseable
  value once a rename removed the last TODO.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:29:06 +09:00
mikkeli 26f3593b15 Merge branch 'fix/template-api-and-tooling'
Make the template actually usable: it did not compile, its build docs
described output paths the bundler never produces, and its declared
licence conflicted with the artifact its default build emitted.

Also brings over codename-206's branding checker, extended so that
renaming — the first thing anyone does with a template — verifies itself.
2026-08-29 10:25:32 +09:00
mikkeli 4fd38cce75 chore: check in Cargo.lock
Cargo.toml claims the pinned nih-plug rev makes builds reproducible, but
the rev only pins that one tree. Everything beneath it — roughly 200
crates.io dependencies — still resolved to whatever was newest at build
time, so two clones a week apart could compile different code.

A cdylib plugin is a final artifact rather than a library others depend
on, so the usual argument for leaving the lockfile out does not apply.
Checking it in also means CI builds exactly what was built locally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:25:02 +09:00
mikkeli 1ddba77c28 feat: add a branding consistency checker
Adapted from musiikki/codename-206, where the same script guards a single
plugin. It matters more here: renaming is the first thing anyone does with
a template, and identity is duplicated across Cargo.toml, bundler.toml,
src/lib.rs and the docs with nothing keeping them in agreement. A
half-finished rename builds a bundle under one name while the docs and
deploy script look for another.

Changes from the codename-206 original:

- Checks for files this repo does not ship (deploy.ps1) report as `skip`
  rather than FAIL, and start enforcing once the file appears.
- STALE ships pre-seeded with this template's own placeholders, and each
  entry is skipped while it is still part of a canonical value. That makes
  renaming self-checking: entries arm themselves as you change the value
  they belong to, with no bookkeeping. Substring rather than equality,
  because placeholders nest — "your-domain" lives inside the canonical
  CLAP_ID.
- Covers identity this template carries that codename-206's did not:
  VENDOR, EMAIL, the Cargo homepage feeding Plugin::URL, that the `env!`
  indirection is still in place, and the README's bundle command.
- Asserts CLAP_ID is reverse-DNS safe. A stray capital or space there is
  not a compile error, it is a silent identity change between machines.

Two placeholder spellings had to move to avoid false positives, since a
checker that cries wolf trains you to ignore it: bundler.toml's comment
contained the literal "Plugin Name", and the CLAP_ID TODO spelled the
placeholder a third way that matched neither the constant nor the STALE
list. The TODO now illustrates the form instead of repeating a placeholder.

.gitattributes pins *.sh to LF so core.autocrlf=true on Windows cannot
check the script out with a CRLF shebang that dash rejects.

Verified three ways: clean template passes, a partial rename names every
drifted file, and a complete rename passes and still compiles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:24:52 +09:00
mikkeli c6f2f32fb3 feat: make VST3 an opt-in cargo feature
Cargo.toml declared Apache-2.0 while the default build linked vst3-sys,
whose bindings are GPLv3 — so the artifact a fresh clone produced could
not legally be distributed under the licence the repo claimed. A template
should not hand that trap to every project cloned from it.

NIH-plug already anticipates this: its `vst3` feature exists, in upstream's
own words, "mostly for GPL-compliance reasons". Taking `default-features =
false` and re-exporting `vst3` as a local opt-in makes the default build
CLAP-only and genuinely Apache-2.0 clean, while `--features vst3` remains
one flag away for anyone who accepts GPLv3.

Gating the feature rather than relicensing keeps the decision with whoever
uses the template. Reversing it is a one-line default plus removing two
cfg attributes, where relicensing to GPLv3 now would commit every
downstream plugin to that choice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:24:33 +09:00
mikkeli fc45d3eec0 docs: correct bundle output paths and add Linux prerequisites
Two things in the build instructions were wrong rather than merely thin.

The stated output paths (`nih_plug_template.vst3`) are not what the
bundler produces: `cargo xtask bundle` names artifacts from the `name` key
in bundler.toml, so a fresh clone actually yields `Plugin Name.vst3`.
Anyone following the deploy steps verbatim would copy a path that does not
exist. The VST3 artifact is also a directory bundle, so the `cp` needed
`-r` to work at all.

The egui editor pulls in baseview and x11, whose build scripts abort on a
missing `gl.pc` with a pkg-config error that says nothing about this
project. Naming the packages up front turns a confusing first-build
failure into a one-line fix.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:23:59 +09:00
mikkeli dd5cedfa92 fix: rewrite the plugin skeleton against the pinned NIH-plug API
The scaffold did not compile. src/lib.rs was written against an API that
does not exist at the pinned rev (f36931f):

- `impl Params` declared six methods that are not trait members
  (`as_slice`, `param_by_id`, `param_by_name` and their `_mut` pairs) over
  two types that appear nowhere in the crate (`AtomicParam`, `ParamId`).
  The real trait is `unsafe trait Params` with one required method,
  `param_map`, and is meant to be derived rather than hand-written.
- `type SysSysexMessage` misspells the associated type `SysExMessage`.
- `ChannelSamples` has no immutable `get`, so the passthrough loop's
  `*frame.get_mut(ch).unwrap() = *frame.get(ch).unwrap()` could not resolve.

Replaced with `#[derive(Params)]` over an example gain parameter, so the
skeleton demonstrates the smoother and dB formatters a real plugin needs
instead of leaving an empty struct that teaches nothing. The passthrough
loop becomes an actual gain application for the same reason.

`editor()` is wired to a real `create_egui_editor` window in the same
change rather than a follow-up: nih_plug_egui was already a declared
dependency that nothing used, and the persisted `editor_state` field the
editor needs is part of the same params struct being rewritten here.
Splitting them would leave a commit whose params struct exists only to
serve an editor that is not there yet.

Verified against a local checkout of nih-plug at the pinned rev rather
than from memory, and confirmed by building.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHt4DykxXaQnyaJfyS8KCn
2026-08-29 10:23:37 +09:00
irene 048a85fa3d docs: add proper README with build/deploy instructions 2026-08-21 13:08:18 +09:00
irene 4700376bc8 chore: scaffold minimal NIH-plug template
Based on musiikki/codename-206 patterns. Provides a clean, minimal
skeleton for new nih-plug audio plugins:

- Cargo.toml with pinned NIH-plug deps (same rev as codename-206)
- src/lib.rs — skeleton plugin with Params, Plugin impl, CLAP/VST3
- xtask/ — bundler xtask (cargo xtask bundle)
- bundler.toml — placeholder for bundle name
- .cargo/config.toml — xtask alias
- .gitignore — /target, /nih-plug, /_template
- LICENSE — Apache-2.0
- README.md — build and deploy instructions
2026-08-21 13:07:09 +09:00
irene b0e1bee433 Initial commit 2026-08-21 03:55:36 +00:00