Patches: template arch-derived paths in auto-generated base patch#820
Merged
Conversation
f1b6227 to
74f934b
Compare
098c882 to
d87ba87
Compare
d87ba87 to
388e2b4
Compare
7250a13 to
7a740a6
Compare
Use the new Jinja templating in auto-generated config patches so
architecture-dependent values are resolved from core.arch at load time instead
of being compiled into the generated YAML.
- Expose two arch-derived template variables, {{ arch_dir }} (generic static
subdir, e.g. intel64 -> x86_64) and {{ dylib_dir }} (prebuilt-dylib subdir,
e.g. aarch64 -> arm64), in templating.build_context, derived from the file's
core.arch (lazy/guarded imports so schema-gen contexts are unaffected).
- Add arch.get_dylib_subdir() as the single source of truth for the dylib
mapping; BasePatch.set_arch_info now uses it instead of an inline copy.
- BasePatch.generate emits {{ dylib_dir }} / {{ arch_dir }} in the /igloo/dylibs
and /igloo/utils host paths instead of baking the subdir in. core.arch and
core.kernel stay concrete (they are the source values).
- Tests for the derived vars, mapping parity, in-patch resolution, and that the
generator emits the placeholders. Docs updated.
99b376e to
da51102
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third PR in the config-reshape series. Targets
config-reshape-core(#818) — it builds on that branch's Jinja templating. Independent of the plugin PR (#819); they're siblings on #818.Puts the new templating to work in Penguin's auto-generated patches so architecture-dependent values are resolved from
core.archat load time instead of being compiled into the generated YAML. This directly addresses the original gripe that changing arch didn't update arch-derived values baked into patches.What changes
templating.build_context, derived from the file'score.arch:{{ arch_dir }}— generic static subdir (e.g.intel64→x86_64,powerpc64le→powerpc64){{ dylib_dir }}— prebuilt-dylib subdir (e.g.aarch64→arm64,powerpc64le→ppc64el)arch.get_dylib_subdir()is now the single source of truth for the dylib mapping;BasePatch.set_arch_infouses it instead of an inline copy (verified equivalent for every schema-supported arch).BasePatch.generateemits{{ dylib_dir }}/{{ arch_dir }}in the/igloo/dylibs/*and/igloo/utils/*host paths instead of baking the subdir in. The generatedbase.yamldefinescore.arch, so these resolve whenload_configrenders the patch.core.archandcore.kerneldeliberately stay concrete — they're the source values (templating them would be circular). Serial-device major/minor (conditional ints) and kernel-module version paths (padded-version mismatch with{{ kernel_version }}) are intentionally left baked; noted for a possible follow-up.Testing
tests/unit_tests/test_config.py: +10 tests (32 total, all passing on host) — derived-var values across 7 arches,get_dylib_subdirparity, in-patch resolution, and an assertion that the generator emits the placeholders.load_config(a patch that definescore.archand uses the derived vars) resolves to/igloo_static/dylibs/arm64/*and/igloo_static/aarch64/*as expected.