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

Only support reproducible output by default #75

Open
epage opened this issue Feb 22, 2022 · 5 comments
Open

Only support reproducible output by default #75

epage opened this issue Feb 22, 2022 · 5 comments

Comments

@epage
Copy link
Contributor

epage commented Feb 22, 2022

Reproducible builds is a strong area of interest for people but shadow is generated code that is inherently not reproducible and relies on people only calling a subset of calls and the compiler optimizing the rest away.

Time-derive data is an a clear case of this. git-derived data is more debatable.

@baoyachi
Copy link
Owner

baoyachi commented Feb 22, 2022

Yeah, Do you have any suggestions to shadow-rs. @epage

@epage
Copy link
Contributor Author

epage commented Feb 22, 2022

One thought

  • Rename the git2 feature to git
  • Make git non-default
  • Split out a time feature (non-default)
  • Use document_features to document all of this (including the warnings about reproducibility) in rustdoc

@epage
Copy link
Contributor Author

epage commented Feb 22, 2022

The main issue I see with this is documenting the API.

What if shadow exposed its functionality as a trait (even if it just wraps non-trait functions)? That way the API is browsable like normal even though it is generated.

@baoyachi
Copy link
Owner

baoyachi commented Feb 22, 2022

Wow, About what you mentioned above,I look forward to you very much. @epage

@epage
Copy link
Contributor Author

epage commented Feb 22, 2022

As I'm considering this and #69, I'd propose the API change to

  • mod per type of source (git, time, rust, etc)
    • public functions / macros exposing accessors
    • a struct implementing a Source trait
      • Function to provide all of the ShadowConst / ConstVals
      • Accepts a env trait so we can have an implementation that records all functions used (so we report only them, rather than all envs, like build-env does)

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

2 participants