Author Topic: C::B new releases hung on linkage in cygwin  (Read 16198 times)

Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
C::B new releases hung on linkage in cygwin
« on: September 07, 2012, 06:53:06 pm »
Hello, dear developers.

I successfully use the latest "debugger branch" (rev 8020) of C::B with my projects and it completely fits my needs for now.
But I recently noted that newest branches (eg, 8300) built locally and curious for me in the future, can not suite me because I saw some particular project of mine does not want to compile well. I realize the cygwin environment often is out of C::B interests, however I would like to report there are problems on project linking stage, not appearing on the mentioned deb_branch of 8020 rev. That it to say - for example, I see the first linkage step of a project does not finish at all at C::B rev 8300. I work with standalone Makefile ("custom Makefile") generated by Autotools in this case, for example, but I think that this fact makes no difference.

Could you offer all possible directions of digging into the trouble from my side. I could give the necessary info of the local trouble if need be.

Thanks.

Gene.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B new releases hung on linkage in cygwin
« Reply #1 on: September 07, 2012, 08:02:25 pm »
If you have the time and a fast machine you can try to bisect where the problem started.
Probably you can try several nightlies, first.

p.s. If you use custom makefile then there is something broken in the makefile or its expectations (environment variables), because C::B just calls make with your makefile as parameters.
p.s.s. I suppose you've enabled the full compiler log, if not please do so (see the FAQ at the wiki for details)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B new releases hung on linkage in cygwin
« Reply #2 on: September 08, 2012, 08:03:29 pm »
If you have the time and a fast machine you can try to bisect where the problem started.
Probably you can try several nightlies, first.

Thank you for your hint. I am in the middle of that proccess right now.
First of all, I would want to beg a pardon for some disinformation concerning my previous message: I had thought I had 8020 working revision of C::B because this branch was being kept by me as standalone set of sources of C::B. But yesterday I realized (after checking many nightly builds) that when compiling that workable version several mounts ago I was at the version *not very close* to 8020 rev. And because I had't have svn.exe utility in the PATH variable (and thus having "SVN 0" rev. in the product banner) I could not say for sure which particular version I was using for the period.

Now, it all is more clear.
For now the affairs is:
- the mentioned trouble of mine with linkage resides in the revisions range from  7800 to 7850.
- Now I keep trying to bisect further and detect the waterline (the two particular adjacent revisions).

will let you know ASAP for the word for further actions.

Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B new releases hung on linkage in cygwin
« Reply #3 on: September 12, 2012, 07:34:39 pm »
Hello!

I've revealed that problem starts from 7802.
I checked these versions: 7850, 7830, 7815, 7808, 7803(failed to compile), 7802, 7801. (Each time I press Ctrl-F11 for cleanup)
Days ago I tried the newest, as I mentioned, unsuccessfully as well.
7801 - is the latest one where there is no compile(link) trouble. The problem starts (in cygwin) from the next rev. I did not try Linux compilation through C::B for now, though. (In linux I just created new project of this project  from sources and not tried native automake-created makefile.)

svn  Diff and log says there were changes to only compiler plugin.

And  indeed, if I (re)place compiler.dll to 7850, 7830, 7815, 7808 plugins directories, I can successfully compile the project from within these versions ;-)

Any ideas? Should I go on myself or let you check towards this subject?
Here is that line (from build log excerpt):
/bin/sh ../libtool --tag=CXX    --mode=link g++-4   -Wall -g  -fexceptions -all-static -no-undefined   -L/lib/qt3/lib -o libXmlRpc.la -rpath /usr/local/lib strncasecmp.lo XmlRpcClient.lo  XmlRpcDispatch.lo XmlRpcServer.lo XmlRpcServerConnection.lo  XmlRpcServerMethod.lo XmlRpcSocket.lo XmlRpcSource.lo  XmlRpcUtil.lo XmlRpcValue.lo ../replace/libreplace.la


thanks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B new releases hung on linkage in cygwin
« Reply #4 on: September 12, 2012, 07:43:45 pm »
What is the difference between the executed commands, if there is a difference?
Also have you tried to put an env command in you makefile to see, if the environment variables are the same with the working and with the broken versions?
Also is the working directory for make the same?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B new releases hung on linkage in cygwin
« Reply #5 on: September 12, 2012, 08:36:33 pm »
What is the difference between the executed commands, if there is a difference?
Have no idea - what the difference is ;--) All executed commands are the same in ALL cases of compilationa via several C::B.: The custom Makefile is the same always and no matter which additional environment variables I use (in test cases I used none) because I did not even build for these C::B versions the envvars.dll plugin that could control the other ways of build process.

Also have you tried to put an env command in you makefile to see, if the environment variables are the same with the working and with the broken versions?
No, I did not try. I am not aware of how to put "env command in makefile" and for what. 
Makefile was created by a special build target (within C::B) and it was created once.

Also is the working directory for make the same?
Of course. In any C::B I open the same .cbp, choose custom makefile option, and have no envvars that could influence...
I use the same personality profile (*.conf file) in ALL tests.
Other make.exe utilities (in other directories) just unable to compile cygwin sources. CYgwin itself is unique installation per host.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B new releases hung on linkage in cygwin
« Reply #6 on: September 12, 2012, 09:04:12 pm »
So, if you save the build logs produced by make, they will be the same when using the two versions of C::B (broken and working)?

As you can see in the code, the compiler plugin modifies the PATH variable, it could be that it does it differently in the newer versions.
Can you try to put echo $PATH in some of the rules?

Keep in mind that I don't use cygwin or I've never used it so I have no experience with it.

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B new releases hung on linkage in cygwin
« Reply #7 on: September 13, 2012, 09:58:34 am »
So, if you save the build logs produced by make, they will be the same when using the two versions of C::B (broken and working)?
Previously I compared (visually) from the build log only the excerpts where problematic command  (command that hangs) resides, but now ok - I will "file compare" in both cases all previous text lines from the log, till the line where broken compilation hangs.
(But I am still sure - no diff...s)

As you can see in the code, the compiler plugin modifies the PATH variable, it could be that it does it differently in the newer versions.
Can you try to put echo $PATH in some of the rules?
Will try.
Keep in mind that I don't use cygwin or I've never used it so I have no experience with it.
I am aware.



Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B new releases hung on linkage in cygwin
« Reply #8 on: September 13, 2012, 12:45:19 pm »
As you can see in the code, the compiler plugin modifies the PATH variable, it could be that it does it differently in the newer versions.
Can you try to put echo $PATH in some of the rules?
Yes! I did not guess it myself...
It is what you have described. I put echoing string in a corresponding makefile.am of my proj.
check-local:
   @echo $(PATH)

and the two PATH outputs are different ;-(

The broken build process prints:
/usr/bin:/:/usr/local/bin
While the successful variant prints:
/usr/bin:/cygdrive/c/Program Files/Common Files/NetSarang:/cygdrive/c/Program Files/NVIDIA Corporation/PhysX/Common:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/d/Program Files/Bazaar:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/usr/local/bin:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/d/Dev-Cpp/bin

Do you want for me to make a private patch for local usage with newest C::B revisions and cygwin, or you can assume to handle with the situation globally?

Thanks for you help anyway.



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B new releases hung on linkage in cygwin
« Reply #9 on: September 13, 2012, 12:50:54 pm »
Do you want for me to make a private patch for local usage with newest C::B revisions and cygwin, or you can assume to handle with the situation globally?
I suppose, we have to wait for MortenMacFly to say something about it, because he has done the change.

Is it possible to provide a test project?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B new releases hung on linkage in cygwin
« Reply #10 on: September 13, 2012, 01:54:19 pm »
I suppose, we have to wait for MortenMacFly to say something about it, because he has done the change.
Just noticed this thread.

Is it possible to provide a test project?
This is a requirement to come a step further. The modification was actually needed to really use the compiler as setup and avoid launching a wrong compiler present in the PATH. So this change should not be reverted. However, if it does something different for Cygwin we have to take care. The method used hereby is (however) a wx methods to handle PATH's. So it maybe that we have to do something "by hand" because when it comes to files/path's Cygwin even on Windows is different.

From what I see in the PATH output: Are you really on Windows, or do you cross-compile from Linux? It would be really helpful if you can provide a test project and state your OS and version of Cygwin (DLL).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline littlegene

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: C::B new releases hung on linkage in cygwin
« Reply #11 on: September 14, 2012, 10:50:24 am »
Now the problem is ultimately clear.

Cygwin hangs on linkage as described (within its own terminal environment, not only within C::B execution) *IF*  PATH set to
"/usr/bin:/:/usr/local/bin". It is a problem of cygwin.
If C::B would modify PATH to more correct
"/usr/bin:/usr/local/bin" instead , then cygwin linkage would function well.

The problem of C::B is in incorrect ("/usr/bin:/:/usr/local/bin" instead of for ex. "/usr/bin:/usr/local/bin") and, may be, unnecessary cutting off the native and very long well PATH that contains many other directories, which do not only belong to linux-like filesystem.

« Last Edit: September 14, 2012, 10:58:40 am by littlegene »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B new releases hung on linkage in cygwin
« Reply #12 on: September 14, 2012, 05:48:25 pm »
The problem of C::B is in incorrect ("/usr/bin:/:/usr/local/bin" instead of for ex. "/usr/bin:/usr/local/bin")
I've just installed a most recent version of Cygwin. Created a console project using the Cygwin compiler - compiling and linking just works for me as it should.

If you don't provide what we asked several times now we cannot help you. Period.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C::B new releases hung on linkage in cygwin
« Reply #13 on: September 14, 2012, 06:26:56 pm »
Morten: He is using a custom makefile project and it seems that the env for make is broken.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B new releases hung on linkage in cygwin
« Reply #14 on: September 14, 2012, 08:20:36 pm »
Morten: He is using a custom makefile project and it seems that the env for make is broken.
Still: What is so had to provide a minimal test case? I don't see this on our side. In fact I very, very rarely use custom makefiles, so I might even do something wrong. W/O a test case I see no point in "guessing" whats wrong. In the end you can also manipulate the env-vars from the custom makefile. What, if that had happened?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ