Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8059135

New Nasgen dependencies to Nashorn breaks the JDK 9 build - bootstrapping problem?

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: infrastructure
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b34

      Backports

        Description

        Hi.

        Today I checked in JDK-8025435, which introduced a dependency between Nasgen and Nashorn: an import of jdk.nashorn.internal.codegen.annotations.SpecializedFunction.LinkLogic, which is a new public class. It previously imports jdk.nashorn.internal.codegen.annotations.SpecializedFunction; with no problem at all, so I thought everything would be fine, forgetting to do a full JDK 9 rebuild just after introducing this new class.

        However the JDK 9 build breaks with Nasgen not being able to find this class:


        Compiling 111 files for BUILD_NASGEN
        /Users/danielfuchs/workspaces/jdk/jdk9-dev-2/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:88: error: cannot find symbol
        import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
                                                                          ^
         symbol: class LinkLogic
         location: @interface SpecializedFunction
        /Users/danielfuchs/workspaces/jdk/jdk9-dev-2/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java:41: error: cannot find symbol
        import jdk.nashorn.internal.objects.annotations.SpecializedFunction.LinkLogic;
                                                                          ^
         symbol: class LinkLogic
         location: @interface SpecializedFunction
        /Users/danielfuchs/workspaces/jdk/jdk9-dev-2/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MethodGenerator.java:101: error: cannot find symbol
           static final Type EMPTY_LINK_LOGIC_TYPE = Type.getType(LinkLogic.getEmptyLinkLogicClass());
                                                                  ^
         symbol: variable LinkLogic
         location: class MethodGenerator
        /Users/danielfuchs/workspaces/jdk/jdk9-dev-2/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java:59: error: cannot find symbol
           static final String LINK_LOGIC_DESC = Type.getDescriptor(LinkLogic.class);
                                                                            ^
         symbol: class LinkLogic
         location: class ScriptClassInfo
        4 errors
        make[3]: *** [/Users/danielfuchs/workspaces/jdk/jdk9-dev-2/build/macosx-x86_64-normal-server-release/nashorn/nasgen_classes/_the.BUILD_NASGEN_batch] Error 1
        make[2]: *** [jdk.scripting.nashorn-java] Error 2

        My conclusion is that Nasgen imports its classes from some older bootstrapping version of nashorn.jar, and not using the one in the JDK. This is a build problem.

        I've patched this temporarily by substituting the classes with their string descriptors in JDK-8059132, but I would prefer a real fix to this.

        Regards
        Marcus

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  erikj Erik Joelsson
                  Reporter:
                  lagergren Marcus Lagergren
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: