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.

Bug 198079 - user defined build tool (scons) does not produce output (neither warnings nor errors)
Summary: user defined build tool (scons) does not produce output (neither warnings no...
Status: RESOLVED DUPLICATE of bug 197114
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 7.0
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 09:23 UTC by arne_adams
Modified: 2011-05-16 08:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
simple scons file with output that is swallowed when envoked under Netbeans 7.0 (14 bytes, application/octet-stream)
2011-05-01 08:33 UTC, arne_adams
Details
output of scons when run in the directory that contains the previously attached Sconstruct (172 bytes, application/octet-stream)
2011-05-01 08:34 UTC, arne_adams
Details
output of the build command under netbeans (123 bytes, application/octet-stream)
2011-05-01 08:36 UTC, arne_adams
Details
output of the build command under netbeans (envoked for the 3rd time) (39 bytes, application/octet-stream)
2011-05-01 08:39 UTC, arne_adams
Details
offending output (361 bytes, application/octet-stream)
2011-05-03 10:18 UTC, arne_adams
Details
shows the netbeans output (39 bytes, application/octet-stream)
2011-05-03 10:19 UTC, arne_adams
Details
a file that was stripped from lines with escape sequences (1b5b...) (273 bytes, application/octet-stream)
2011-05-03 10:21 UTC, arne_adams
Details
output of netbeans (312 bytes, application/octet-stream)
2011-05-03 10:24 UTC, arne_adams
Details
output of netbeans (312 bytes, text/plain)
2011-05-03 10:39 UTC, soldatov
Details
test project (2.42 KB, application/x-gzip)
2011-05-04 08:15 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description arne_adams 2011-04-26 09:23:40 UTC
We use scons as build tool, however the output window fails to show any build errors (intentionally I decorated invalid statements in the code).
Comment 1 arne_adams 2011-04-26 12:12:58 UTC
user defined build commands for c++ project seem to be generally broken:
another project uses the following build command (project properties dialog):
. /opt/kits/kits-1-3/bin/env.sh;make -j4
here env.sh is a proprietary environment script.

The output of the build is:
/bin/sh: line 7: exec: .: not found

BUILD FAILED (exit value 127, total time: 9s)
Comment 2 Vladimir Voskresensky 2011-04-26 12:32:23 UTC
(In reply to comment #1)
> user defined build commands for c++ project seem to be generally broken:
> another project uses the following build command (project properties dialog):
> . /opt/kits/kits-1-3/bin/env.sh;make -j4
could you try
sh -c ". /opt/kits/kits-1-3/bin/env.sh;make -j4"
Comment 3 Vladimir Voskresensky 2011-04-27 08:57:45 UTC
Thomas, 
Please, make sure we correctly handle pre 7.0 projects.
as was discussed when we introduced change for 7.0:
- We shouldn't advise all the time to prepend "sh -c", we should do it internally ourselves
Comment 4 arne_adams 2011-04-27 13:54:16 UTC
Please note that the sh -c trick does not work for the scons build step - the error output of scons is not visible in the output window instead only a BUILD FAILED message is displayed in case of errors. This is pretty useless.
Comment 5 Thomas Preisler 2011-04-27 18:15:10 UTC
Automatically execute the build command in a "sh -c ..." wrapper is not the answer. It introduces as many issues as it solves. Not sure what the right solution here is. I will downgrade to p2 while we discuss (offline) a solution. You can get your builds going with adding the shell wrapper to the build command.
Comment 6 Thomas Preisler 2011-04-28 04:58:10 UTC
I'm having trouble reproducing the issue with the missing error output. I don't have scons. Can it be reproduced using common Unix commands or is scons special?
Comment 7 arne_adams 2011-04-28 06:01:16 UTC
It looks as if the scons output is special, could it be that the unprintable characters in the output are the culprit?
Output from 6.9:
"/usr/bin/gmake" -f nbproject/Makefile-Default.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/home/aadams/NetBeansProjects/ktp'
cd ../../git/hcr-feat/ktp && scons target_bits=32 -j4
[?1034hscons: Reading SConscript files ...
scons: *** restarting build using local scons install
scons: *** call local scons directly to avoid this step
scons: *** local scons is 'tools/bsys/bin/scons'sc
[?1034hscons: Reading SConscript files ...
scons: using local scons install (version 1.2.0)
scons: using options in file /home/aadams/.scons.options
scons: build version is ktp39018-796-gfcaf807
scons: db2_home is /home/tassdb/sqllib
scons: done reading SConscript files.
scons: Building targets ...
scons: `load' is up to date.
scons: done building targets.
gmake[1]: Leaving directory `/home/aadams/NetBeansProjects/ktp'

BUILD SUCCESSFUL (total time: 26s)

Output from 7.0:

BUILD SUCCESSFUL (total time: 37s)
Comment 8 Thomas Preisler 2011-04-28 23:03:24 UTC
I tried many scenarios trying to duplicate the problem but can't. I tried something like

sh -c ". /home/thp/xxx.sh; make -f Makefile"

or 

sh -c ". /home/thp/xxx.sh; make.sh"

where make.sh runs make and redirects stdout to stderr and a couple of other combinations.

In all cases the output from the build process is correctly displayed in output window and correctly hyperlinked in case of errors.

Perhaps it is scons. Perhaps it is something in your environment. 

What system are you on?

Can you try something like the above and let us know if that is working?
Comment 9 arne_adams 2011-05-01 08:33:52 UTC
Created attachment 108029 [details]
simple scons file with output that is swallowed when envoked under Netbeans 7.0

create a new netbeans project with existing sources,
choose a folder enclosing the attached Sconstruct,
choose user defined build command sh -c "scons".
Comment 10 arne_adams 2011-05-01 08:34:41 UTC
Created attachment 108030 [details]
output of scons when run in the directory that contains the previously attached Sconstruct
Comment 11 arne_adams 2011-05-01 08:36:38 UTC
Created attachment 108031 [details]
output of the build command under netbeans

Note that "hello" is NOT contained in the output.
This is at least one bug related to the new output implementation in netbeans 7.0. It is not certain however, that a fix to this bug solves all other bugs with that implementation.
Comment 12 arne_adams 2011-05-01 08:39:23 UTC
Created attachment 108032 [details]
output of the build command under netbeans (envoked for the 3rd time)

This attachment shows that the build output is stateful - the same command produces different output when applied repeatedly to identical sources.
Note that this scons is not the culprit here because envoking scons on the commandline repeatedly produces the same output repeatedly.
Comment 13 Thomas Preisler 2011-05-02 18:16:20 UTC
It works for me. Here is output from a 'build' using your scons file:

/usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
scons: Reading SConscript files ...
hello
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

CLEAN SUCCESSFUL (total time: 564ms)

But, on my system (Mac) scons is installed in /usr/local/bin and /usr/local/bin is *not* in the PATH when I run sh, so I had to either use full path to scons in build command or add /usr/local/bin to the path:

sh -c "echo $PATH;/usr/local/bin/scons"
sh -c "PATH=/usr/local/bin:$PATH;echo $PATH;scons"

So, make sure the environment 'sh' is running under is what you expect when running the build command. Please try....
Comment 14 Thomas Preisler 2011-05-02 18:51:23 UTC
Here is another variation that works for me:

bash -lc "scons"

The -l ensures that my environment is correctly set up. I'm using bash and not sh as login shell.
Comment 15 arne_adams 2011-05-03 02:25:28 UTC
(In reply to comment #13)
> It works for me. Here is output from a 'build' using your scons file:
> 
> /usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
> scons: Reading SConscript files ...
> hello
> scons: done reading SConscript files.
> scons: Building targets ...
> scons: `.' is up to date.
> scons: done building targets.
> 
> CLEAN SUCCESSFUL (total time: 564ms)
> 
> But, on my system (Mac) scons is installed in /usr/local/bin and /usr/local/bin
> is *not* in the PATH when I run sh, so I had to either use full path to scons
> in build command or add /usr/local/bin to the path:
> 
> sh -c "echo $PATH;/usr/local/bin/scons"
> sh -c "PATH=/usr/local/bin:$PATH;echo $PATH;scons"
> 
> So, make sure the environment 'sh' is running under is what you expect when
> running the build command. Please try....

My build system is SLES11. scons is in the path and the netbeans output shows that too ("scons: Building targets ...").
Comment 16 arne_adams 2011-05-03 02:27:32 UTC
(In reply to comment #14)
> Here is another variation that works for me:
> 
> bash -lc "scons"
> 
> The -l ensures that my environment is correctly set up. I'm using bash and not
> sh as login shell.

Tried that as well - no effect.
Comment 17 arne_adams 2011-05-03 10:18:28 UTC
Created attachment 108069 [details]
offending output

assume that scons.out is saved to the directory ~/bugs/netbeans/
enter this build command:

bash -lc "cat ~/bugs/netbeans/scons.out"
Comment 18 arne_adams 2011-05-03 10:19:17 UTC
Created attachment 108070 [details]
shows the netbeans output
Comment 19 arne_adams 2011-05-03 10:21:38 UTC
Created attachment 108071 [details]
a file that was stripped from lines with escape sequences (1b5b...)

assume that the attached file scons.out.no-escape-sequence is saved to
~/bugs/netbeans/
enter the following build command in netbeans:
bash -lc "cat ~/bugs/netbeans/scons.out.no-escape-sequence"
Comment 20 arne_adams 2011-05-03 10:24:57 UTC
Created attachment 108072 [details]
output of netbeans

The 2 netbeans.out.of-scons* files prove that the escape sequences (preceeding "Reading SConscript files..." in scons.out cause the trouble.
Comment 21 soldatov 2011-05-03 10:35:40 UTC
arne_adams
Can your add attaches with correct mime types (plain text (text/plain))?
Comment 22 soldatov 2011-05-03 10:39:13 UTC
Created attachment 108073 [details]
output of netbeans
Comment 23 arne_adams 2011-05-03 13:40:30 UTC
(In reply to comment #21)
> arne_adams
> Can your add attaches with correct mime types (plain text (text/plain))?

I'm afraid not - the contained escape sequences cause the trouble - a plain text file would not contain the escape sequences.
Comment 24 Thomas Preisler 2011-05-03 17:21:06 UTC
Soldatov, can you please summarize what you think the issue is and also do we have enough to reproduce it?
Comment 25 soldatov 2011-05-03 17:57:03 UTC
(In reply to comment #24)
> Soldatov, can you please summarize what you think the issue is and also do we
> have enough to reproduce it?
Now I can't reproduce (Ubuntu 11.04).
Comment 26 arne_adams 2011-05-04 05:26:08 UTC
(In reply to comment #22)
> Created an attachment (id=108073) [details]
> output of netbeans

I guess this output is created using "cat scons.out.no-escape-sequence" under netbeans.
The file scons.out.no-escape-sequence does NOT show the error.
As the filename indicates this file does not contain escape-sequences.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Again: the escape-sequences at the beginning of scons.out cause the trouble.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

What happens if the offending output (scons.out attachment from 2011-05-01 08:39) is "cat" under netbeans?

What are the first 4 bytes of scons.out?
As hex numbers these should be
1b5b 3f31

If this is not the case, create a file that contains these 4 bytes and append some ascii characters to that file.
What happens if that file is "cat" under netbeans?
Comment 27 soldatov 2011-05-04 06:53:52 UTC
(In reply to comment #26)
> I guess this output is created using "cat scons.out.no-escape-sequence" under
> netbeans.
I re-attached your latest file only (with correct mime type).
Comment 28 soldatov 2011-05-04 07:00:29 UTC
(In reply to comment #26)
> What happens if the offending output (scons.out attachment from 2011-05-01
> 08:39) is "cat" under netbeans?
bash-4.0$ cat scons.out 
1034hscons: Reading SConscript files ...
1034hscons: Reading SConscript files ...
scons: using options in file /home/aadams/.scons.options
scons: build version is ktp39019-798-gcbdebf9-dirty
scons: db2_home is /home/tassdb/sqllib
scons: done reading SConscript files.
scons: Building targets ...
scons: `load' is up to date.
scons: done building targets.
bash-4.0$
Comment 29 arne_adams 2011-05-04 07:31:13 UTC
(In reply to comment #28)
> (In reply to comment #26)
> > What happens if the offending output (scons.out attachment from 2011-05-01
> > 08:39) is "cat" under netbeans?
> bash-4.0$ cat scons.out 
> 1034hscons: Reading SConscript files ...
> 1034hscons: Reading SConscript files ...
> scons: using options in file /home/aadams/.scons.options
> scons: build version is ktp39019-798-gcbdebf9-dirty
> scons: db2_home is /home/tassdb/sqllib
> scons: done reading SConscript files.
> scons: Building targets ...
> scons: `load' is up to date.
> scons: done building targets.
> bash-4.0$

when I enter this as build command in netbeans (select the project node -> context menu -> properties -> Build -> Make -> Build Command):

bash -lc "cat ~/bugs/netbeans/scons.out"

I get the following output (note that no command prompt bash-4.0$ whatsoever is shown).

BUILD SUCCESSFUL (total time: 411ms)

when I enter this as build command in netbeans:

bash -lc "cat ~/bugs/netbeans/scons.out.no-escape-sequence"

I get the following output (again no command prompt bash-4.0$ whatsoever is shown).

scons: using options in file /home/aadams/.scons.options
scons: build version is ktp39019-798-gcbdebf9-dirty
scons: db2_home is /home/tassdb/sqllib
scons: done reading SConscript files.
scons: Building targets ...
scons: `load' is up to date.
scons: done building targets.

BUILD SUCCESSFUL (total time: 157ms)
 

Did you produce the output using the build command of the project properties of a C++ netbeans project?
Comment 30 soldatov 2011-05-04 08:05:52 UTC
Well. I see your problem.
Comment 31 soldatov 2011-05-04 08:15:17 UTC
Created attachment 108097 [details]
test project

project contains 2 project configurations
Default - no any output (current bug)
Correct - works nicely
Comment 32 Thomas Preisler 2011-05-04 17:17:26 UTC
Looks like it is an excution/io issue. Reassigning to Andrew.
Comment 33 Andrew Krasny 2011-05-04 18:14:40 UTC
Valera, 

I have extracted your project and tried to 'Build' both configurations. I get output in any case. In 'Default' there are several non-ascii chars at the beginning of the output.. 

I have tried on Solaris 10 (x86) and Linux (Ubuntu)... Behavior is the same... 
So looks like some additional details needed..
Comment 34 arne_adams 2011-05-05 01:49:17 UTC
(In reply to comment #33)
> Valera, 
> 
> I have extracted your project and tried to 'Build' both configurations. I get
> output in any case. In 'Default' there are several non-ascii chars at the
> beginning of the output.. 
> 
> I have tried on Solaris 10 (x86) and Linux (Ubuntu)... Behavior is the same... 
> So looks like some additional details needed..

Is the output of 'Default' identical to contents of the file scons.out, in particluar does the output show all nine lines with printable characters of that file?

I downloaded soldatovs test project and built the 'Default' configuration.
The build output in netbeans does not show any printable characters of scons.out.

My netbeans version/environment is:
Product Version: NetBeans IDE 7.0 (Build 201104080000)
Java: 1.6.0_18; Java HotSpot(TM) 64-Bit Server VM 16.0-b13
System: Linux version 2.6.27.19-5-default running on amd64; ISO-8859-1; de_DE (nb)
Userdir: /home/adams/.netbeans/7.0
Comment 35 soldatov 2011-05-05 08:21:19 UTC
(In reply to comment #33)
> I have tried on Solaris 10 (x86) and Linux (Ubuntu)... Behavior is the same... 
> So looks like some additional details needed..
Output works nicely in trunk, but empty in NetBeans 7.0 from www.netbeans.org
Comment 36 Andrew Krasny 2011-05-05 08:32:07 UTC
Aha..
OK, then this should be just integrated into 7.0.1 patch I guess...
Comment 37 Andrew Krasny 2011-05-05 09:27:57 UTC
Well... the problem is in org.netbeans.core.output2.OutWriter. 
This output causes stack owerflow exception. 

"pool-4-thread-1" prio=3 tid=0x081fa000 nid=0x5c at breakpoint[0xab7ff000]
   java.lang.Thread.State: RUNNABLE

        <loop>

        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:531)
        at org.netbeans.core.output2.OutWriter.print(OutWriter.java:480)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:531)
        at org.netbeans.core.output2.OutWriter.print(OutWriter.java:480)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:531)
        at org.netbeans.core.output2.OutWriter.print(OutWriter.java:480)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:578)
        at org.netbeans.core.output2.OutWriter.print(OutWriter.java:480)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:578)
        at org.netbeans.core.output2.OutWriter.print(OutWriter.java:480)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:578)
        at org.netbeans.core.output2.OutWriter.print(OutWriter.java:480)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.printANSI(OutWriter.java:578)
        at org.netbeans.core.output2.OutWriter.doWrite(OutWriter.java:390)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.OutWriter.println(OutWriter.java:316)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.core.output2.NbWriter.println(NbWriter.java:165)
        - locked <0xb4500d20> (a org.netbeans.core.output2.OutWriter)
        at org.netbeans.api.extexecution.input.LineProcessors$PrintingLineProcessor.processLine(LineProcessors.java:243)
        ....


Seems that the changeset that fixed the problem is 

changeset:   192190:fd30d4a29abb
user:        mentlicher@netbeans.org
date:        Thu Apr 07 17:15:47 2011 +0200
summary:     #197114 Ignore unknown escape sequences.

The corresponding IZ is 197114 -  [70cat] StackOverflowError at java.util.regex.Pattern$BmpCharProperty.match

Redirecting to mentlicher... 

Please, integrate a fix to the patch, as our users suffer from this problem.
Comment 38 Martin Entlicher 2011-05-13 19:28:51 UTC
It really looks like the fix of issue #197114 fixes this.
Therefore I'm resolving this as a duplicate of issue #197114, since the problem is the same.
The fix will go to the patch.

*** This bug has been marked as a duplicate of bug 197114 ***