zDev - Tycho - OSS
  1. zDev - Tycho - OSS
  2. TYCHO-400

Compilation fails due to missing indirectly referenced class files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: None
    • Labels:
      None
    • Global Rank:
      13088

      Description

      Consider the following three bundles and their dependencies: A requires B requires C. Note that A does not require C and thus won't have access to any of C's classes at runtime. As of Tycho 0.8.0, A's compile path does not include C. This results in "type cannot be resolved. It is indirectly referenced from required .class files" compilation errors for some class hierarchies.

      Although this goes beyond my level of understanding of OSGi and JDT, I believe solution here is to add C to compile classpath with "?*/" access rule (exclude all, but keep looking).

      Workaround is to add direct A required C dependency.

        Activity

        Hide
        Igor Fedorenko added a comment -

        Attached sample application.

        Show
        Igor Fedorenko added a comment - Attached sample application.
        Hide
        Igor Fedorenko added a comment -

        Just confirmed that PDE/Build includes indirect dependencies with ?*/ access rule. Here are relevant snippets

        		<path id="@dot.classpath">
        			<pathelement path="../B/bin/"/>
        			<pathelement path="../B/@dot"/>
        			<pathelement path="../C/bin/"/>
        			<pathelement path="../C/@dot"/>
        		</path>
        

        and corresponding classpath access rules

        #ADAPTER#ACCESS#B/bin/[+b/*:?**/*]
        #ADAPTER#ACCESS#B/@dot[+b/*:?**/*]
        #ADAPTER#ACCESS#C/bin/[?**/*]
        #ADAPTER#ACCESS#C/@dot[?**/*]
        

        Funny thing is, the code does not seem to compile inside PDE/IDE but apparently compiles in PDE/Build. Go figure...

        Show
        Igor Fedorenko added a comment - Just confirmed that PDE/Build includes indirect dependencies with ?* / access rule. Here are relevant snippets <path id= "@dot.classpath" > <pathelement path= "../B/bin/" /> <pathelement path= "../B/@dot" /> <pathelement path= "../C/bin/" /> <pathelement path= "../C/@dot" /> </path> and corresponding classpath access rules #ADAPTER#ACCESS#B/bin/[+b/*:?**/*] #ADAPTER#ACCESS#B/@dot[+b/*:?**/*] #ADAPTER#ACCESS#C/bin/[?**/*] #ADAPTER#ACCESS#C/@dot[?**/*] Funny thing is, the code does not seem to compile inside PDE/IDE but apparently compiles in PDE/Build. Go figure...
        Show
        Igor Fedorenko added a comment - https://bugs.eclipse.org/bugs/show_bug.cgi?id=73957
        Hide
        Alberto Diaz added a comment -

        Any update on this one? Seems like a pretty big issue, almost half of my projects fail because of TYCHO-400... Is there hope to see it fixed for 0.10?

        Show
        Alberto Diaz added a comment - Any update on this one? Seems like a pretty big issue, almost half of my projects fail because of TYCHO-400 ... Is there hope to see it fixed for 0.10?
        Show
        Igor Fedorenko added a comment - fixed. http://github.com/sonatype/sonatype-tycho/commit/c537d903405142c2c6b7bf470590e69c15ae8b63

          People

          • Assignee:
            Igor Fedorenko
            Reporter:
            Igor Fedorenko
            Last Updated By:
            Brian Fox
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response: