Bug 225119 - There is no way to set env for BUILD
There is no way to set env for BUILD
Product: cnd
Classification: Unclassified
Component: Project
PC Windows XP
: P3 (vote)
: 8.2
Assigned To: Alexander Simon
Depends on:
  Show dependency treegraph
Reported: 2013-01-21 02:35 UTC by zachsaw
Modified: 2016-11-08 15:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description zachsaw 2013-01-21 02:35:40 UTC
For Cygwin to use the correct (i.e. updated gcc dlls), we need to have usr/local/bin prepended to PATH* - /etc/profile: PATH="/usr/local/bin:/usr/bin:${PATH}"
* I believe this is the Cygwin default.

However under Netbeans, there's no possible way to prepend /usr/local/bin to the PATH env. It insists on prepending /usr/bin (that's where sh resides) and thus causing all run/debug etc. to fail as the built app needs the new DLLs.

The base directory under tools|options for the new gcc version is set correctly (C:\cygwin\usr\local\bin) but this field seems to be completely ignored.
Comment 1 zachsaw 2013-01-21 03:57:36 UTC
Specifically, WindowsHostInfoProvider class:
HostInfoImpl ctor:

Remove this:

      if (this.shell != null) {
        String path = new File(this.shell).getParent();
        env.put("PATH", path + ";" + (String)env.get("PATH"));

Instead, we should alert the user that shell couldn't be found in the search path (either Cygwin is not installed or system search path is missing path to sh).
Comment 2 Maria Tishkova 2014-11-20 10:35:24 UTC
Need to address this. We need to allow user to control env the build is started in

As a workaround I can suggest to create build script and set it as build command (if you use unmanaged projects).
In the build script you can prepend  "/usr/local/bin" to the PATH env variable
Comment 3 Alexander Simon 2016-11-08 15:27:06 UTC
You can control PAT since the bug #222549 had been fixed.
See http://wiki.netbeans.org/NewAndNoteworthyNB82#Modifying_a_PATH_var:_prepending_or_appending_a_toolchain_path

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo