fix(build): stub build.rs in dep-prime; group justfile recipes #6

Merged
David merged 1 commit from fix/dockerfile-stub-buildscript-and-just-groups into main 2026-05-13 12:11:42 +02:00
Owner

Summary

Two changes:

oci-build/Dockerfile build fix. The dependency-priming step wrote an empty build.rs, then ran cargo build --release against a Cargo.toml that declares build = "build.rs". Cargo treated the empty file as a build script and failed with E0601: main function not found in crate build_script_build. Replace echo "" > build.rs with echo "fn main() {}" > build.rs so the stub satisfies the build-script contract during the dep-only prebuild; the real build.rs is then copied in over the stub before the actual source build.

justfile recipe groups. Tag every recipe with a [group('...')] attribute (hooks, dev, run, checks, build, release) so just --list renders recipes in named sections instead of one flat list. No behavioral change. Requires just >= 1.27 (CI/dev image at 1.42.4).

Test plan

  • just check-docker succeeds locally: dep-prime stage compiles, then the real-source stage finishes (Compiling youtrack-cli v0.1.0 ... Finished release profile).
  • just --list shows recipes grouped under [build], [checks], [dev], [hooks], [release], [run].
  • Re-run .forgejo/workflows/build-oci-image.yml (push or tag) and confirm CI completes through both cargo build --release invocations.
## Summary Two changes: **`oci-build/Dockerfile` build fix.** The dependency-priming step wrote an empty `build.rs`, then ran `cargo build --release` against a `Cargo.toml` that declares `build = "build.rs"`. Cargo treated the empty file as a build script and failed with `E0601: main function not found in crate build_script_build`. Replace `echo "" > build.rs` with `echo "fn main() {}" > build.rs` so the stub satisfies the build-script contract during the dep-only prebuild; the real `build.rs` is then copied in over the stub before the actual source build. **`justfile` recipe groups.** Tag every recipe with a `[group('...')]` attribute (`hooks`, `dev`, `run`, `checks`, `build`, `release`) so `just --list` renders recipes in named sections instead of one flat list. No behavioral change. Requires just >= 1.27 (CI/dev image at 1.42.4). ## Test plan - [x] `just check-docker` succeeds locally: dep-prime stage compiles, then the real-source stage finishes (`Compiling youtrack-cli v0.1.0 ... Finished release profile`). - [x] `just --list` shows recipes grouped under `[build]`, `[checks]`, `[dev]`, `[hooks]`, `[release]`, `[run]`. - [ ] Re-run `.forgejo/workflows/build-oci-image.yml` (push or tag) and confirm CI completes through both `cargo build --release` invocations.
fix(build): stub build.rs with main fn in dep-prime; group justfile recipes
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 6s
Create release / Create release from merged PR (pull_request) Has been skipped
b6f5fe5971
Two changes in one PR:

oci-build/Dockerfile: the dependency-priming stub wrote an empty build.rs, then ran `cargo build --release` against a Cargo.toml that declares `build = "build.rs"`. Cargo treated the empty file as a build script and failed with E0601 (`main` function not found in crate `build_script_build`). Replace `echo "" > build.rs` with `echo "fn main() {}" > build.rs` so the stub satisfies the build-script contract during the dep-only prebuild; the real build.rs is then copied in over the stub.

justfile: tag every recipe with a `[group('...')]` attribute (hooks, dev, run, checks, build, release) so `just --list` renders recipes in named sections instead of one flat list. No behavioral change. Requires just >= 1.27 (host has 1.42.4).

Verified locally with `just check-docker`: dep-prime stage and real-source build both complete; image tagged youtrack-cli:check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
David merged commit 5ff2990b04 into main 2026-05-13 12:11:42 +02:00
David deleted branch fix/dockerfile-stub-buildscript-and-just-groups 2026-05-13 12:11:42 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/youtrack-cli!6
No description provided.