Skip to content

fix(dapi-grpc): files generated outside sandbox#3056

Open
lklimek wants to merge 4 commits intov3.1-devfrom
build/dapi-grpc-sandbox
Open

fix(dapi-grpc): files generated outside sandbox#3056
lklimek wants to merge 4 commits intov3.1-devfrom
build/dapi-grpc-sandbox

Conversation

@lklimek
Copy link
Contributor

@lklimek lklimek commented Feb 5, 2026

Issue being fixed or feature implemented

Codex in dash-evo-tool fails to build the project due to:

  thread 'main' (49219) panicked at /home/lklimek/.cargo/git/checkouts/platform-7a21f318038a582f/98a0ebe/packages/dapi-grpc/build.rs:38:10:
  generate core proto: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

What was done?

Fixed generated code output dir to move it into the sandbox (env var DAPI_GRPC_OUT_DIR or OUT_DIR/dapi_grpc)

How Has This Been Tested?

Let codex build dash-evo-tool using this branch.

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • Chores

    • Improved build configurability: build output directory can now be driven by an environment variable with clearer error guidance and better change detection during builds.
    • Generated code output is organized into distinct subdirectories for core, platform, and drive to simplify artifacts.
  • Tests

    • Internal test iteration logic simplified for clearer test flows.

@github-actions github-actions bot added this to the v3.1.0 milestone Feb 5, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Build resolves an output base dir at build time (DAPI_GRPC_OUT_DIR fallback) and passes it into gRPC code generation; generated output paths and compile-time includes are relocated under that output base. A small loop change was made in strategy-tests addressing output indexing.

Changes

Cohort / File(s) Summary
Build script & codegen
packages/dapi-grpc/build.rs
Add resolve_output_base() returning a PathBuf; read DAPI_GRPC_OUT_DIR with fallback to OUT_DIR/dapi_grpc; change generate_code(typ)generate_code(typ, output_base: &Path); pass output_base to Server/Client/Wasm generators; construct outputs with output_base.join(...); add cargo:rerun-if-env-changed=DAPI_GRPC_OUT_DIR; add missing env and Path imports.
Runtime/module includes
packages/dapi-grpc/src/lib.rs
Replace static include! paths with compile-time concatenation using concat!(env!("DAPI_GRPC_OUT_DIR"), "...") for core, platform, and drive modules across server, client, and wasm32 targets.
Test logic tweak
packages/strategy-tests/src/lib.rs
Change an output-generation loop to use enumerate() (for (outputs_created, _) in (0..output_count).enumerate()), remove manual counter increment; adjusts index usage for outputs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
I hopped through build scripts, nose aglow,
Found output burrows where the gRPC files go.
Paths now follow a tuneful, env-sent beat,
Modules include from under my feet —
A little hop, and everything's neat! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(dapi-grpc): files generated outside sandbox' clearly summarizes the main issue being addressed—correcting the placement of generated files to prevent them from being created outside the build sandbox.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch build/dapi-grpc-sandbox

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@packages/dapi-grpc/build.rs`:
- Line 39: Change the generate_code signature to accept an &Path instead of
&PathBuf to satisfy clippy::ptr_arg: add use std::path::Path; and update fn
generate_code(typ: ImplType, output_base: &Path) { … } and then update any
callers that currently pass a PathBuf (e.g., variables named output_base) to
pass output_base.as_path() or borrow as a Path; ensure references to the
parameter inside generate_code still work with &Path.

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.

1 participant