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

ETags should be stored in rebar_pkg_resource #1743

Closed
tothlac opened this issue Apr 10, 2018 · 4 comments
Closed

ETags should be stored in rebar_pkg_resource #1743

tothlac opened this issue Apr 10, 2018 · 4 comments

Comments

@tothlac
Copy link
Contributor

tothlac commented Apr 10, 2018

Currently ETags are calculated from the pkg file stored locally, which is wrong.

As mentioned by @ericmj in previous issue: #1741, the ETags
sent back from the hex server should be stored together with the downloaded pkg files.

A possible solution is to store etags in a .eterm file in ~/.cache/rebar3/hex/default/packages/pkg_etags.eterm in proplist format.

What do you think about this solution?

@ferd
Copy link
Collaborator

ferd commented Apr 10, 2018

It should be cheaper to run than the current thing, even though the bottleneck will remain the hash check. I don't have much of a problem with caching the etag, though I would probably store them as file pairs rather than one big etag file + 50 packages. I.e. package-vsn.tgz + package-vsn.etag ?

tothlac pushed a commit to tothlac/rebar3 that referenced this issue Apr 10, 2018
@tothlac
Copy link
Contributor Author

tothlac commented Apr 10, 2018

I have created this PR:
#1745

tothlac pushed a commit to tothlac/rebar3 that referenced this issue Apr 11, 2018
tothlac pushed a commit to tothlac/rebar3 that referenced this issue Apr 11, 2018
tothlac pushed a commit to tothlac/rebar3 that referenced this issue Apr 11, 2018
@tothlac
Copy link
Contributor Author

tothlac commented Apr 11, 2018

The return values in rebar_pkg_resource were a bit confusing for me, so I have created an other pull request containing some type specs for the module: https://github.com/erlang/rebar3/pull/1746/commits

tothlac pushed a commit to tothlac/rebar3 that referenced this issue Apr 12, 2018
@ferd
Copy link
Collaborator

ferd commented Apr 20, 2018

All merged.

@ferd ferd closed this as completed Apr 20, 2018
uwiger pushed a commit to aeternity/rebar3 that referenced this issue Nov 27, 2018
uwiger pushed a commit to aeternity/rebar3 that referenced this issue Nov 27, 2018
uwiger pushed a commit to aeternity/rebar3 that referenced this issue Nov 27, 2018
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