Skip to content

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
Member

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
Member

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
Member

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.
@staticfloat staticfloat merged commit b323a38 into master Mar 25, 2025
8 of 9 checks passed
@staticfloat staticfloat deleted the sf/artifact_size branch March 25, 2025 05:51
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