fix(dev): mount build.rs into cryptify-fileshare so PG_CORE_VERSION compiles#248
fix(dev): mount build.rs into cryptify-fileshare so PG_CORE_VERSION compiles#248rubenhensen wants to merge 1 commit into
Conversation
cryptify/build.rs reads Cargo.lock to extract the pg-core version and sets PG_CORE_VERSION, which src/email.rs consumes via env!() to stamp the X-PostGuard mail header. The dev container only mounted src/ and templates/, so cargo-watch saw a package with no build script and compilation failed with "environment variable PG_CORE_VERSION not defined at compile time". Mount build.rs, Cargo.toml, and Cargo.lock read-only so the build script runs and a future pg-core bump in Cargo.lock retriggers the rebuild via cargo:rerun-if-changed=Cargo.lock.
|
Dobby has received the request! Routing to the right specialist now... |
There was a problem hiding this comment.
Code review
PR is mostly redundant — the build.rs and Cargo.lock mounts already landed on main via #246 (d52ee5b). mergeable=CONFLICTING. Only the Cargo.toml mount is genuinely new. Rebase, drop the duplicates, and update title/body to reflect that only the Cargo.toml sync remains.
Rule compliance
Two rule issues: the PR body over-justifies what reduces to a one-line change post-rebase (no-justification-paragraphs-for-simple-changes), and the conflicting state needs the git diff origin/main --stat no-op check after resolution (conflict-resolution-check-noop).
| - ./cryptify/templates:/app/templates | ||
| - ./cryptify/build.rs:/app/build.rs:ro | ||
| - ./cryptify/Cargo.toml:/app/Cargo.toml:ro | ||
| - ./cryptify/Cargo.lock:/app/Cargo.lock:ro |
There was a problem hiding this comment.
| - ./cryptify/conf/config.dev.toml:/app/config.toml:ro | ||
| - ./cryptify/src:/app/src | ||
| - ./cryptify/templates:/app/templates | ||
| - ./cryptify/build.rs:/app/build.rs:ro |
There was a problem hiding this comment.
[Code review] PR branch's cryptify submodule pointer is 4c30e53, which predates the addition of build.rs upstream (cryptify#170, present from 7816df8). A fresh gh pr checkout 248 && git submodule update --init leaves ./cryptify/build.rs missing, so the bind mount has no source file and Docker will create an empty path or refuse to start — the stated test plan can't be executed against the branch as-shipped. Bump the submodule pointer or rebase onto main (already at 63066a1).
| - ./cryptify/src:/app/src | ||
| - ./cryptify/templates:/app/templates | ||
| - ./cryptify/build.rs:/app/build.rs:ro | ||
| - ./cryptify/Cargo.toml:/app/Cargo.toml:ro |
There was a problem hiding this comment.
[Rule: no-justification-paragraphs-for-simple-changes] After rebasing onto main (which already has the build.rs and Cargo.lock mounts), this PR collapses to a single added line. The three-bullet rationale in the PR body is more explanation than the change warrants — trim to one or two bullets and let the diff speak.
Summary
cryptify/build.rsreadsCargo.lockto extract thepg-coreversion and exposes it asPG_CORE_VERSION, whichsrc/email.rs:37consumes viaenv!()to stamp theX-PostGuardmail header that the Outlook add-in'sOnMessageReadfilter relies on.cryptify-filesharedev service only mountedsrc/andtemplates/, socargo watch -x runsaw a package with no build script and failed withenvironment variable PG_CORE_VERSION not defined at compile time.build.rs,Cargo.toml, andCargo.lockread-only so the build script runs at container startup, and a futurepg-corebump inCargo.lockretriggers the rebuild viacargo:rerun-if-changed=Cargo.lock.Test plan
docker compose up -d --build cryptify-filesharedocker compose logs -f cryptify-fileshare— confirm cargo builds without thePG_CORE_VERSIONerror and the service comes up healthyX-PostGuardheader carries thepg-coreversion fromCargo.lock