From 66f350923bdac2e57893e7d854679d842de3cfb0 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 3 May 2026 00:02:57 +0100 Subject: [PATCH] =?UTF-8?q?fix(build):=20track=20bin/dune=20(executable=20?= =?UTF-8?q?definition)=20=E2=80=94=20fix=20gitignore=20negation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI's `Run codegen WASM tests` step was failing with `Program 'affinescript' not found!` because the test runner couldn't locate the compiled binary. The cause: `bin/dune` was never tracked. Root cause was a gitignore semantics issue. The .gitignore had: /bin/ !bin/*.ml !bin/dune `/bin/` excludes the directory itself. Per git docs, "It is not possible to re-include a file if a parent directory of that file is excluded" — so `!bin/*.ml` and `!bin/dune` were silent no-ops. `bin/main.ml` happened to be tracked from before the gitignore rule was added, but `bin/dune` was never tracked, so origin's `bin/` had only main.ml and dune saw no executable to build. Fix: change `/bin/` to `/bin/*` (excludes contents, not the directory) so the negations actually re-include their targets. Also force-added `bin/dune` (the executable definition: `(executable (name main) (public_name affinescript) (package affinescript) (libraries affinescript cmdliner fmt fmt.tty))`) so origin gets it for the first time. After this lands, `dune build` produces `_build/default/bin/main.exe` and the codegen test runner's first compiler-detection branch hits. Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> --- .gitignore | 7 ++++++- bin/dune | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 bin/dune diff --git a/.gitignore b/.gitignore index b559f0b..46a637e 100644 --- a/.gitignore +++ b/.gitignore @@ -51,7 +51,12 @@ __pycache__/ # Ada/SPARK *.ali /obj/ -/bin/ +# `/bin/` excludes the directory itself, which makes git unable to re-include +# files inside it (negations can't re-include children of an excluded dir). +# `/bin/*` excludes the *contents* so `!bin/*.ml` and `!bin/dune` actually +# re-include their targets. The previous `/bin/` form silently dropped +# bin/dune from origin and broke CI's executable build. +/bin/* !bin/*.ml !bin/dune diff --git a/bin/dune b/bin/dune new file mode 100644 index 0000000..a336a2d --- /dev/null +++ b/bin/dune @@ -0,0 +1,7 @@ +; SPDX-License-Identifier: MIT OR AGPL-3.0-or-later + +(executable + (name main) + (public_name affinescript) + (package affinescript) + (libraries affinescript cmdliner fmt fmt.tty))