fppkg always searches for fpc.exe, even on non-Windows platforms
Original Reporter info from Mantis: leledumbo_cool@yahoo.co.id @leledumbo
-
Reporter name: Mario Ray Mahardhika
Original Reporter info from Mantis: leledumbo_cool@yahoo.co.id @leledumbo
- Reporter name: Mario Ray Mahardhika
Description:
Upon executing fppkg &LtPos;something except help> for the first time on non-Windows platform, the tool always responds with:
The FPC Package tool encountered the following error:
Could not find a fpc executable in the PATH
Steps to reproduce:
Clean install
Execute fppkg list
Additional information:
The cause might be at this method (pkgoptions.pp:674):
procedure TCompilerOptions.InitCompilerDefaults;
var
ACompilerVersion: string;
fpcdir: string;
begin
FConfigVersion:=CurrentConfigVersion;
if fcompiler = '' then
FCompiler:=ExeSearch('fpc'+ExeExt,GetEnvironmentVariable('PATH'));
if FCompiler='' then
Raise EPackagerError.Create(SErrMissingFPC);
As can be seen, ExeExt is appended regardless current platform, while ExeExt itself is defined in fpmkunit.pp:209 as '.exe' for all platforms.
This can also be proven by creating symlink named fpc.exe in PATH, that will make fppkg runs well and create its config directory.
One thing that's weird, if the config directory exists, then removing the symlink won't trigger the problem again despite in the config file the compiler name still has .exe suffix.
Mantis conversion info:
- Mantis ID: 24800
- Build: 25183
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 26750 (#ff985ba9)
- Target version: 3.0.0