Skip to content

Add support for "build hooks (since IDE 1.6.5)" #927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jantje opened this issue Feb 26, 2018 · 5 comments
Closed

Add support for "build hooks (since IDE 1.6.5)" #927

jantje opened this issue Feb 26, 2018 · 5 comments
Assignees
Labels
domain: build The build does not work as the Arduino IDE. importance: board specific OS: all status: known limitation This is soimething we can live with status: workaround documented A workaround has been confirmed to solve this issue.

Comments

@jantje
Copy link
Member

jantje commented Feb 26, 2018

The arduino hardware specification https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification specifies Pre and post build hooks (since IDE 1.6.5)
recipe.hooks.sketch.prebuild.NUMBER.pattern (called before sketch compilation) is used by nucleo making the build fail

@jantje
Copy link
Member Author

jantje commented May 19, 2018

Workaround:
Use the latest nightly and add ${A.RECIPE.HOOKS.PREBUILD.1.PATTERN} to the project properties->C/C++ build->settings->build steps->pre-build steps
post build steps can be added in the post-build steps on the same page.
If there are multiple steps you can add them with ; as separator

@jantje jantje added the status: workaround documented A workaround has been confirmed to solve this issue. label May 19, 2018
@Rabe0x
Copy link

Rabe0x commented May 29, 2018

the issue comes form picking "v1.4 Compile from source" at project properties -> Arduino -> lwIP Variant. I've chanced it to "v2 low memory" and the error was gone.
(see picture below)
issur

@jantje
Copy link
Member Author

jantje commented May 29, 2018

There are more boards/options that have this issue. Problem is that make is not meant to insert actions like this.
I really need a think/research about this one

@jantje
Copy link
Member Author

jantje commented Jun 5, 2018

If the workaround as proposed in #984 really works that may be a good solution for most of the arduino hooks:

recipe.hooks.sketch.prebuild.NUMBER.pattern (called before sketch compilation)
recipe.hooks.sketch.postbuild.NUMBER.pattern (called after sketch compilation)
recipe.hooks.libraries.prebuild.NUMBER.pattern (called before libraries compilation)
recipe.hooks.libraries.postbuild.NUMBER.pattern (called after libraries compilation)
recipe.hooks.core.prebuild.NUMBER.pattern (called before core compilation)
recipe.hooks.core.postbuild.NUMBER.pattern (called after core compilation)
recipe.hooks.linking.prelink.NUMBER.pattern (called before linking)
recipe.hooks.linking.postlink.NUMBER.pattern (called after linking)
recipe.hooks.objcopy.preobjcopy.NUMBER.pattern (called before objcopy recipes execution)
recipe.hooks.objcopy.postobjcopy.NUMBER.pattern (called after objcopy recipes execution)
recipe.hooks.savehex.presavehex.NUMBER.pattern (called before savehex recipe execution)
recipe.hooks.savehex.postsavehex.NUMBER.pattern (called after savehex recipe execution)

For following hooks I see no real solution with the #984 workaround:

recipe.hooks.sketch.prebuild.NUMBER.pattern (called before sketch compilation)
recipe.hooks.sketch.postbuild.NUMBER.pattern (called after sketch compilation)
recipe.hooks.libraries.prebuild.NUMBER.pattern (called before libraries compilation)
recipe.hooks.libraries.postbuild.NUMBER.pattern (called after libraries compilation)
recipe.hooks.core.prebuild.NUMBER.pattern (called before core compilation)
recipe.hooks.core.postbuild.NUMBER.pattern (called after core compilation)

But the following can be fixed with the pre build cdt options because sloeber.ino.cpp is the very first file compiled

recipe.hooks.sketch.prebuild.NUMBER.pattern (called before sketch compilation)

The problem with the libraries and core hooks is that it assumes a order of compilation of the source files. CDT and make (and thus Sloeber) do not do this.

@jantje jantje changed the title Add support for "Pre and post build hooks (since IDE 1.6.5)" Add support for "build hooks (since IDE 1.6.5)" Jun 5, 2018
jantje pushed a commit that referenced this issue Jun 14, 2018
added support for pre_link post_link and pre_build though pre_build is
not documented :-(
@jantje jantje added status: known limitation This is soimething we can live with and removed importance: improvement request labels Sep 28, 2018
@jantje
Copy link
Member Author

jantje commented Sep 28, 2018

Somebuild hooks have been implemented now.
The remaining ones are simply not easy to implement in a make file.
So I'm labelling this as a known issue and close it as probably no work will be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: build The build does not work as the Arduino IDE. importance: board specific OS: all status: known limitation This is soimething we can live with status: workaround documented A workaround has been confirmed to solve this issue.
Projects
None yet
Development

No branches or pull requests

2 participants