Simplify mapping of target properties - #755
Conversation
|
CI fails with:
This needs to be checked by a reviewer, not by the author, correct? |
libs.json declares objects with sets of properties for each supported target. Most of them repeat information, since most properties depend on a single value. For example, 'obj_name' only depends on 'system', and doesn't need to be repeated for each target. The same is true of most other properties. Adding new targets requires repeating all the information for each one. Simplify this logic by resolving properties individually. This change implicitly adds support for building on numerous new targets, including musl-loongarch64, musl-armhf, musl-i686, etc. Supporting additional targets becomes trivial, since only the new variables need to be declared.
|
v2: added armhf/armv8l |
|
The flattened structure is intended. It is redundant at first sight, but that's also the benefit itself, we don't need to worry about breaking other things when editing one of them. |
|
The philosophy behind the redundancy is the rule of three. |
|
I'm not sure I see what you mean. What could break with my proposed design?
Without this change, support for musl would require septuplicating all the definitions. Considering that this is data rather than code, I'd consider normalisation the rule which applies here: in particular, this change aligns closer with Second/Third normal form. |
|
See #763 as an approach extending musl support with the current design. |
|
FWIW, we're including this patch downstream on Alpine to build packages for ppc64le and s390x are excluded for now since libcurl-impersonate lacks support |
libs.json declares objects with sets of properties for each supported target. Most of them repeat information, since most properties depend on a single value.
For example, 'obj_name' only depends on 'system', and doesn't need to be repeated for each target. The same is true of most other properties.
Adding new targets requires repeating all the information for each one.
Simplify this logic by resolving properties individually. This change implicitly adds support for building on numerous new targets, including musl-loongarch64, musl-armhf, musl-i686, etc. Supporting additional targets becomes trivial, since only the new variables need to be declared.
Checklist