Skip to content

Conversation

@yakir12
Copy link
Contributor

@yakir12 yakir12 commented Nov 28, 2025

Hi @GunnarFarneback ,
Is this what you meant in #143239 ?

@GunnarFarneback
Copy link
Contributor

Yes. (Can't say whether it's exactly correct. Compress.load and Compress.save from RegistryTools are relevant tools.)

@yakir12
Copy link
Contributor Author

yakir12 commented Nov 29, 2025

Yes.

Great! Thank you for helping me out here.

Can't say whether it's exactly correct.

Is there any way I can check that? I guess it would be great if I could auto generate the correct Compat.toml file for all combinations of CameraCalibrations versions and Julia versions (within the context of "are the tests passing or not").

Compress.load and Compress.save from RegistryTools are relevant tools

I have to agree with Mosè in JuliaRegistries/RegistryTools.jl#94... I installed RegistryTools and figured out that this works:

RegistryTools.Compress.load("/home/yakir/tmp/General/C/CameraCalibrations/Compat.toml")

but I don't really know how that or RegistryTools.Compress.save could help me in this specific case. Do you mean I can use these load and save functions to figure out exactly which versions work...?

@yakir12
Copy link
Contributor Author

yakir12 commented Nov 29, 2025

This is what copilot had to say about these functions:

The Compress module in RegistryTools.jl is used to store and retrieve compressed representations of Julia package registry data. It is primarily designed to reduce disk usage and speed up operations involving registry snapshots or backups.

Here’s what the two functions do:
Compress.save(path, data)

    Purpose:
    Serializes and compresses registry-related data (e.g., registry state, version lists) and writes it to a file at path.
    Input:
        path::AbstractString: The file path where the compressed data will be saved.
        data: Typically a Julia object representing registry information (e.g., dictionaries of versions, metadata).
    Operation:
    Internally, it uses a binary serialization format combined with compression (likely CodecZlib or similar) to minimize size.
    Output:
    A compressed file that can later be loaded with Compress.load.

Compress.load(path)

    Purpose:
    Reads a previously compressed file from path, decompresses it, and deserializes the original Julia object.
    Input:
        path::AbstractString: The file path of the compressed registry snapshot.
    Operation:
    Decompresses the binary data and reconstructs the original Julia structure.
    Output:
    The original Julia object (e.g., registry metadata or version map).

Assuming this isn't too off the mark, then I'm a bit confused as to what they could be used for in this specific context.

@GunnarFarneback
Copy link
Contributor

They can't help you with getting the right bounds but they are the ground truth for reading and writing the format of Compat.toml. If your Compat.toml round trips through a Compress.load followed by Compress.save, it is likely to be correctly formatted.

@yakir12
Copy link
Contributor Author

yakir12 commented Nov 30, 2025

As a sanity check I tried the following for my package in the master branch of General, and it, of course, worked:

julia> tmp_name = "tmp_dict"
"tmp_dict"

julia> save(tmp_name, load("Compat.toml"))

julia> load(tmp_name) == load("Compat.toml")
true

and then again, on the cap-CameraCalibrations-julia branch:

julia> tmp_name = "tmp_dict"
"tmp_dict"

julia> save(tmp_name, load("Compat.toml"))

julia> load(tmp_name) == load("Compat.toml")
true

So does that mean that this Compat.toml file "is likely to be correctly formatted"...? What is the next step?

@yakir12
Copy link
Contributor Author

yakir12 commented Dec 1, 2025

To merge this PR, I'd like to confirm the following:

  • Version Bound: Does this change set an upper bound on the Julia version for my package (specifically, limiting it to Julia 1.10)?
  • Compatibility: Will this change avoid breaking anything in my package or its dependencies?
  • Best Practices: Does this approach follow the recommended guidelines for version constraints in the Julia ecosystem?

I’m unsure how to verify these points. Are there any official documentation or guidelines that explain how to handle these concerns?

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.

2 participants