Meshery: [CI] Skip make targets if already invoked once

Created on 8 May 2020  路  8Comments  路  Source: layer5io/meshery

Current Behavior
All makefile targets are run every time a top level make target is invoked. This can slow down the build process significantly and lead to issues in non-idempotent make target actions.

Desired Behavior

To skip prerun targets, that do not need to be run again, each target step should drop a turd (dummy artifact) or a real artifact. If the artifact exists, we can safely skip the step and continue onwards to other targets.


Resources
https://stackoverflow.com/questions/21745816/makefile-make-dependency-only-if-file-doesnt-exist

Alternatives / Additional Context
I am sure there are other ways to achieve the same goals but since my Makefile-fu is weak I cannot find a better way to do it.

CC @kanishkarj

issuwillfix kinenhancement

Most helpful comment

According to @kanishkarj there are a lot of targets that are rerun everytime you call a target with other dependencies. Since I am not to privy with the structure yet, I assumed that some dependencies being rebuilt can slow down the process.

All 8 comments

Thanks for opening this issue. A contributor will be by to give feedback soon. In the meantime, please review the Layer5 Contributors' Welcome Guide and sure to join the community Slack.

Hi @nitishm @kanishkarj , I don't get the issue. If you are saying to skip make command if dependency is already set-up then it is obsolete, as both npm & go-modules checks the manifest of the dependencies before actually fetching them.

According to @kanishkarj there are a lot of targets that are rerun everytime you call a target with other dependencies. Since I am not to privy with the structure yet, I assumed that some dependencies being rebuilt can slow down the process.

Also see - 10.4 Chains of Implicit Rules in https://www.gnu.org/software/make/manual/make.html#Chained-Rules

@leecalcote Suggestions here?

Also see - 10.4 Chains of Implicit Rules in https://www.gnu.org/software/make/manual/make.html#Chained-Rules

I still don't get it, only recurring make command is go mod tidy which is efficient not fetch deps everytime it's run and same for npm engine ?

Thanks for this, @nitishm! Whether its a reduction of duplicative command executions or a considerate organization of current command groups and their names, our Makefiles need some love.

Do we want this instead ?
https://stackoverflow.com/questions/31492675/node-build-from-makefile-only-if-source-changed

In this way what we'd have is if ran make run-local, we'll actually build only if the source files have been changed, if not we used the built version. It would be really helpful in the case of building ui too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leecalcote picture leecalcote  路  3Comments

leecalcote picture leecalcote  路  3Comments

leecalcote picture leecalcote  路  4Comments

chandrashritii picture chandrashritii  路  3Comments

navendu-pottekkat picture navendu-pottekkat  路  4Comments