Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bad build path prevents opening files #960

Closed
scabug opened this issue May 24, 2008 · 7 comments
Closed

bad build path prevents opening files #960

scabug opened this issue May 24, 2008 · 7 comments
Assignees
Labels

Comments

@scabug
Copy link

@scabug scabug commented May 24, 2008

I just got into a state where I could not open any Scala files. I think the problem was a bad build path configuration. I don't think that a bad build path should prevent people from opening files; they should simply see type errors.

Specifically, I checked out the compiler trunk (rev 15188), and installed the current beta plugin (2.7.1.r15152-b20080522020257). I added src/compiler to my build path but not src/library. When I try to open Settings.scala, I got "class scala.unchecked not found", and then I get an editor window that has no actual editor in it. When I try to open different files, I get errors about different classes missing--scala.Predef and scala.Array come to mind. That's a scary state; it means you can't use Eclipse at all and have to break out a different editor to make any progress.

Here's one of several similar looking stack traces from my error log.

scala.tools.nsc.FatalError: class scala.unchecked not found.
at scala.tools.nsc.symtab.Definitions$$definitions$$.getModuleOrClass(Definitions.scala:346)
at scala.tools.nsc.symtab.Definitions$$definitions$$.getClass(Definitions.scala:319)
at scala.tools.nsc.symtab.Definitions$$definitions$$.UncheckedClass(Definitions.scala:141)
at scala.tools.nsc.ast.parser.TreeBuilder.makeUnchecked(TreeBuilder.scala:376)
at scala.tools.nsc.ast.parser.TreeBuilder.makePatDef(TreeBuilder.scala:411)
at scala.tools.nsc.ast.parser.Parsers$$Parser.mkDefs$$1(Parsers.scala:1953)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$patDefOrDcl$$1.apply(Parsers.scala:1974)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$patDefOrDcl$$1.apply(Parsers.scala:1974)
at scala.List.flatMap(List.scala:1120)
at scala.tools.nsc.ast.parser.Parsers$$Parser.patDefOrDcl(Parsers.scala:1974)
at scala.tools.nsc.ast.parser.Parsers$$Parser.defOrDcl(Parsers.scala:1902)
at scala.tools.nsc.ast.parser.Parsers$$Parser.localDef(Parsers.scala:2426)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$blockStatSeq$$1.apply(Parsers.scala:2450)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$blockStatSeq$$1.apply(Parsers.scala:2437)
at scala.tools.nsc.ast.parser.Parsers$$Parser.checkNoEscapingPlaceholders(Parsers.scala:170)
at scala.tools.nsc.ast.parser.Parsers$$Parser.blockStatSeq(Parsers.scala:2437)
at scala.tools.nsc.ast.parser.Parsers$$Parser.block(Parsers.scala:1242)
at scala.tools.nsc.ast.parser.Parsers$$Parser.blockExpr(Parsers.scala:1233)
at scala.tools.nsc.ast.parser.Parsers$$Parser.simpleExpr(Parsers.scala:1175)
at scala.tools.nsc.ast.parser.Parsers$$Parser.prefixExpr(Parsers.scala:1137)
at scala.tools.nsc.ast.parser.Parsers$$Parser.postfixExpr(Parsers.scala:1089)
at scala.tools.nsc.ast.parser.Parsers$$Parser.expr(Parsers.scala:1026)
at scala.tools.nsc.ast.parser.Parsers$$Parser.expr(Parsers.scala:943)
at scala.tools.nsc.ast.parser.Parsers$$Parser.expr(Parsers.scala:1005)
at scala.tools.nsc.ast.parser.Parsers$$Parser.statement(Parsers.scala:947)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$blockStatSeq$$1.apply(Parsers.scala:2447)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$blockStatSeq$$1.apply(Parsers.scala:2437)
at scala.tools.nsc.ast.parser.Parsers$$Parser.checkNoEscapingPlaceholders(Parsers.scala:170)
at scala.tools.nsc.ast.parser.Parsers$$Parser.blockStatSeq(Parsers.scala:2437)
at scala.tools.nsc.ast.parser.Parsers$$Parser.block(Parsers.scala:1242)
at scala.tools.nsc.ast.parser.Parsers$$Parser.blockExpr(Parsers.scala:1233)
at scala.tools.nsc.ast.parser.Parsers$$Parser.simpleExpr(Parsers.scala:1175)
at scala.tools.nsc.ast.parser.Parsers$$Parser.prefixExpr(Parsers.scala:1137)
at scala.tools.nsc.ast.parser.Parsers$$Parser.postfixExpr(Parsers.scala:1089)
at scala.tools.nsc.ast.parser.Parsers$$Parser.expr(Parsers.scala:1026)
at scala.tools.nsc.ast.parser.Parsers$$Parser.expr(Parsers.scala:943)
at scala.tools.nsc.ast.parser.Parsers$$Parser.equalsExpr(Parsers.scala:899)
at scala.tools.nsc.ast.parser.Parsers$$Parser.funDefOrDcl(Parsers.scala:2046)
at scala.tools.nsc.ast.parser.Parsers$$Parser.defOrDcl(Parsers.scala:1906)
at scala.tools.nsc.ast.parser.Parsers$$Parser.nonLocalDefOrDcl(Parsers.scala:1918)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$templateStatSeq$$1$$$$anonfun$$apply$$4.apply(Parsers.scala:2393)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$templateStatSeq$$1$$$$anonfun$$apply$$4.apply(Parsers.scala:2393)
at scala.tools.nsc.ast.parser.Parsers$$Parser.joinComment(Parsers.scala:379)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$templateStatSeq$$1.apply(Parsers.scala:2393)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$templateStatSeq$$1.apply(Parsers.scala:2365)
at scala.tools.nsc.ast.parser.Parsers$$Parser.checkNoEscapingPlaceholders(Parsers.scala:170)
at scala.tools.nsc.ast.parser.Parsers$$Parser.templateStatSeq(Parsers.scala:2365)
at scala.tools.nsc.ast.parser.Parsers$$Parser.templateBody(Parsers.scala:2283)
at scala.tools.nsc.ast.parser.Parsers$$Parser.templateBodyOpt(Parsers.scala:2291)
at scala.tools.nsc.ast.parser.Parsers$$Parser.templateOpt(Parsers.scala:2260)
at scala.tools.nsc.ast.parser.Parsers$$Parser.classDef(Parsers.scala:2167)
at scala.tools.nsc.ast.parser.Parsers$$Parser.tmplDef(Parsers.scala:2129)
at scala.tools.nsc.ast.parser.Parsers$$Parser.topLevelTmplDef(Parsers.scala:2116)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$topStatSeq$$1.apply(Parsers.scala:2348)
at scala.tools.nsc.ast.parser.Parsers$$Parser$$$$anonfun$$topStatSeq$$1.apply(Parsers.scala:2348)
at scala.tools.nsc.ast.parser.Parsers$$Parser.joinComment(Parsers.scala:379)
at scala.tools.nsc.ast.parser.Parsers$$Parser.topStatSeq(Parsers.scala:2348)
at scala.tools.nsc.ast.parser.Parsers$$Parser.compilationUnit(Parsers.scala:2482)
at scala.tools.nsc.ast.parser.Parsers$$Parser.parse(Parsers.scala:147)
at scala.tools.nsc.ast.parser.SyntaxAnalyzer$$ParserPhase.apply(SyntaxAnalyzer.scala:24)
at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:262)
at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
at scala.Iterator$$class.foreach(Iterator.scala:395)
at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:243)
at scala.tools.nsc.Global$$Run.compileSources(Global.scala:564)
at scala.tools.nsc.IdeSupport$$$$anonfun$$loadSource$$1.apply(IdeSupport.scala:23)
at scala.tools.nsc.IdeSupport$$$$anonfun$$loadSource$$1.apply(IdeSupport.scala:23)
at scala.tools.nsc.IdeSupport$$class.normalCompile(IdeSupport.scala:5)
at scala.tools.eclipse.ScalaPlugin$$ProjectImpl$$compiler0$$.normalCompile(ScalaPlugin.scala:131)
at scala.tools.nsc.IdeSupport$$class.loadSource(IdeSupport.scala:23)
at scala.tools.eclipse.ScalaPlugin$$ProjectImpl$$compiler0$$.scala$$tools$$editor$$TypersPresentations$$ProjectImpl$$Compiler$$$$super$$loadSource(ScalaPlugin.scala:131)
at scala.tools.editor.TypersPresentations$$ProjectImpl$$Compiler$$class.loadSource(TypersPresentations.scala:78)
at scala.tools.eclipse.ScalaPlugin$$ProjectImpl$$compiler0$$.loadSource(ScalaPlugin.scala:131)
at scala.tools.editor.TypersPresentations$$ProjectImpl$$$$anonfun$$scala$$tools$$editor$$TypersPresentations$$ProjectImpl$$$$loadSource$$1.apply(TypersPresentations.scala:139)
at scala.tools.editor.TypersPresentations$$ProjectImpl$$$$anonfun$$scala$$tools$$editor$$TypersPresentations$$ProjectImpl$$$$loadSource$$1.apply(TypersPresentations.scala:138)
at lampion.presentation.Presentations$$ProjectImpl$$class.tryLockTyper(Presentations.scala:318)
at scala.tools.eclipse.Driver$$Project.tryLockTyper(Driver.scala:16)
at scala.tools.editor.TypersPresentations$$ProjectImpl$$class.scala$$tools$$editor$$TypersPresentations$$ProjectImpl$$$$loadSource(TypersPresentations.scala:138)
at scala.tools.editor.TypersPresentations$$ProjectImpl$$FileImpl$$TokenImpl$$class.asSymbol(TypersPresentations.scala:340)
at scala.tools.editor.Driver$$ProjectImpl$$FileImpl$$Token.asSymbol(Driver.scala:31)
at scala.tools.editor.TypersPresentations$$ProjectImpl$$FileImpl$$TokenImpl$$class.style(TypersPresentations.scala:353)
at scala.tools.editor.Driver$$ProjectImpl$$FileImpl$$Token.style(Driver.scala:31)
at lampion.presentation.Presentations$$ProjectImpl$$FileImpl$$class.refreshHighlightFor(Presentations.scala:122)
at scala.tools.eclipse.Driver$$Project$$File.refreshHighlightFor(Driver.scala:19)
at lampion.eclipse.UIPlugin$$ProjectImpl$$FileImpl$$class.refresh(UIPlugin.scala:190)
at scala.tools.eclipse.Driver$$Project$$File.refresh(Driver.scala:19)
at lampion.eclipse.SourceViewer$$reconciler$$.createPresentation(SourceViewer.scala:62)
at org.eclipse.jface.text.presentation.PresentationReconciler.createPresentation(PresentationReconciler.java:453)
at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:567)
at org.eclipse.jface.text.presentation.PresentationReconciler.access$$3(PresentationReconciler.java:565)
at org.eclipse.jface.text.presentation.PresentationReconciler$$InternalListener.inputDocumentChanged(PresentationReconciler.java:119)
at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2685)
at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2734)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:518)
at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:370)
at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:473)
at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3786)
at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3332)
at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53)
at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:378)
at lampion.eclipse.Editor.createPartControl(Editor.scala:154)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:299)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:179)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:400)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1256)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1209)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1604)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:499)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:485)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:774)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:673)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:634)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2737)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$$13(WorkbenchPage.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$$10.run(WorkbenchPage.java:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2590)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2574)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2565)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:644)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:603)
at org.eclipse.ui.internal.ide.handlers.OpenResourceHandler.execute(OpenResourceHandler.java:124)
at org.eclipse.ui.internal.ide.handlers.OpenResourceHandler.run(OpenResourceHandler.java:176)
at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:271)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:475)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:429)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:165)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:470)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:821)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:879)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:568)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$$3(WorkbenchKeyboard.java:510)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:126)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1101)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1494)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1519)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1504)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1556)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1551)
at org.eclipse.swt.widgets.Control.kEventUnicodeKeyPressed(Control.java:2090)
at org.eclipse.swt.widgets.Composite.kEventUnicodeKeyPressed(Composite.java:580)
at org.eclipse.swt.widgets.Tree.kEventUnicodeKeyPressed(Tree.java:2338)
at org.eclipse.swt.widgets.Control.kEventTextInputUnicodeForKeyEvent(Control.java:2071)
at org.eclipse.swt.widgets.Widget.textInputProc(Widget.java:1925)
at org.eclipse.swt.widgets.Display.textInputProc(Display.java:3806)
at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2938)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)

I am up and running again, but it took some perseverance. A bad build path should not prevent people from opening files; they should just get type checking errors.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 24, 2008

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 24, 2008

@milessabin said:
Agreed that this shouldn't cause a stack trace and prevent people from opening files, but why did you need to change any of the configuration of the scala compiler project ... it should be just fine as it is in SVN.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 24, 2008

@lexspoon said:
Good to know. In this case, I didn't use a pre-existing project. I checked out trunk as a new Scala project.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 25, 2008

@milessabin said:
That suggests that there's a problem in the New Scala Project wizard. I'll take a loot.

Presumably the new .project and .classpath files showed up as conflicting with the ones already in SVN?

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 28, 2008

@mcdirmid said:
I think this is a problem for Martin to resolve. The problem is with scalac: if the core library is not set correctly in the classpath, then the compiler will just crash and won't gracefully fail. Since the plugin is tied in so heavily with the compiler, there isn't much we can do from the compiler side (beyond detaching ourselves from NSC, which isn't much of an option).

Our only option is to make the compiler more robust with respect to classes that it expects to exist but may not exist. E.g., whoever hardcoded scala.unchecked into the compiler should make sure the compiler can live without it.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 31, 2008

@milessabin said:
This looks the same as #959 to me.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jan 14, 2009

@odersky said:
Milestone next_bugfix deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.