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

Allow bootstrap to pick up existing Hex cache and deps #982

Merged
merged 1 commit into from
Jan 6, 2016

Conversation

gleber
Copy link
Contributor

@gleber gleber commented Dec 15, 2015

This allows rebar to pick up existing assets, if present:

  • hex registry from .cache/rebar3/hex/default/registry
  • built deps from _build/default/lib/*

@tsloughter, does this approach look good?

Rationale: this allows to build rebar3 in a build system, which requires it to be hermetic. This is the case for Debian (they are working on making their builds reproducible) and for Nix. I am working on Nix packaging for Erlang using rebar3 and hex.pm here:
NixOS/nixpkgs#11651

Currently I have to apply the following patch to make it hermetic:
https://github.com/gleber/nixpkgs/blob/add-erlang-modules/pkgs/development/tools/build-managers/rebar3/hermetic-bootstrap.patch

And in the build rules I am manually providing plugins to build process:
https://github.com/NixOS/nixpkgs/pull/11651/files#diff-177ea02978ffc72f964033695c5e023eR93

and provide a snapshot of registry:
https://github.com/NixOS/nixpkgs/pull/11651/files#diff-177ea02978ffc72f964033695c5e023eR9

@tsloughter
Copy link
Collaborator

Hm, not positive about this. I was hoping that it would simply use the available registry and _build if it existed instead of requiring an argument that tells it to assume that they do.

@gleber
Copy link
Contributor Author

gleber commented Dec 19, 2015

Sounds good. I'll rework it the way you described.

This detects existence of Hex registry at
$HOME/.cache/rebar3/hex/default/registry and skips "rebar3 update" step.
It also detect presence of bootstrap dependencies in _build/default/lib/
and skips fetching them.
@gleber gleber changed the title Add --hermetic switch to bootstrap Allow bootstrap to pick up existing Hex cache and deps Jan 3, 2016
@gleber
Copy link
Contributor Author

gleber commented Jan 3, 2016

@tsloughter Tristan, I've reworked this PR to "do the right thing automatically". It looks a bit too simple... Am I missing anything? I am not 100% sure if profiles mechanism can badly interact with this patch.

@tsloughter
Copy link
Collaborator

Cool +1. @ferd you ok with this?

ferd added a commit that referenced this pull request Jan 6, 2016
Allow bootstrap to pick up existing Hex cache and deps
@ferd ferd merged commit 46b4b05 into erlang:master Jan 6, 2016
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