Skip to content

fix(asn1): docs.rs read-only generate_schema / generated.rs writes - #49

Merged
sephynox merged 3 commits into
mainfrom
cursor/docsrs-asn1-ro-repro-9305
Sep 21, 2026
Merged

sephynox merged 3 commits into
mainfrom
cursor/docsrs-asn1-ro-repro-9305

Conversation

@sephynox

@sephynox sephynox commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Makes the red docsrs_readonly reproduction on this branch green. No test weakening.

keetanetwork-asn1 build.rs writes ASN.1 staging and generated Rust under OUT_DIR when docs.rs sets DOCS_RS or the crate source is read-only.

Pattern: stop rewriting src/generated.rs. That file is a committed include! stub over OUT_DIR. Compile helper generated.rs and ASN.1/OID Rust outputs stay under OUT_DIR. asn1/*.asn remain inputs. iso20022.asn is refreshed from oids.json when the source tree is writable.

Rustdocs on this path are positive STE contracts.

Test

cargo test -p keetanetwork-asn1 --all-features --test docsrs_readonly -- --nocapture

After merge

Publish a new keetanetwork-asn1 and trigger docs.rs rebuilds for it and dependents (+rebuild or new versions).

Evidence:

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 21, 2026 21:14
Add a failing integration test that runs the keetanetwork-asn1 build
under DOCS_RS=1 with a chmod a-w crate source tree, matching the
docs.rs sandbox. generate_schema() still writes asn1/iso20022.asn
and panics with Permission denied (os error 13), the chmod equivalent
of Read-only file system (os error 30). No production fix.

Co-authored-by: Tanveer Wahid <sephynox@users.noreply.github.com>
generate_schema() no longer panics when asn1/iso20022.asn is not
writable. Rendered schema and other .asn inputs are staged under
OUT_DIR for compile. src/generated.rs stays a committed include!
stub; build.rs writes the helper generated.rs only under OUT_DIR.

Co-authored-by: Tanveer Wahid <sephynox@users.noreply.github.com>
@cursor cursor Bot changed the title test(asn1): red-only docs.rs RO generate_schema reproduction fix(asn1): docs.rs read-only generate_schema / generated.rs writes Sep 21, 2026
Reword rustdocs on the docs.rs read-only path to STE positive
contracts. No behavior change.

Co-authored-by: Tanveer Wahid <sephynox@users.noreply.github.com>
@sephynox
sephynox marked this pull request as ready for review September 21, 2026 21:38
@sonarqubecloud

Copy link
Copy Markdown

@sephynox
sephynox added this pull request to stack #51 September 21, 2026 23:07
@sephynox
sephynox merged commit 521d714 into main Sep 21, 2026
9 checks 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.

3 participants