From 26b45ecfae8c15f242a9b29abec5a49b9045f97e Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 2 Apr 2024 18:08:56 -0400 Subject: Move system.{arch,platform} template registrations into delivery_init_platform() --- src/deliverable.c | 6 ++++++ src/main.c | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/deliverable.c b/src/deliverable.c index bd2634d..cb3487a 100644 --- a/src/deliverable.c +++ b/src/deliverable.c @@ -324,6 +324,12 @@ int delivery_init_platform(struct Delivery *ctx) { setenv("OMC_CONDA_PLATFORM", ctx->system.platform[DELIVERY_PLATFORM_CONDA_INSTALLER], 1); setenv("OMC_CONDA_PLATFORM_SUBDIR", ctx->system.platform[DELIVERY_PLATFORM_CONDA_SUBDIR], 1); + // Register template variables + // These were moved out of main() because we can't take the address of system.platform[x] + // _before_ the array has been initialized. + tpl_register("system.arch", &ctx->system.arch); + tpl_register("system.platform", &ctx->system.platform[DELIVERY_PLATFORM_RELEASE]); + return 0; } diff --git a/src/main.c b/src/main.c index 8cd678f..398ac46 100644 --- a/src/main.c +++ b/src/main.c @@ -252,8 +252,6 @@ int main(int argc, char *argv[]) { tpl_register("conda.installer_version", &ctx.conda.installer_version); tpl_register("conda.installer_arch", &ctx.conda.installer_arch); tpl_register("conda.installer_platform", &ctx.conda.installer_platform); - tpl_register("system.arch", &ctx.system.arch); - tpl_register("system.platform", &ctx.system.platform[DELIVERY_PLATFORM_RELEASE]); tpl_register("deploy.jfrog.repo", &globals.jfrog.repo); tpl_register("deploy.docker.registry", &ctx.deploy.docker.registry); tpl_register("workaround.tox_posargs", &globals.workaround.tox_posargs); -- cgit