Skip to content

build: package the single-file header script for source builds - #43

Merged
adsharma merged 1 commit into
LadybugDB:mainfrom
kory-io:fix/package-single-file-header-script
Sep 29, 2026
Merged

adsharma merged 1 commit into
LadybugDB:mainfrom
kory-io:fix/package-single-file-header-script

Conversation

@kory-io

@kory-io kory-io commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Problem

lbug 0.21.0 on crates.io cannot be built from source (LBUG_BUILD_FROM_SOURCE=1 / LBUG_RUST_BUILD_FROM_SOURCE=1).

build.rs now sets BUILD_SINGLE_FILE_HEADER=ON (#ca706e5; 0.20.4 had it OFF). With that on, lbug-src/src/CMakeLists.txt runs scripts/collect-single-file-header.py, and that script reads scripts/headers.txt. Neither file is in the package include list, so the build fails:

make[2]: *** No rule to make target `.../lbug-0.21.0/lbug-src/scripts/collect-single-file-header.py', needed by `src/lbug.hpp'.  Stop.
make[1]: *** [src/CMakeLists.txt/single_file_header.dir/all] Error 2

Fix

  • Add lbug-src/scripts/collect-single-file-header.py and lbug-src/scripts/headers.txt to package.include.
  • Add matching rerun-if-changed lines, as the comment in build.rs asks.

Verification

  1. Before the fix (published 0.21.0 crate): a from-source build fails with the error above, on macOS arm64 with Python 3.14 found.
  2. After the fix: with lbug-src symlinked to a v0.21.0 checkout of LadybugDB/ladybug:
    • cargo package --list now includes both files.
    • LBUG_BUILD_FROM_SOURCE=1 cargo package succeeds. Cargo's package verification builds the extracted tarball from source, and out/build/src/lbug.hpp is generated.

A 0.21.1 with this change would let downstream crates that build from source move to 0.21.

@adsharma
adsharma merged commit 28aba1c into LadybugDB:main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants