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

Error when importing Copybara into intellij #27

Closed
ittaiz opened this issue Oct 22, 2016 · 5 comments
Closed

Error when importing Copybara into intellij #27

ittaiz opened this issue Oct 22, 2016 · 5 comments

Comments

@ittaiz
Copy link
Member

ittaiz commented Oct 22, 2016

Hi,
Trying to import copybara into intellij and getting an error in the second screen of the wizard. Tried to specify both a workspace and a BUILD file and no luck.

IntelliJ IDEA 2016.2.5
Build #IU-162.2228.15, built on October 14, 2016
JRE: 1.8.0_112-release-287-b2 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Plugin version 1.10.2

Invalid workspace path: /Users/ittaiz/workspace/copybara/WORKSPACE
java.lang.IllegalArgumentException: Invalid workspace path: /Users/ittaiz/workspace/copybara/WORKSPACE
    at com.google.idea.blaze.base.model.primitives.WorkspacePath.<init>(WorkspacePath.java:55)
    at com.google.idea.blaze.base.wizard2.ImportFromWorkspaceProjectViewOption.getSharedProjectView(ImportFromWorkspaceProjectViewOption.java:98)
    at com.google.idea.blaze.base.wizard2.ImportFromWorkspaceProjectViewOption.validate(ImportFromWorkspaceProjectViewOption.java:87)
    at com.google.idea.blaze.base.wizard2.ui.BlazeSelectOptionControl.validate(BlazeSelectOptionControl.java:134)
    at com.google.idea.blaze.base.wizard2.ui.BlazeSelectProjectViewControl.validate(BlazeSelectProjectViewControl.java:58)
    at com.google.idea.blaze.java.wizard2.BlazeSelectProjectViewImportWizardStep.validate(BlazeSelectProjectViewImportWizardStep.java:62)
    at com.intellij.ide.util.newProjectWizard.AbstractProjectWizard.commitStepData(AbstractProjectWizard.java:231)
    at com.intellij.ide.util.newProjectWizard.AbstractProjectWizard.doNextAction(AbstractProjectWizard.java:250)
    at com.intellij.ide.wizard.AbstractWizard$5.actionPerformed(AbstractWizard.java:198)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:795)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
    at java.awt.Dialog.show(Dialog.java:1084)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:778)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:455)
    at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1665)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1607)
    at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1622)
    at com.google.idea.blaze.java.wizard2.BlazeImportProjectAction.actionPerformed(BlazeImportProjectAction.java:29)
    at com.intellij.ui.components.labels.ActionLink$1.linkSelected(ActionLink.java:66)
    at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:145)
    at com.intellij.ui.components.labels.ActionLink.doClick(ActionLink.java:79)
    at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:328)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:795)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)


java.lang.IllegalArgumentException: Invalid workspace path: /Users/ittaiz/workspace/copybara/WORKSPACE
    at com.google.idea.blaze.base.model.primitives.WorkspacePath.<init>(WorkspacePath.java:55)
    at com.google.idea.blaze.base.wizard2.ImportFromWorkspaceProjectViewOption.getSharedProjectView(ImportFromWorkspaceProjectViewOption.java:98)
    at com.google.idea.blaze.base.wizard2.ImportFromWorkspaceProjectViewOption.validate(ImportFromWorkspaceProjectViewOption.java:87)
    at com.google.idea.blaze.base.wizard2.ui.BlazeSelectOptionControl.validate(BlazeSelectOptionControl.java:134)
    at com.google.idea.blaze.base.wizard2.ui.BlazeSelectProjectViewControl.validate(BlazeSelectProjectViewControl.java:58)
    at com.google.idea.blaze.java.wizard2.BlazeSelectProjectViewImportWizardStep.validate(BlazeSelectProjectViewImportWizardStep.java:62)
    at com.intellij.ide.util.newProjectWizard.AbstractProjectWizard.commitStepData(AbstractProjectWizard.java:231)
    at com.intellij.ide.util.newProjectWizard.AbstractProjectWizard.doNextAction(AbstractProjectWizard.java:250)
    at com.intellij.ide.wizard.AbstractWizard$5.actionPerformed(AbstractWizard.java:198)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:795)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
    at java.awt.Dialog.show(Dialog.java:1084)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:778)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:455)
    at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1665)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1607)
    at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1622)
    at com.google.idea.blaze.java.wizard2.BlazeImportProjectAction.actionPerformed(BlazeImportProjectAction.java:29)
    at com.intellij.ui.components.labels.ActionLink$1.linkSelected(ActionLink.java:66)
    at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:145)
    at com.intellij.ui.components.labels.ActionLink.doClick(ActionLink.java:79)
    at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:328)
    at java.awt.Component.processMouseEvent(Component.java:6533)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6298)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:795)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:627)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:387)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)


@brendandouglas
Copy link
Contributor

There are a couple of issues here:

  • the "Import from workspace" option needs a relative path from workspace root, and needs to reference a *.bazelproject project view file.
  • the "Generate from BUILD file" option only accepts filename "BUILD", not "BUILD.foo", so the root BUILD.cram file in the copybara project isn't accepted.

As a workaround, you can import this project via the 'create from scratch' option.

I'll open a bug to:

  • fix the error message when an invalid project view file is chosen.
  • support BUILD.foo filenames during project import.

@brendandouglas
Copy link
Contributor

That previous comment wasn't quite correct -- BUILD.foo files can be manually specified in the 'generated from BUILD file' option, they just don't appear as valid choices in the file selector UI.

@brendandouglas
Copy link
Contributor

Turns out bazel still only supports BUILD files without an extension (when bazelbuild/bazel#552 lands, the plan is for BUILD.bazel to also be supported).

In the meantime, I believe the only remaining issue here is improving the error handling when an invalid project file is chosen during project import.

@ittaiz
Copy link
Member Author

ittaiz commented Oct 25, 2016

Thanks!
To me the "import from workspace" label sounds a bit misleading if I don't
read the UI carefully. I assumed I only need a WORKSPACE file. WDYT about a
rename to be more explicit? Mainly because the other option talks about a
BUILD file and both are bazel concepts (admittedly workspace is also an
intellij concept).

Regarding the 'generated from BUILD file' maybe the error message should
hint that it couldn't find a BUILD file and that if the user has a file
with a different name then maybe that should be explicitly specified.

On Mon, Oct 24, 2016 at 5:12 PM brendandouglas [email protected]
wrote:

That previous comment wasn't quite correct -- BUILD.foo files can be
manually specified in the 'generated from BUILD file' option, they just
don't appear as valid choices in the file selector UI.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#27 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABUIF2m6bN0QAgOF8tDvoJU2k_XJE7oNks5q3Ly4gaJpZM4Kd886
.

@ittaiz
Copy link
Member Author

ittaiz commented Aug 8, 2017

@brendandouglas I'm closing since I think this is stale. Not sure if it's fixed but I'm guessing if it will bother someone they'll reopen.

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

No branches or pull requests

2 participants