AcademySoftwareFoundation / AcademySoftwareFoundation/rez

deprecate hashed_variants pkg attrib in favor of variant_type

Open
#828 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1.1k
Forks
374
Avg merge
9d 12h
Merged PRs (30d)
5

Description

We currently have two different types of variants - standard (where variant requires are in install path), and hashed (where variant subdir is a hash of the variant requires).

On reflection I think we can move to a new type, one that is superior to hashed. In this new type, variants are stored into subdirs such as 'a', 'b',... 'z, and "shortlinks" don't exist at all. This change means that the location of a variant installation is no longer deterministic, however I don't think that matters. The variant root is only needed after the solve, and at that point we can just searched through all variant subdirs and check the variant.json file until we find the matching variant. Also, with this new type, variant.index would become the hash, rather than a zero-based index as it is currently (and even in hash variants, this should have been changed, but I didn't get that far).

To prepare for this new variant type, the hashed_variants package attrib should be deprecated in favor of variant_type="hashed". To keep backwards compatibility, existing installed packages will do automatic conversion, whereas a 'developer' package (one getting built) would reject the old attrib and would only accept variant_type.

Contributor guide

Open the contributing guide

Research direction

Trace how package attributes are parsed for installed packages and developer packages, then follow the existing hashed_variants handling. Confirm the compatibility boundary: installed packages should convert the old attribute automatically, while developer packages should reject it and accept variant_type="hashed". Done means the deprecated attribute behavior is covered without changing the proposed future variant layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.