From 5bc6d95d6b6f1613cb4ef3067e471512c3b0e839 Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Wed, 11 Sep 2019 10:06:12 -0700 Subject: [PATCH 1/2] Run makecorever.py before specific prebuild hooks. When a sketch needs information that is in `core_version.h`, you have to build a dummy sketch 1st to get `core_version.h` created. Since `core_version.h` is created after the sketch is compiled. Moved rebuild recipe hook for running `makecorever.py` core to run before all _specific_ prebuild hooks. While this form of prebuild hook is not explicitly listed, it seems like an intuitive expectation. Recipie hooks of this form: ``` recipe.hooks.prebuild.NUMBER.pattern=... ``` build before recipies of this form: ``` recipe.hooks.SPECIFIC.prebuild.NUMBER.pattern=... ``` where `SPECIFIC` would be: sketch, libraries, core, linking, ... --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index e11d4c3fe2..8c3c31e429 100644 --- a/platform.txt +++ b/platform.txt @@ -85,7 +85,7 @@ compiler.elf2hex.extra_flags= ## generate file with git version number ## needs git recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" -recipe.hooks.core.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" +recipe.hooks.prebuild.10.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" From 900305b26a7a0a94c2a2f55da3bb4dd0e4673b33 Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Thu, 12 Sep 2019 14:38:31 -0700 Subject: [PATCH 2/2] Added hack comment to platform.txt. --- platform.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/platform.txt b/platform.txt index 8c3c31e429..25c14c97e8 100644 --- a/platform.txt +++ b/platform.txt @@ -85,6 +85,7 @@ compiler.elf2hex.extra_flags= ## generate file with git version number ## needs git recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" +# This is quite a working hack. This form of prebuild hook, while intuitive, is not explicitly documented. recipe.hooks.prebuild.10.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file