feat(backend): embed resource files as static data #479
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/135-resource-embedding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #135
Commit 1 of the two-commit rule (RESOURCES.md slice 2): the compiler side of embedding.
SourceTree.resourceBytes/Workspace.readResourceread the bytes of a listed resource file.EmbeddedBytes/EmbeddedTextliteral (CheckedLiteral.content); an unreadable file or a non-UTF-8EmbeddedTextis an error at the literal, with the offset of the first bad byte.Embeddedwith the manifest rowsembeddedBytesandembeddedText(NATIVES.md rows and counts updated);ir/lower/embedded.trbgenerates their bodies, one branch per stable name, so a file is stored once however many literals name it.Deviation, recorded in RESOURCES.md section 6: the statics hold no blob yet, so the bytes of an
EmbeddedBytesare stored as Base64 text andstd/resourcewill decode them. A real blob static is a follow-up.Commit 2 (the
std/resourcedeclarations:EmbeddedBytes.bytes(),EmbeddedText.text()and conformance programs) comes after the seed refresh, which the two-commit rule needs; the loop does not do that step.CI is the compiler here: nothing of this was built locally.
071c6b27fde380a73f0564177f5b5e447f349762Checklist (head
995529b):literals.test.trbcovers both literals and path normalization to one name; the natives audit is adapted to the newEmbeddedtarget.resourceBytesonly after the existing in-package and listing checks; one entry per stable name; unreadable file and non-UTF-8EmbeddedTextare errors at the literal; the new target is rejected as operator and witness member.std/resourcedeclarations + conformance programs) follows the seed refresh, and #135 stays open until then.Non-blocking:
EmbeddedTextwith byte offset, unreadable file) and the generated bodies inir/lower/embedded.trbhave no test here (the literal test harness only holds String files, and nothing reaches the natives before commit 2). Please cover them in the commit-2 conformance programs (embedded binary that is not UTF-8, embedded text, one file named by several literals).