Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-06

Build Lazarus + MINGW32

16 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

Hi

I tried to "make all" for at my work Windows machine. I have git and MINGW32 unix shell environment installed.
The build fails as shown below. The problematic line is clearly this: sh: C:\Program: No such file or directory
For some reason "sh" is started and it does not understand spaces in paths. The interesting thing is that I use normal Windows cmd, not the MINGW32 shell.
If I test in MINGW32 shell, it gives the same error.

"$ which make" in MINGW32 shell says (correctly) : /c/FPC/2.6.0/bin/i386-Win32/make

I remember seeing questions of this problem also before. How to solve it?

Regards,
Juha

...
Compiling noguiint.pp
Compiling noguiwsfactory.pas
735 lines compiled, 0.6 sec
C:/FPC/2.6.0/bin/i386-Win32/cp.exe -f Makefile.compiled ../../units/i386-win32/nogui/LCL.compiled
make[3]: Leaving directory `C:/SW/lazarus/lcl/interfaces/nogui' make[2]: Leaving directory `C:/SW/lazarus/lcl/interfaces' make[1]: Leaving directory `C:/SW/lazarus/lcl'
make -C tools
makefile:2332: warning: overriding commands for target `.' makefile:2330: warning: ignoring old commands for target `.' make[1]: Entering directory `C:/SW/lazarus/tools'
echo
sh: C:\Program: No such file or directory
make[1]: *** [all] Error 127
make[1]: Leaving directory `C:/SW/lazarus/tools'
make: *** [lazbuild] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120601/0c28d104/attachment.html>

Reply by email

Henry Vermaak
to Juha Manninen
Juha Manninen wrote
Hi I tried to "make all" for at my work Windows machine. I have git and MINGW32 unix shell environment installed.

MinGW doesn't have a shell. Do you mean MSYS?

The build fails as shown below. The problematic line is clearly this: sh: C:\Program: No such file or directory For some reason "sh" is started and it does not understand spaces in paths.

I had to patch the Makefiles to get my fpc and lazarus to build inside msys. Is this what you are trying to do?

Show quoted text 6 lines
The interesting thing is that I use normal Windows cmd, not the MINGW32 shell. If I test in MINGW32 shell, it gives the same error. "$ which make" in MINGW32 shell says (correctly) : /c/FPC/2.6.0/bin/i386-Win32/make

You are using "make" supplied by fpc, so why mingw/msys? I'm a bit confused about what you are doing, but it looks like you can't build lazarus even with the fpc supplied tools, so perhaps you have PATH issues.

Henry

Reply by email

Juha Manninen
to Henry Vermaak
Henry Vermaak wrote
MinGW doesn't have a shell. Do you mean MSYS?

Maybe. The icon on Windows says "Git Bash", but the window title says MINGW32.
Git is from here: https://github.com/msysgit/msysgit

I had to patch the Makefiles to get my fpc and lazarus to build inside

msys. Is this what you are trying to do?

No, I get the error also when building from the standard Windows cmd prompt.

Show quoted text 8 lines
The interesting thing is that I use normal Windows cmd, not the MINGW32 > shell. > If I test in MINGW32 shell, it gives the same error. > > "$ which make" in MINGW32 shell says (correctly) : > /c/FPC/2.6.0/bin/i386-Win32/make You are using "make" supplied by fpc, so why mingw/msys?

mingw/msys came with the Windows port of Git. We are switching from CVS to Git in my work place.

I'm a bit confused about what you are doing, but it looks like you can't

build lazarus even with the fpc supplied tools, so perhaps you have PATH issues.

I try to build Lazarus trunk. FPC 2.6.0 is installed and it works ok. I was able to build Lazarus at my home Windows after installing "Git Bash". I don't know what is different here. Maybe I must start cleaning the path.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120601/4bbd6480/attachment.html>

Reply by email

Henry Vermaak
to Juha Manninen
Juha Manninen wrote 9 lines
On Fri, Jun 1, 2012 at 6:17 PM, Henry Vermaak < <mailto:>> wrote: MinGW doesn't have a shell. Do you mean MSYS? Maybe. The icon on Windows says "Git Bash", but the window title says MINGW32. Git is from here: https://github.com/msysgit/msysgit

Ah, right. I know that git for windows comes with its own msys installation. I don't know how it differs from the stock msys.

I try to build Lazarus trunk. FPC 2.6.0 is installed and it works ok. I was able to build Lazarus at my home Windows after installing "Git Bash". I don't know what is different here. Maybe I must start cleaning the path.

Hmm, hard to tell. Safest way in windows to build things is from a batch file, where you explicitly set the path, so that it's not influenced by the system path. At least in my experience.

Henry

Reply by email

Juha Manninen
to Henry Vermaak
Henry Vermaak wrote
Hmm, hard to tell. Safest way in windows to build things is from a batch file, where you explicitly set the path, so that it's not influenced by the system path. At least in my experience.

There are many scripts around. Which one you recommend? (I will be able to test it on next Monday when I go back to work).

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120601/fe09bef3/attachment.html>

Reply by email

Reinier Olislagers
to Juha Manninen: Maybe. The icon on Windows says "Git Bash", but the window title says MINGW32. Git is…
Juha Manninen wrote
I try to build Lazarus trunk. FPC 2.6.0 is installed and it works ok. I was able to build Lazarus at my home Windows after installing "Git Bash". I don't know what is different here. Maybe I must start cleaning the path.

That's what I'd suspect, too...

<advertisement>
Perhaps you'll become another convert to fpcup... (Remembered your forum post a while ago where you mentioned you didn't use it yet :)

Fpcup fiddles with the path so you don't have to (it works e.g. if Delphi make is in your path) and if it doesn't work you can release your frustrations by complaining to me ;)
</advertisement>

Though, to be honest, fiddling with something like (IIRC) setlocal and endlocal and messing with the PATH (SET PATH=...) in a batch file is certainly doable...

Good luck,
Reinier

Reply by email

Juha Manninen
to Reinier Olislagers

On Fri, Jun 1, 2012 at 8:41 PM, Reinier Olislagers <

Show quoted text 11 lines
wrote: <advertisement> Perhaps you'll become another convert to fpcup... (Remembered your forum post a while ago where you mentioned you didn't use it yet :) Fpcup fiddles with the path so you don't have to (it works e.g. if Delphi make is in your path) and if it doesn't work you can release your frustrations by complaining to me ;) </advertisement>

True. I didn't have problems compiling Lazarus trunk for a long time but now I have.
I will try it on Monday when I go to work.
Thanks.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120601/f7c45fc3/attachment.html>

Reply by email

waldo kitty
to Reinier Olislagers: That's what I'd suspect, too... <advertisement> Perhaps you'll become another convert to…
Reinier Olislagers wrote
Though, to be honest, fiddling with something like (IIRC) setlocal and endlocal and messing with the PATH (SET PATH=...) in a batch file is certainly doable...

it sure is ;)

====== snip ======

:setvars
if "%myFPCver%" == "" set myFPCver=2.6.0
if "%myFPCpath%" == "" set myFPCpath=c:\freepascal\fpc\%myFPCver% if "%myLAZpath%" == "" set myLAZpath=c:\freepascal\laz if "%myFPCbinutils%" == "" set myFPCbinutils=c:\freepascal\binutils if "%myFPCpathset%" == "TRUE" goto pathok
set PATH=%myFPCbinutils%\i386-win32;%myFPCpath%\bin\i386-win32;%PATH% set myFPCpathset=TRUE
:pathok

====== snip ======

the above prepends to the existing path and does it only once in the current session so the script can be executed more than once without prepending and prepending and prepending over and over to the path :)

Reply by email

Marco van de Voort
to Juha Manninen: Hi I tried to "make all" for at my work Windows machine. I have git and MINGW32 unix…
Juha Manninen wrote 11 lines
I tried to "make all" for at my work Windows machine. I have git and MINGW32 unix shell environment installed. The build fails as shown below. The problematic line is clearly this: sh: C:\Program: No such file or directory For some reason "sh" is started and it does not understand spaces in paths. The interesting thing is that I use normal Windows cmd, not the MINGW32 shell. If I test in MINGW32 shell, it gives the same error. "$ which make" in MINGW32 shell says (correctly) : /c/FPC/2.6.0/bin/i386-Win32/make

FPC make is mingw shell, which tries to execute "sh" is found.

See http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-1.2.4

(though that is about mingw make calling cygwin sh.exe but same thing.

I remember seeing questions of this problem also before. How to solve it?

Don't put sh.exe in your path or in the dir with "make.exe" in it.

Reply by email

Marco van de Voort
to Reinier Olislagers: That's what I'd suspect, too... <advertisement> Perhaps you'll become another convert to…
Reinier Olislagers wrote 15 lines
> I don't know what is different here. Maybe I must start cleaning the path. That's what I'd suspect, too... <advertisement> Perhaps you'll become another convert to fpcup... (Remembered your forum post a while ago where you mentioned you didn't use it yet :) Fpcup fiddles with the path so you don't have to (it works e.g. if Delphi make is in your path) and if it doesn't work you can release your frustrations by complaining to me ;) </advertisement> Though, to be honest, fiddling with something like (IIRC) setlocal and endlocal and messing with the PATH (SET PATH=...) in a batch file is certainly doable...

If fpcup calls "make.exe" on windows, it will suffer from the same fate.

Reply by email

Hans-Peter Diettrich
to Marco van de Voort: FPC make is mingw shell, which tries to execute "sh" is found. See…
Show quoted text 9 lines
FPC make is mingw shell, which tries to execute "sh" is found. See http://www.stack.nl/~marcov/buildfaq/#toc-Subsection-1.2.4 (though that is about mingw make calling cygwin sh.exe but same thing. > I remember seeing questions of this problem also before. How to solve it? Don't put sh.exe in your path or in the dir with "make.exe" in it.

I use a standard Windows console for make. There I replace the entire PATH before make, with only the FPC bin directory to use. This way no other programs or scripts can get into the way.

DoDi

Reply by email

Reinier Olislagers
to Marco van de Voort: If fpcup calls "make.exe" on windows, it will suffer from the same fate.
Marco van de Voort wrote 13 lines
On Fri, Jun 01, 2012 at 07:41:33PM +0200, Reinier Olislagers wrote: >> I don't know what is different here. Maybe I must start cleaning the path. > That's what I'd suspect, too... > > <advertisement> > Perhaps you'll become another convert to fpcup... (Remembered your forum > post a while ago where you mentioned you didn't use it yet :) > > Fpcup fiddles with the path so you don't have to (it works e.g. if > Delphi make is in your path) and if it doesn't work you can release your > frustrations by complaining to me ;) > </advertisement> If fpcup calls "make.exe" on windows, it will suffer from the same fate.

No, it won't ;)

It calls make but changes the PATH before doing that to exclude anything except the FPC dir (or Lazarus, FPC bin dir later on) and a bootstrap/binutils dir where you can store or let fpcup download a bootstrap compiler, make.exe etc.

Tested with a Delphi6 install which puts Delphi make in the path.

Reinier

Reply by email

Marco van de Voort
to Hans-Peter Diettrich: I use a standard Windows console for make. There I replace the entire PATH before make,…
Hans-Peter Diettrich wrote 5 lines
>> I remember seeing questions of this problem also before. How to solve it? > > Don't put sh.exe in your path or in the dir with "make.exe" in it. I use a standard Windows console for make.

Define "standard". You don't have anything installed, so the system and user PATH variables are still pristine?

There I replace the entire PATH before make, with only the FPC bin directory to use. This way no other programs or scripts can get into the way.

I assume this means that you do the same as Reinier. Hardcode the pristine environment (or better fix it with the %systemroot% env variable), and then put the FPC dir in front of it.

That is indeed a good way, and is basically the same as not putting sh.exe in the PATH that is passed to make.

Reply by email

Hans-Peter Diettrich
to Marco van de Voort
Show quoted text 7 lines
On Sat, Jun 02, 2012 at 03:59:52AM +0200, Hans-Peter Diettrich wrote: >>> I remember seeing questions of this problem also before. How to solve it? >> Don't put sh.exe in your path or in the dir with "make.exe" in it. > I use a standard Windows console for make. Define "standard". You don't have anything installed, so the system and user PATH variables are still pristine?

My default path (after opening a new console) is quite lengthy, and every new program tends to add itself to the path :-(

Show quoted text 5 lines
> There I replace the entire PATH before make, with only the FPC bin > directory to use. This way no other programs or scripts can get into the > way. I assume this means that you do the same as Reinier.

Right, I noticed this myself, later.

DoDi

Reply by email

Juha Manninen
to Reinier Olislagers: That's what I'd suspect, too... <advertisement> Perhaps you'll become another convert to…

On Fri, Jun 1, 2012 at 8:41 PM, Reinier Olislagers <

Show quoted text 11 lines
wrote: <advertisement> Perhaps you'll become another convert to fpcup... (Remembered your forum post a while ago where you mentioned you didn't use it yet :) Fpcup fiddles with the path so you don't have to (it works e.g. if Delphi make is in your path) and if it doesn't work you can release your frustrations by complaining to me ;) </advertisement>

I forgot to mention earlier that your fpcup worked well! Thanks.

It was running for some time and then there were was a shortcut and it worked.
First I started it without the shortcut, the paths were wrong and I thought it failed again.

If I screw the installation somehow then I cannot do "make clean all" but it is not important now.
I was able to show Lazarus to some people anyway.
I am quite busy with my work and I felt guilty already spending time with the installation.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120616/a5da67da/attachment-0001.html>

Reply by email

Reinier Olislagers
to Juha Manninen
Juha Manninen wrote 13 lines
On Fri, Jun 1, 2012 at 8:41 PM, Reinier Olislagers < <mailto:>> wrote: <advertisement> Perhaps you'll become another convert to fpcup... (Remembered your forum post a while ago where you mentioned you didn't use it yet :) Fpcup fiddles with the path so you don't have to (it works e.g. if Delphi make is in your path) and if it doesn't work you can release your frustrations by complaining to me ;) </advertisement>

Thanks for the feedback, Juha!

I forgot to mention earlier that your fpcup worked well! Thanks.

Glad it worked.... Ludo Brands and I worked on it together, so we'll share the credits :)

If I screw the installation somehow then I cannot do "make clean all" but it is not important now.

If fpcup --clean doesn't work, fpcup --uninstall should... but I must admit uninstall may miss some implementation... more tests and work going on in the installation part ;)
Still, please feel free to come up with bug reports for anything if you want to.
(see e.g. https://bitbucket.org/reiniero/fpcup/issues)

Thanks,
Reinier

Reply by email