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 186289 - Windows: 'Build Package' breaks the project
Summary: Windows: 'Build Package' breaks the project
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
: 186288 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-18 10:49 UTC by dnikitin
Modified: 2010-05-24 09:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dnikitin 2010-05-18 10:49:17 UTC
Product Version: NetBeans IDE Dev (Build 201005170932)
Java: 1.6.0_17; Java HotSpot(TM) Client VM 14.3-b01
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)
----------------------------------

-- right-click on project node 
-- select More Build Commands --> Build Package
==> build command hangs
Comment 1 Leonid Lenyashin 2010-05-18 13:25:27 UTC
Alexander P., can you please evaluate if it is a showstopper or not?
Comment 2 Alexander Pepin 2010-05-18 14:44:16 UTC
Yes, it's a showstopper as 'Build Package' command breaks the project. After that any action with the project causes NPE (see bug #186288).
Comment 3 Thomas Preisler 2010-05-18 15:51:13 UTC
*** Bug 186288 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Preisler 2010-05-18 16:56:03 UTC
Can't reproduce on any platform. Will keep trying though. 

Here is the offending code:
1309        String outputFileName = projectDescriptor.getBaseDir() + '/' + MakeConfiguration.NBPROJECT_FOLDER + '/' + "Package-" + conf.getName() + ".bash"; // UNIX path // NOI18N
...
1321        FileOutputStream os = null;
1322        try {
1323            os = new FileOutputStream(outputFileName);
1324        } catch (Exception e) {
1325           // FIXUP
1326        }
1327        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));

Looks like the os is null (or bad) so something must be wrong with outputFileName path or permissions. new FileOutputStream will fail if file cannot be opened (or created) and or cannot be written to.

Questions:
1) is it reproducible? Please start with fresh userdir and use a 'good' build.
2) if reproducible, is it on any platform?
3) I noticed the pc is running Russian locale. Is this true? Could this be the problem?

I added a better check and also now reports the exception if it happens. Please try again and report back what the exception is. The exception is in the log file.
Comment 5 dnikitin 2010-05-18 17:34:58 UTC
Bug is reproducible on *Windows* only.
Comment 6 Thomas Preisler 2010-05-18 17:41:26 UTC
Can you please answer questions 1-3 in comment #4? I need to know more about how to reproduce it...
Comment 7 Alexander Pepin 2010-05-18 18:03:05 UTC
1 - it's reproducible in the fresh good build with a fresh userdir
2 - it's reproducible only on Windows
3 - I strongly doubt that it depends on locale as I use only paths containing english characters without spaces.

Steps to reproduce:
- create Welcome using cygwin tool collection
- build it, OK
- call More Build Commands --> Build Package
- build is OK but the packaging never ends
- terminate build (packaging)
- open project properties and try to change any property or just call project context menu and move mouse across the context menu
Result: NPE (see bug #186288) occurs.
Comment 8 Thomas Preisler 2010-05-18 18:35:49 UTC
OK, now I can reproduce it. Will investigate....
Comment 9 Thomas Preisler 2010-05-19 17:20:30 UTC
I believe it is an execution problem and not related to the contents of the actual package script:

1) CND 6.9 generated scripts work fine with a CND 6.8
2) CND 6.8 generated scripts fail with 6.9 the same way the 6.9 generated scripts do
3) If I in 6.9 generate the scripts and replaces the contents of the package script with a bunch of echos (see below), it fails too.
4) If I cut the number of echos in half, the script finishes.
I believe the amount of output the script generates triggers a problem in the execution code.
Will reassign to execution component and akrasny.

----------------------------------------------------
#!/bin/bash -x

#
# Generated - do not edit!
#

# Macros
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx

echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx
echo xxxxxxxxxxxxxxxxxxxxxxxxx 
----------------------------------------------------
Comment 10 Alexander Pepin 2010-05-20 11:21:40 UTC
Starting showstopper process.
Comment 11 Andrew Krasny 2010-05-20 13:03:56 UTC
fixed in cnd-main.
http://hg.netbeans.org/cnd-main/rev/15b53e8bf0f9

Alex, review, please.
Comment 12 Alexander Simon 2010-05-20 13:09:13 UTC
Fix right and safe
Comment 13 Alexander Pepin 2010-05-20 17:46:46 UTC
verified in dev cnd build from bertram.
please push to release69 clone.
Comment 14 Vladimir Kvashin 2010-05-20 19:38:32 UTC
Integrated in release69:
http://hg.netbeans.org/release69/rev/743342498b0a
Comment 15 soldatov 2010-05-21 07:14:04 UTC
"Build Packaging" tests worked in such build from Netbeans.org
Product Version         = NetBeans Platform Dev (Build 201005132200) (#fd91a0b3b548)

And tests failed in next public build:
Product Version         = NetBeans Platform Dev (Build 201005170932) (#954bcc54af95)
Comment 16 Alexander Pepin 2010-05-24 09:53:45 UTC
verified in rc1 build