This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Steps to reproduce: - remove a path to GNU compiler collection from PATH environment variable - run IDE with a fresh userdir - create a sample project (e.g. Welcome) - try to compile the project, close compiler settings window - open Tools->Options->C/C++ Settings window - add a path to Cygwin compiler collection - clean and build the project - try to run the project Result: Run fails with an error message box "Windows can not find sh". Also wrongly localized message ("ЌҐ г¤ Ґвбп ©вЁ д ©« sh.") appears in the output window.
This situation should not be possible anymore with the new design of the tool chains setup. I don't think it is possible to build a project with no compilers available.
The bug is not about possibility to compile the project but it's about impossibility to run compiled project and this is not fixed with a new toolchain.
Agree. This bug should not have been closed. and "Gdb could not be started http://www.netbeans.org/issues/show_bug.cgi?id=131802" is most likely a dup.
The gdb version (131802) is a duplicate of this issue. I raised 131802 to P1 but Jesse lowered it back to P2. I think this issue is critical as it was very important to support project building for users who do not have their compiler directory in their path. Not only does that directory need to be in their path to build, it needs to be their to run (so it finds dlls at Runtime).
Fixed the Run part. Debugging needs a similar fix in GdbLite's code. I added the following code that will add proper path to environment (PATH): // Append compilerset base to run path. (IZ 120836) ArrayList<String> env1 = new ArrayList<String>(); String csname = ((MakeConfiguration) pae.getConfiguration()).getCompilerSet().getOption(); String csdirs = CompilerSetManager.getDefault().getCompilerSet(csname).getDirectory(); if (((MakeConfiguration)pae.getConfiguration()).getCompilerSet().getFlavor().equals(CompilerFlavor.MinGW.toString())) { // Also add msys to path. Thet's where sh, mkdir, ... are. String msysBase = CppUtils.getMSysBase(); if (msysBase != null && msysBase.length() > 0) { csdirs = csdirs + File.pathSeparator + msysBase + File.separator + "bin"; // NOI18N } } boolean gotpath = false; String pathname = Path.getPathName() + '='; int i; for (i = 0; i < env.length; i++) { if (env[i].startsWith(pathname)) { env1.add(env[i] + File.pathSeparator + csdirs); // NOI18N gotpath = true; } else { env1.add(env[i]); } } if (!gotpath) { env1.add(pathname + Path.getPathAsString() + File.pathSeparator + csdirs); } env = env1.toArray(new String[env1.size()]); GdbLite needs to add similar code. In the future we should consolidate the code.
Extending the fix to cover shell file and make file stand-alone execution from a project by adding the compiler base path to the environment shell file and make files are executed in. If you start the IDE with no compilers in the PATH and configure the tool chain from the tool chain dialog, projects are now buildable and debuggable, and shel and make execution work. I realize it was important that shell file execution did work because the project wizard may execute a configure script as part of project creation which wouldn't work without this extra fix.
Extended fix committed to trunk: changeset 8310e758f828 in main details: http://hg.netbeans.org/main?cmd=changeset;node=8310e758f828 description: 120836 Run failed if the project was created without compilers in path What should work now (when you include fix for http://www.netbeans.org/issues/show_bug.cgi?id=131802): - remove a path to GNU compiler collection from PATH environment variable - run IDE with a fresh userdir - create a sample project (e.g. Welcome) - try to compile the project, close compiler settings window - open Tools->Options->C/C++ Settings window - add a path to Cygwin compiler collection - clean and build the project - run the project - debug the project - run make directly from it's context menu - add a shell file and run it directly from it's context menu
verified in trunk 200804040003
fix failed. Run executable through context menu leads to NPE: java.lang.NullPointerException at org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler$HandleEvents.go(DefaultProjectActionHandler.java:365) at org.netbeans.modules.cnd.makeproject.api.DefaultProjectActionHandler.actionPerformed(DefaultProjectActionHandler.java:131) at org.netbeans.modules.cnd.makeproject.api.ProjectActionSupport.fireActionPerformed(ProjectActionSupport.java:72) at org.netbeans.modules.cnd.makeproject.api.actions.RunDialogAction.perform(RunDialogAction.java:137) at org.netbeans.modules.cnd.makeproject.api.actions.RunDialogAction.perform(RunDialogAction.java:107) at org.netbeans.modules.cnd.makeproject.api.actions.RunDialogAction.performAction(RunDialogAction.java:91) at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:581) at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:111) at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:104) at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:52) at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:102) at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:71) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
and the steps are? I cannot reproduce. are you sure it is related to my changes?
I'm not sure which changes caused this exception but it's definitely a regression. It does not happen in trunk build 20080403 and does happen in today's 20080404. Probably it's a side effect of fixing issue #131739. Because it does not depend on having compilers in path I would create a new IZ for this. Anyway here is steps to reproduce: - create a new project (e.g. Welcome) - build the project - run the project, everything is OK - switch to Files tab - expand Welcome/dist/Debug/welcome.exe and call "Run..." from the file context menu - select Welcome project in Project combobox in Run window then press Run Result: Mentioned exception appears
somehow I changed Priority and Target milestone. Now I've changed them back
verified in the trunk build 200804041203 with additional jar (org-netbeans-modules-cnd-makeproject.jar)
Pushed to release61
verified in NB6.1RC1 (build 200804082140)