This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 402086 - Tycho should take into account compilerArgs specified in build.properties
Summary: Tycho should take into account compilerArgs specified in build.properties
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-01 00:45 EST by David Williams CLA
Modified: 2021-04-28 16:52 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2013-03-01 00:45:58 EST
I don't know if you've been following the saga in bug 401776 (we could have used some advice! though roughly solved, some specific cases) but for people set up for PDE builds, it would be a great step forward for Tycho (in some form) to take advantage of the the "compilerArg" property specified in build.properties. 

I hope you don't tell me it already does and we just didn't know what flag to set! 

In PDE we set some "high level" compilerArg property that applies, but individual bundles can override that, and specify their own. For PDE, one example, from how we built tests, was 

- /org.eclipse.releng.eclipsebuilder/eclipse/buildConfigs/sdk.tests/build.properties:

compilerArg=-inlineJSR -enableJavadoc -encoding ISO-8859-1 -warn:-discouraged,forbidden,warningToken

But, some bundles specify their own, very custom arguments ... especially for "code" (non-test) bundles. 

Granted, these are "compiler specific", but ... they are for PDE too. 

If implemented "auto-magically", there should likely be a check if the pom already specified, and if so, take those at face value. (perhaps with a warning they were also specified in build.properties). If none in pom, and none in build.properties, then use inherited ones, as usual. 

If it can not be done "auto-magically" perhaps this could at least be part of the "update-pom" tool? (as we currently use for version numbers). 

http://eclipse.org/tycho/sitedocs/tycho-release/tycho-versions-plugin/plugin-info.html 

Also, other than 
http://wiki.eclipse.org/Tycho/Reference_Card#Generating_POM_files
is there a central document of what parts of a bundle's manifest/properties are read/used by Tycho? I know several features/improvements have been made even recently, such as bug 400901 for bug 400589. If not, I can open another bug/feature enhancement?
Comment 1 Jan Sievers CLA 2013-03-01 02:45:21 EST
see discussion on bug 400307

I think what you want should be possible today using pom.xml configuration (including control over the way compiler args are inherited from parent pom).

in general, pom.xml configuration is more flexible than build.properties as it comes with maven's pom inheritance features out of the box.

I am reluctant to add yet another PDE build compatibility switch which will complicate things (we would have to solve questions like: where did you define compiler args - pom.xml or build.properties? what should be the precedence ?)
Comment 2 Jan Sievers CLA 2013-03-01 02:48:53 EST
(In reply to comment #0)
> Also, other than 
> http://wiki.eclipse.org/Tycho/Reference_Card#Generating_POM_files
> is there a central document of what parts of a bundle's manifest/properties
> are read/used by Tycho? I know several features/improvements have been made
> even recently, such as bug 400901 for bug 400589. If not, I can open another
> bug/feature enhancement?

no docs on that apart from sources [1]

you are right this should be documented, but that should be a separate bug.

[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-bundles/org.eclipse.tycho.core.shared/src/main/java/org/eclipse/tycho/core/facade/BuildProperties.java
Comment 3 David Williams CLA 2013-03-01 03:10:13 EST
(In reply to comment #1)
> see discussion on bug 400307
> 
> I think what you want should be possible today using pom.xml configuration
> (including control over the way compiler args are inherited from parent pom).
> 

Did I waste a day of trial and error work, because I missed this form in your document at 
http://www.eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html

<configuration>
  <compilerArgs combine.children="append">
    <arg>-err:+unusedPrivate</arg>
  </compilerArgs>
</configuration>

Oh, perhaps because its been fixed in 0.17 snapshot only, not a released version, that it is not documented. Sigh. 

(But, IMHO, I still think if you are trying to make a "CBI", Tycho should make every step of migrating easier, if not transparent).
Comment 4 Jan Sievers CLA 2013-03-01 03:29:52 EST
(In reply to comment #3)
> Did I waste a day of trial and error work, because I missed this form in
> your document at 
> http://www.eclipse.org/tycho/sitedocs/tycho-compiler-plugin/compile-mojo.html

don't hesitate to put me on cc on the bug or ask on tycho-user if you are stuck on a tycho-releated problem. 

regarding documentation:
http://wiki.eclipse.org/Tycho/Release_Notes/0.17
Comment 5 Tobias Oberlies CLA 2013-03-01 04:20:26 EST
(In reply to comment #3)
> (But, IMHO, I still think if you are trying to make a "CBI", Tycho should make
> every step of migrating easier, if not transparent).

CBI and Tycho are not the same thing. CBI is the project specific to the PDE migration, so _CBI_ should make every step of migration as easy as possible.
Tycho is a separate project with a diverse user base. In Tycho, we will always have to balance the benefit of a new feature for some user with the costs for all users. 

In this case, I agree with Jan that the added complexity does not outweigh the potential benefit of this feature.
Comment 6 Tobias Oberlies CLA 2013-03-01 04:25:44 EST
(In reply to comment #4)
> regarding documentation:
> http://wiki.eclipse.org/Tycho/Release_Notes/0.17
It might also help to publish the Mojo documentation of the current snapshot somewhere. They are here [1], but that URL is not publicly accessible. And as far as I understand opening up the Hudson workspace is not an option because then you'd be able to download build/test-only dependencies from eclipse.org...

[1] https://hudson.eclipse.org/hudson/job/tycho-sitedocs-nightly/ws/target/staging/index.html
Comment 7 Jan Sievers CLA 2013-03-01 04:33:59 EST
(In reply to comment #3)
> <configuration>
>   <compilerArgs combine.children="append">
>     <arg>-err:+unusedPrivate</arg>
>   </compilerArgs>
> </configuration>
> 
> Oh, perhaps because its been fixed in 0.17 snapshot only, not a released
> version, that it is not documented. Sigh. 


regarding pom configuration inheritance, this is a general maven feature as documented on [1,2] - nothing that tycho introduced.

[1] http://maven.apache.org/guides/mini/guide-configuring-plugins.html
[2] http://docs.codehaus.org/display/MAVENUSER/FAQs-1#FAQs-1-HowdoImergealistofconfigurationitemsinaparentPOMwiththoseinachildPOM
Comment 8 Tobias Oberlies CLA 2014-08-11 10:31:58 EDT
(In reply to comment #2)
> (In reply to comment #0)
> > Also, other than
> > http://wiki.eclipse.org/Tycho/Reference_Card#Generating_POM_files
> > is there a central document of what parts of a bundle's manifest/properties
> > are read/used by Tycho? 
> 
> you are right this should be documented, but that should be a separate bug.

FYI, the bug for documenting the supported build.properties is bug 439413, and this bug is fixed. The documentation is here:
http://www.eclipse.org/tycho/sitedocs/BuildProperties.html

About the status of this bug: There are currently zero votes for it, so this feature will probably not be added to Tycho.
Comment 9 Christoph Laeubrich CLA 2020-07-10 02:38:14 EDT
@David are you still interested in this feature?
I think in the light of pomless this can become quite handy as there is no way to specify argument directly in the pom.
Comment 10 Mickael Istria CLA 2021-04-08 18:08:31 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.