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

Artifacts: Add download size to Artifacts.toml #4171

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

staticfloat
Copy link
Member

This shows one possible way of adding an optional download size value to an artifact binding. While this value is not used anywhere yet, it could be used to create warnings when downloading large artifacts, or to feed progress meters when the server does not provide content size headers.

@nhz2
Copy link
Contributor

nhz2 commented Mar 4, 2025

I made JuliaPackaging/ArtifactUtils.jl#25 to try this out.

@KristofferC
Copy link
Member

feed progress meters when the server does not provide content size headers.

How common is this? Is there any concrete case of this happening right now?

@nhz2
Copy link
Contributor

nhz2 commented Mar 4, 2025

Very important bikeshedding question: should the "size" field be in hex or base 10?

For example: size = 0xd38b3c vs size = 13863740.

@staticfloat
Copy link
Member Author

We don't put anything else in hex, I think we should just stick with the most human-readable format.

"sha256" => bytes2hex(adi.hash),
)
if adi.size > 0
ret["size"] = adi.size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ret["size"] = adi.size
ret["size"] = Int64(adi.size)

Converting UInt64 to Int64 here prevents TOML.jl from writing the number in hex.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darn, I was hoping it would just call string(x), but I guess not. I'll just make everything an Int64 then.

This shows one possible way of adding an optional download size value to
an artifact binding.  While this value is not used anywhere yet, it
could be used to create warnings when downloading large artifacts, or to
feed progress meters when the server does not provide content size
headers.
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