View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0036261||Lazarus||IDE||public||2019-11-04 18:17||2019-11-08 19:19|
|Reporter||Markus Müller||Assigned To||Mattias Gaertner|
|Summary||0036261: Build the IDE fails|
|Description||After installation from a new Lazarus 2.0.6 the command "Tools" > "Build Lazarus with profile..." fails with the error in the "Message:|
Build IDE: Exit code 2, Errors: 1
Fatal: Unable to open file C:UsersmmAppDataLocallazarusidemake.cfg -dx86_64
I have find out the mistake why lazarus cannot build itself and a solution for you to implement/correction.
|Steps To Reproduce||1. Unzip the "WinARM_Bin.zip" into a new folder (there are old make tools from an other program)|
2. Add this folder to the system PATH variable
3. Logout and login again
4. Install Lazarus V2.0.6
5. Menu from Lazarus: "Tools" > "Build Lazarus with profile..."
|Additional Information||Lazarus do not use the self installed make tool at first rank, so the make use old files where do not work correct with lazarus. With this 2 changes the lazarus build process works right:|
1) The file "sh.exe" is missing after the installation from lazarus:
This tool need make itself and older "sh.exe" do not work correctly with lazarus.
Hint: FpcUpDeluxe download itself a correct version from this tool an use it.
2) In the makefile is the search sequenze to find the files in a bad order and the file "sh.exe" is not searched.
I have correct this and change build from SEARCHPATH to fill first the from lazarus installed folder, then add the PATH.
At second search the correct "sh.exe" into MAKESHELL and if found set the SHELL variable
BUT: when I do this change manually in the makefile, the build process from lazarus do not work, I thing Lazarus use a other makefile or build a makefile for his self build process.
For testing which files the make system will use try this command in the command line:
For testing where do the system want find a file you can try this command:
|Fixed in Revision||62207.|
Makefile.zip (28,813 bytes)
WinARM_bin.zip (1,960,478 bytes)
1) sh.exe is not missing. FPC nor Lazarus afaik have ever distributed it. It is not needed.
2) is thus not necessary.
If you get errors about sh.exe missing you are probably mixing FPC distributed tools with other ones. Clean up your path.
INFO: Could not find files for the given pattern(s).
Thank you very much for answer.
Please, try the "Steps To Reproduce" 1..3, after them try the command "where sh.exe"
My PATH environment is OK, I must have it to comile older STM32 µC projects.
Here is the documentation from the make tool, it use "sh.exe" itself, and if the make tool find a old version in the PATH, the make with lazarus does not work. In this case helb only when lazarus install and use a newer version from sh.exe.
Here the doku for "Choosing a Shell in DOS and Windows":
There are two threads in forums about this:
I am not an expert here, but I would like to say that no FPC folder is found in my system path (Win 10). I have several versions of Delphi on my machine which heavily "contaminate" the path by Borland/Emabarcadero versions of Make. Of course, when I build Laz or FPC from the command line I do this in a batch file which sets the path to the FPC/bin directory first. Building Laz from the IDE does not require such a manipulation - I never saw the issue reported here. It is definitely not a bug of Laz or FPC make files in my opinion.
About: "Lazarus do not use the self installed make tool at first rank,"
It should and it does here. In my PATH the Delphi make.exe is found first, and building via the IDE still works, because in Tools / Options / Make executable the full path is set C:\lazarus\fpc\3.0.4\bin....
What value is your Make "executable"?
||No quotes for idemake.cfg. Please test and close if ok.|
||Had the same issue. Tested with Lazarus 2.0.4 and 2.0.6. The problem was resolved after removing MiniGW from the PATH.|
Thank you very much for the fast fix the file "buildlazdialog.pas:857". I have load the trunk with FPCUpDeluxe and test it.
Now the compile from lazarus works good.
But my hint to your change, I have do a second test:
I type the command for check the tools where want the build process use:
: : :
: : :
You can see, the makefile found some other GNU build tools on the harddisc where are in the PATH variable (D:\WinARM\make-tools\bin\...).
Currently it is not a problem, but if you have to make more profound changes to the make process it can become a problem. I close the ticket, because currently it is not a problem. ;-)
||Good work, Thank you very much!|
@Mattias Gärtner: About your question:
"What value is your Make "executable"? "
The "make" ist not the problem. The problem ist the file "sh.exe", lazarus do not install this file and if make found a other on the disk, the make use it.
Now I will close, sorry I want write the answer from your question and I must reopen this ticket :-(
The information "sh.exe" is important.
So, the bug will reappear on systems, where mingw is installed in PATH and there is some path with spaces.
Is there some sh.exe, that we can ship to avoid this trouble?
Before you fix the quoting, there was the trouble with old sh.exe, the old sh.exe has not work correctly with quoted strings.
FpcUpDeluxe download into "C:\fpcupdeluxe\fpcbootstrap\git\usr\bin" a newer version from sh.exe and do not use the PATH for search in the system.
This technik can be a solution for Lazarus, install the same sh.exe into "C:\lazarus\fpc\3.0.4\bin\x86_64-win64" and use not the system PATH in the makefile.
sh.exe is a command line interpreter, bash is a command line interpreter, cmd.exe, too. every interpreter has features.
make do not need sh.exe as command line interpreter, if it is not installed, then make use cmd.exe from windows, but make is automatically looking in PATH for sh.exe, and if there was found a old installation, then make do automatically use this and nothing else. This is a built in feature from make. you can only overwrite in the makefile the SHELL variable with a self installed sh.exe to fix this problem, but you can't clear the SHELL variable to a empty string.
A example for this fix I have write in the download in my first posting, look in my "makefile", the variable MAKESHELL.
I hope it help to understand how the make / makefile works in a windows system.
This is a very interesting discussion.
However, your presumption about fpcupdeluxe using sh.exe from "C:\fpcupdeluxe\fpcbootstrap\git\usr\bin" is wrong.
Fpcupdeluxe isolates itself. The path is changed to prevent pickup of wrong tools.
During a run, fpc_baseinfo shows
Look at the value of Shell ... its not found !!
However, I am now preparing an update of fpcupdeluxe to set shell on Windows to the value of COMSPEC.
In an effort to try to isolate even more !
Here are my infos:
Why it use zip.exe from windows folder?
Especially for you, I have made a pre-release.
In the ExtraSheet, there are two additional buttons.
To check both then FPC as well as the Lazarus Makefile.
Please report back your findings.
For a better unterstand the make system, open a Dos-Box "cmd" and do this steps:
- go into \Lazarus folder (from installation 2.0.6/Win64)
- Create a Folder C:\TestPath
- overwrite the PATH variable from the current session to C:\TestPath
- create dummy files: rm.exe, sh.exe, zip.exe
- show system whitch files will the make found
echo 1 > C:\TestPath\rm.exe
echo 1 > C:\TestPath\sh.exe
echo 1 > C:\TestPath\zip.exe
The make system found this files:
: : :
: : :
... please let the Dos-Box open for the next test ...
What is happen?
The make looks very limple in the PATH only to the file names, This 3 where are created are only small textfilse with a size of 4 byte.
How can I change that the make do first look in to installation folder from lazarus?
In the makefile from C:\Lazarus, the variable "SEARCHPATH" hold all path folders additional the make path itself. In the current version from Lazarus is first set the "SEARCHPATH" with PATH and in second order the Lazarus MAKE path.
It is very simple to change the order from this, set first in the SEARCHPATH the MAKE pathe, then add the other PATH to SEARCHPATH:
SEARCHPATH:=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
ifneq ($(findstring darwin,$(OSTYPE)),)
SEARCHPATH+=$(filter-out .,$(subst :, ,$(PATH)))
ifeq ($(findstring ;,$(PATH)),)
SEARCHPATH+=$(filter-out .,$(subst :, ,$(PATH)))
SEARCHPATH+=$(subst ;, ,$(PATH))
Please change this makefile to the makefile from my zip, there is the change done (my first posting)
After them go to the Dos-Box again and try the command again:
The make system found this files:
: : :
: : :
Ok, it's a litte bit better, the file "rm.exe" is found in the Lazarus installation.
In second order, the files sh.exe and zip.exe are not installed by Lazarus, then the make build is using this 2 dummy files.
If you unterstand this tutorial for make, the I write the second tutorial for the right way in the makefile to find sh.exe.
I have download the new EXE "fpcupdeluxe-x86_64-win64.exe" from your link and delete all files from "C:\fpcupdeluxe".
I report back the findings, see the screenshots...
If you want and it helps, you can looking with TeamViewer into my Computer and compile what you want.
But I have a question to you: Why do you want to use the "cmd.exe", "CMD.exe" works not the same like "SH.EXE".
You download the "SH.EXE" into the folder "C:\fpcupdeluxe\fpcbootstrap\git\usr\bin\", you have to try only set in the makefile the SHELL to "C:\fpcupdeluxe\fpcbootstrap\git\usr\bin\sh.exe" and all will be work right.
|2019-11-04 18:17||Markus Müller||New Issue|
|2019-11-04 18:17||Markus Müller||File Added: Makefile.zip|
|2019-11-04 18:17||Markus Müller||File Added: WinARM_bin.zip|
|2019-11-04 18:21||Markus Müller||Tag Attached: Makefile|
|2019-11-04 18:22||Markus Müller||Tag Attached: make|
|2019-11-04 23:42||Marco van de Voort||Note Added: 0119064|
|2019-11-04 23:43||Marco van de Voort||Note Edited: 0119064||View Revisions|
|2019-11-05 07:55||Markus Müller||Note Added: 0119067|
|2019-11-05 12:25||Markus Müller||Note Edited: 0119067||View Revisions|
|2019-11-05 12:26||Markus Müller||Note Edited: 0119067||View Revisions|
|2019-11-05 12:27||Michl||Note Added: 0119069|
|2019-11-05 16:17||wp||Note Added: 0119075|
|2019-11-06 16:25||wp||Note Edited: 0119075||View Revisions|
|2019-11-06 17:03||Mattias Gaertner||Note Added: 0119103|
|2019-11-06 17:14||Mattias Gaertner||Assigned To||=> Mattias Gaertner|
|2019-11-06 17:14||Mattias Gaertner||Status||new => resolved|
|2019-11-06 17:14||Mattias Gaertner||Resolution||open => fixed|
|2019-11-06 17:14||Mattias Gaertner||Fixed in Revision||=> 62207.|
|2019-11-06 17:14||Mattias Gaertner||LazTarget||=> -|
|2019-11-06 17:14||Mattias Gaertner||Widgetset||Win32/Win64 => Win32/Win64|
|2019-11-06 17:14||Mattias Gaertner||Note Added: 0119104|
|2019-11-07 15:16||Vasileios Vlachos||Note Added: 0119137|
|2019-11-07 18:26||Markus Müller||Note Added: 0119144|
|2019-11-07 18:27||Markus Müller||Status||resolved => closed|
|2019-11-07 18:27||Markus Müller||Note Added: 0119145|
|2019-11-07 18:35||Markus Müller||Status||closed => assigned|
|2019-11-07 18:35||Markus Müller||Resolution||fixed => reopened|
|2019-11-07 18:35||Markus Müller||Note Added: 0119146|
|2019-11-07 18:37||Markus Müller||Note Added: 0119147|
|2019-11-07 19:33||Mattias Gaertner||Note Added: 0119148|
|2019-11-07 22:42||Markus Müller||Note Added: 0119149|
|2019-11-07 22:54||Markus Müller||Note Edited: 0119149||View Revisions|
|2019-11-08 00:12||Markus Müller||Note Edited: 0119149||View Revisions|
|2019-11-08 08:46||Alfred||Note Added: 0119153|
|2019-11-08 14:55||Maik||Note Added: 0119159|
|2019-11-08 14:56||Maik||Note Edited: 0119159||View Revisions|
|2019-11-08 17:18||Alfred||Note Added: 0119164|
|2019-11-08 17:59||Markus Müller||Note Added: 0119167|
|2019-11-08 18:02||Markus Müller||Note Edited: 0119167||View Revisions|
|2019-11-08 18:04||Markus Müller||Note Edited: 0119167||View Revisions|
|2019-11-08 19:08||Markus Müller||File Added: FpcUpDeluxe01.png|
|2019-11-08 19:08||Markus Müller||File Added: FpcUpDeluxe02.png|
|2019-11-08 19:08||Markus Müller||File Added: FpcUpDeluxe03.png|
|2019-11-08 19:08||Markus Müller||Note Added: 0119168|
|2019-11-08 19:15||Markus Müller||Note Edited: 0119168||View Revisions|
|2019-11-08 19:19||Markus Müller||Note Edited: 0119168||View Revisions|