[
https://issues.apache.org/jira/browse/TRAFODION-3242?focusedWorklogId=185927&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-185927
]
ASF GitHub Bot logged work on TRAFODION-3242:
---------------------------------------------
Author: ASF GitHub Bot
Created on: 16/Jan/19 18:18
Start Date: 16/Jan/19 18:18
Worklog Time Spent: 10m
Work Description: svarnau commented on issue #1771: [TRAFODION-3242]Do
not make again before MAKE CLEAN
URL: https://github.com/apache/trafodion/pull/1771#issuecomment-454882627
Hi Kevin,
You may be right that this is a fundamental problem of mixing makefiles and
maven into single build project.
My concern with this change is that it only checks for existence of a file
rather than checking it against the dependencies to see if it needs to be
re-built. Ideally, makefiles should be written so that if none of the source
files have changed, make does not rebuild anything. But if a source file
changes, then the right things do get re-built without needing to do make
clean.
Right now, we have the problem of way too much re-building that does not
need to be done. With your change, we have less of that problem, but the
developer needs to know what to remove/clean if they do need to re-build
something. That may be a better problem to have. It just goes against the
ideal makefile methods.
Example:
Trafci_jar:
mvn clean install -DskipTests
This rule always runs becuase "Trafci_jar" is not a real file, instead make
is asking maven to make sure it is up to date, but maven is told not to trust
existing objects by doing clean first. (Ugh). You are changing this to:
Trafci_jar:
@if [ ! -f target/trafciInstaller.jar ] ; then \
mvn install -DskipTests ; \
fi
Which is not running maven at all regardless of dependencies if the jar
exists. The simpler way to write that rule is:
target/trafci.jar:
mvn install -DskipTests
(Replacing all references of "Trafci_jar" in the makefile with the full jar
file name.) Even better would be something like this:
target/trafci.jar: src/main/java/org/trafodion/ci/*
mvn install -DskipTests
Which would cause a rebuild if any sources in that directory changed. Other
dependencies may also be needed, and nice to have. But at least use the
simpler makefile syntax instead of shell script in the rule.
In this particular case, the rules are even more complicated because there
are two different pom files in the same directory that probably interfere with
each other. So fixing this is not easy.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 185927)
Time Spent: 3h (was: 2h 50m)
> Do 'make all' several times, mvn will be running every time wasting time
> ------------------------------------------------------------------------
>
> Key: TRAFODION-3242
> URL: https://issues.apache.org/jira/browse/TRAFODION-3242
> Project: Apache Trafodion
> Issue Type: Bug
> Components: Build Infrastructure
> Reporter: Kevin Xu
> Priority: Major
> Time Spent: 3h
> Remaining Estimate: 0h
>
> It seems like 3 times i did for 'make all' and every time mvn will do the
> build again. Actually, the java files haven't been changed. And the errors
> has nothing about maven project. Then I think if this module has already been
> built, it should not be built again before 'make clean'.
> make all
> make all
> make all
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)