mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-19 06:47:41 +00:00
Merge pull request #6696 from keymanapp/fix/developer/kmcomp-package-compiler-race-condition
fix(developer): kmcomp package compiler race condition
This commit is contained in:
commit
deb6695ea0
3 changed files with 11 additions and 5 deletions
|
|
@ -4,7 +4,6 @@ c expected: \U0001F601yx
|
|||
c context:
|
||||
|
||||
store(&version) '10.0'
|
||||
store(&name) '028smp'
|
||||
|
||||
begin Unicode > use(Main)
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ tests = [
|
|||
]
|
||||
|
||||
if build_machine.system() == 'windows'
|
||||
kmcomp = find_program('kmcomp.exe', required: false)
|
||||
kmcomp = find_program(join_paths(meson.source_root(),'..','..','..','windows','bin','developer','kmcomp.exe'), 'kmcomp.exe', required: false)
|
||||
kmcomp_cmd = [kmcomp]
|
||||
copy_cmd = [find_program('cmd.exe', required: true), '/c', 'copy']
|
||||
cat_cmd = [find_program('cmd.exe', required: true), '/c', 'type']
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ function TCompilePackage.Compile: Boolean;
|
|||
var
|
||||
buf: array[0..260] of Char;
|
||||
n: Integer;
|
||||
b: Boolean;
|
||||
f: TSearchRec;
|
||||
begin
|
||||
Result := False;
|
||||
|
|
@ -187,10 +188,15 @@ begin
|
|||
FTempPath := buf;
|
||||
|
||||
GetTempFileName(PChar(FTempPath), 'kmn', 0, buf);
|
||||
FTempPath := buf;
|
||||
if FileExists(FTempPath) then DeleteFile(FTempPath);
|
||||
FTempPath := buf + '.dir';
|
||||
b := CreateDir(FTempPath);
|
||||
if not b then
|
||||
begin
|
||||
FatalMessage('Unable to create temp folder '+FTempPath);
|
||||
if FileExists(buf) then DeleteFile(buf);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CreateDir(FTempPath);
|
||||
try
|
||||
Result := BuildKMP;
|
||||
finally
|
||||
|
|
@ -205,6 +211,7 @@ begin
|
|||
FindClose(f);
|
||||
end;
|
||||
RemoveDirectory(PChar(FTempPath));
|
||||
if FileExists(buf) then DeleteFile(buf);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue