Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify package source custom section #12

Open
lann opened this issue May 13, 2024 · 3 comments
Open

Specify package source custom section #12

lann opened this issue May 13, 2024 · 3 comments

Comments

@lann
Copy link
Collaborator

lann commented May 13, 2024

We should consider specifying a standard format for embedding component source code in the component itself. One obvious way to do this would be to tar (+ gzip?) the source in some language-standard way. The custom section could be named simply...source.tar or source.tgz (if gzipped)

This repo could provide a wasm-pkg-source crate to help.

@lukewagner
Copy link

That sounds potentially cool. Thinking through some use cases for this custom section:

  • Source-level debugging: for this case, we should probably consider the interactions with debug support and also the case where sources are published out-of-line at a server (like VS symbol servers)
  • Verifiable builds: in this case, maybe we also need a standard way to describe the build command and build environment, or at least an idea of where they could slot in in the future

@oovm
Copy link

oovm commented May 14, 2024

Can you define the source code in detail?

  1. Are there any requirements for encoding source code?
    • If someone wants to build a document hosting platform similar to docs.rs on the wasm platform, what conventions should be followed?
  2. Does the configuration belong to the source code? What if the source code depends on environment variables in the configuration?
  3. Do binaries belong in source code? Consider rust’s include_bytes!

@lann
Copy link
Collaborator Author

lann commented May 14, 2024

My goal here would be to define a common method for embedding "a tree of source files" in a component binary to enable the types of features mentioned above.

Specific contents would depend on the source language and desired feature. Taking the two mentioned above: "source-level debugging" would require only human-readable source text matching debug symbols, while "verifiable builds" might require much more associated build code and data (like include_bytes! binaries).

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

No branches or pull requests

3 participants