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 178531 - Multi-platform project troubles again
Summary: Multi-platform project troubles again
Status: RESOLVED DUPLICATE of bug 168475
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Thomas Preisler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-12 16:04 UTC by kakacek
Modified: 2009-12-16 11:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
#1 (41.36 KB, image/png)
2009-12-12 16:04 UTC, kakacek
Details
#2 (27.92 KB, image/png)
2009-12-12 16:05 UTC, kakacek
Details
PowerPC toolchain (53.93 KB, image/png)
2009-12-15 15:33 UTC, kakacek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kakacek 2009-12-12 16:04:41 UTC
Created attachment 92467 [details]
#1

Hello again,

after a while of using the NB68, I am getting back to my old issues with the NB multi-platform C/C++ projects.

I am team-leader of the project which is in C/C++ and *is multi-platform* (that is the reason for which I selected the NetBeans as the development IDE - not the proprietary MS Visual C++ nor the Borland C++, ...).

With NB67, I had to confirm the annoing message when building of all my NetBeans projects - see attachment #1 [details].

With NB68, things went even worse. I still have to confirm the annoing message box(see above)  - but, in addition, I am not able to appply the project changes - see attachment #2 [details].

This makes me a bit hopeless. Therefore, I started to think that I completely missunderstood the NetBeans concepts. Consequently, I am about to describe what I need. Then I will describe my workaround of my needs. Hopefully, someone will think about my needs & paths and will tell me what I am missing...

---

1. There is many small C/C++ projects. These are being built into a couple of executables/processes. These processes cooperate via an IPC on quite a complex functionality.

2. The final target platform is a PowerPc embedded Linux. However, it is much more convenient to do the development on the non-embedded platforms.

3. Some users do the debugging & testing of the particular processes on the x86 linux (KUbuntu in particular).

4. Some other users (incl. myself) do the debugging & testing on the OSX (Tiger/Leopard/Snow Leopard).

5. This all results in the need for building the same set of NetBeans projects for the three completely different targets. However (and unlike Microsoft family of OSes), all these are POSIX compliant and it is quite simple to maintain the portable code for them.

6. For the purpose of building my NetBeans projects for the three different targets, I created the three "Configurations" (by the means of the NB project properties) - one for PowerPC, one for Linux and one for OSX.

7. The Linux & OSX builds are native. The PowerPC build involves cross-compiling, which is done on the Linux platform.

8. The output executables just work! But with the annoying troubles, which I am reporting here...

Can anyone please help me out of this problem? Am I douing something completely wrong? Is there any better method for doing the multi-platform development than using the NetBeans "Project Configurations"?

Thank you & best regards,

Jiri.
Comment 1 kakacek 2009-12-12 16:05:20 UTC
Created attachment 92468 [details]
#2
Comment 2 Vladimir Voskresensky 2009-12-13 01:19:59 UTC
Hi, Jiri,
We have to solve this issue!
I hope we could import fix into 6.8 patch...

Thanks,
Vladimir.
Comment 3 soldatov 2009-12-13 03:02:02 UTC
Really It is duplicate of 168475
Comment 4 Thomas Preisler 2009-12-13 09:35:32 UTC
Yes, looks like a dip of 168475. I'm already working on a patch....
Comment 5 Vladimir Voskresensky 2009-12-13 12:50:31 UTC
Thomas, please, close as dup one of the issues, but move all needed info into the "not-closed" one. I like Jiri's description in this iz.

Thanks,
Vladimir.
Comment 6 Thomas Preisler 2009-12-15 11:53:44 UTC
Jiri, could you please answer the following questions:

1) Are you using the default toolchains or do you have added or modified any of these toolchains? For instance changed 'gcc' name to 'crossgcc'? I'm especially thinking of your cross compiler. 

2) You say the PowerPC configuration is done on a Linux. Where is the toolchain defined for this configuration? On the Linux? And is that a standard toolchain? Changed the name of the compiler?

3) Do you open the PowerPC configuration on the the PowerPC after you have created it and build it there, or do you take the binary already build on the Linux and use that?

The whole issue is very tricky and the core problem is a toolchain for a specific platform is not know on another platform so it is difficult/impossible to generate the makefiles for a another platform than the one you are on. I have two different solutions in mind, but both have some limitations:

a) I can just create a toolchain for the other platform when needed based on the default definition and use that to generate the makefiles. For instance, if you are on a Mac and need to generate makefiles for Solaris/SunStudio configuration, I can just create a Solaris/SunStudio toolchain and use that.

b) mark those configurations that cannot be generated as 'not generated' and automatically generate them when you open the project on the other platform. It will happen automatically and there will be no annoying dialogs.

Solution a) works nicely for most standard projects but there are some nasty corner cases where it doesn't work: if you use a modified toolchain (in Build Tool Dialog) renaming the compiler, for instance, the default toolchain I create is not good enough. It will have wrong name. Or if you use  a custom toolchain. I will not know the options/flags to use. In either of these cases the generated makefiles will be wrong!

Solution b) will always generate correct makefiles but you need to open the project on the other platform first so the correct makefile can be generated. It will all be automatic and no annoying dialogs, but you need to open the project on the other platform first in order to use it.

Right now I'm interested in a solution that is suitable as a patch so our options are pretty much limited to our existing design of toolchains and how they are defined and discovered. Unfortunately, toolchains meant for one platform cannot be created safely on other platforms. They require you actually run things and check the environment on the other platform.
Comment 7 kakacek 2009-12-15 15:31:34 UTC
ad1) I did create the special toolchain for the cross compiling. It is powerpc.
ad2) Yes the cross-compile toolchain is on Linux. And on Linux only as there are no cross-compilers for OSX. Yes, I did change the name of the compiler. For more details, please see the attached screenshot.
ad3) The PowerPC platform is embedded/small. No Java, no NetBeans, no compiling. I do the cross-compiling on Linux (PC, actually in a VMWare on OSX/WXP) and just deploy the rersulting binaries onto the embedded target via the FTP.
Comment 8 kakacek 2009-12-15 15:33:24 UTC
Created attachment 92639 [details]
PowerPC toolchain
Comment 9 Thomas Preisler 2009-12-16 10:48:57 UTC
I see, the PowerPC configuration is on Linux and you never actually open the project on PowerPC.

I have committed a fix that should fix at least some of the problems you are having. Now you should be able to open your project on either Linux or Mac and work with the two different configurations without the annoying dialog. The makefiles themselves will still not be generated for the 'wrong' platform but it will happen automatically next time you open the same project on the 'other' platform. There is currently no good way around this. 

You can try the bits here (give it a day or so):
http://bits.netbeans.org/download/trunk/nightly/latest

I will probably add the dialog back to warn users about the out-of-date makefiles, but it will have a "Don't show again" option.
Comment 10 Thomas Preisler 2009-12-16 10:50:10 UTC

*** This bug has been marked as a duplicate of bug 168475 ***
Comment 11 kakacek 2009-12-16 11:16:01 UTC
And what if I create a fake tool-chain on the OSX platform as well. Will that be a solution?

I will try to and let you know the result...