-
Notifications
You must be signed in to change notification settings - Fork 33
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
[#136] Bump default tarball_max_size from 8 MiB to 16 MiB #137
[#136] Bump default tarball_max_size from 8 MiB to 16 MiB #137
Conversation
Thank you for the PR. This change will up the limit of package tarballs too which I'm not opposed to in general but I'd wait for a concrete use case. If all you need is bigger docs tarball size, I'd rather focus on that. Changing rebar3_hex is the way to go. In the meantime you can manually publish the docs using this elixir script: Mix.install([:req])
path = "docs.tar.gz"
{_, 0} = System.cmd("rebar3", ~w(ex_doc), into: IO.stream())
{_, 0} = System.cmd("tar", ~w(-czf #{path} --cd doc .), into: IO.stream())
tarball = File.read!(path)
File.rm_rf!(path)
# $ mix hex.user key generate --permission api:write
token = "..."
package = "hex_core"
version = "0.9.0"
Req.post!("https://hex.pm/api/packages/#{package}/releases/#{version}/docs",
body: tarball,
headers: [authorization: token]
)
|> dbg() It's not a fantastic solution but hopefully it unblocks you in the meantime? |
@wojtekmach What's the limit for doc tarballs on the server side? I believe saw 10MB, can you confirm that is correct? |
@wojtekmach I can try out the Elixir script you posted later, thanks for that <3 I'd still argue for upping the limit as I'm fairly sure Is there any chance you can re-consider? :-) Otherwise I'll push for the change in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still argue for upping the limit as I'm fairly sure aws_erlang will breach the 8MiB limit fairly soon-ish. It currently sits at around 6.8 MiB
oh, ok, thanks for letting us know!
@starbelly yes at the moment hexpm only allows request bodies with ~10mb. |
@wojtekmach What would be required to have this merged? 😄 Is there anything I can do? 🙂 |
src/hex_erl_tar.erl
Outdated
@@ -84,6 +84,8 @@ format_error({invalid_gnu_0_1_sparsemap, Format}) -> | |||
lists:flatten(io_lib:format("Invalid GNU sparse map (version ~s)", [Format])); | |||
format_error(unsafe_path) -> | |||
"The path points above the current working directory"; | |||
format_error(too_big) -> | |||
"The tar exceeds tarball_max_size or tarball_max_uncompressed_size"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right place for this error since it's error is raised in hex_erl_tarball
.
This file is vendored from Erlang's erl_tar
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error should be handled inside rebar3_hex, but I see a gotcha with it, I'll do a fixup there, the error there would look like :
===> Error building package : package exceeds max compressed size 8.388608 MB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert the error from this PR 👍
hex.pm has been updated to allow docs tarballs up to 16MiB size. |
f6e9ed6
to
6650869
Compare
@ericmj To unblock @onno-vos-dev should I just precede with cutting a version of rebar3_hex passing in the new size for docs tarball? |
Closing in favor of #143. Thanks for the PR @onno-vos-dev! |
I opted for the 2nd option as per described in the issue as it's the quickest and easiest to resolve my issue and allow me to publish docs again. I'll open a separate issue on
rebar3_hex
to discuss the option of moving tocreate_docs/2
.