Skip to content

Improve diagnostics for overlong asset paths - #5791

Open
aiqubits wants to merge 1 commit into
DioxusLabs:mainfrom
aiqubits:fix/const-str-overflow-diagnostic
Open

Improve diagnostics for overlong asset paths#5791
aiqubits wants to merge 1 commit into
DioxusLabs:mainfrom
aiqubits:fix/const-str-overflow-diagnostic

Conversation

@aiqubits

Copy link
Copy Markdown

Summary

  • guard ConstStr capacity before writing into its fixed-size buffer
  • report an actionable compile-time error when a resolved asset path exceeds the 256-byte limit
  • validate CLI-created source and bundled paths, including hash-generated and public-directory assets
  • propagate path-length errors before modifying the output binary
  • include the offending path and original source in runtime diagnostics
  • add boundary, overflow, diagnostic, and compile-fail coverage

Testing

  • cargo test --offline -p const-serialize -p manganis-core -p manganis-macro
  • cargo test --offline -p manganis
  • cargo test --offline -p dioxus-cli opt::tests::
  • cargo clippy --offline -p const-serialize -p manganis-core -p manganis-macro --tests --no-deps -- -D warnings
  • cargo fmt --package const-serialize --package manganis-core --package manganis-macro --package dioxus-cli -- --check
  • git diff HEAD^ --check

Fixes #5777

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.

asset!() fails with "index out of bounds: the length is 256 but the index is 256" when the project path is deep enough

1 participant