View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0037353||Lazarus||Compiler||public||2020-07-14 22:10||2020-09-03 09:05|
|Reporter||josiasmat||Assigned To||Juha Manninen|
|Status||resolved||Resolution||unable to reproduce|
|Summary||0037353: Do 'Execute before' command before loading resource files|
|Description||Currently, when you compile a project in Lazarus (Windows), it first locates the resource files to be embedded into the executable, and after this it runs the 'Execute before' command (this can be set in the Project Options dialog).|
I think the correct behaviour should be the inverse: first run the 'Execute before' command, and then load the resource files.
This has implications for my use-case: I use the 'Execute before' in one of my projects to compress some resource files, and then I load the compressed resources into my executable file. But, if I change one of my resources, and then compile my project in Lazarus, it will run the compress command only after loading the existent file. So to have the updated file I need compress it manually before, or instruct Lazarus to compile two times.
|Tags||No tags attached.|
|Fixed in Revision|
@josiasmat, I need some way to reproduce the issue. Please get Lazarus trunk (development version) to test.
The code in function TMainIDE.DoBuildProject() looks correct. It is a long method but most of it is validation and error checking.
Line 7037 has the "execute before" call.
Line 7086 compiles, TheCompiler.Compile(...).
Dependent packages are built before the "execute before" stuff but it should be ok.
The compiler, FPC, embeds resources into the executable. Are you saying that it uses some old version of your resource even you have changed it in "execute before" call?
Could it be a disk cache issue?
@JuhaManninen, on "execute before" I actually call a command that (re)creates the resources. So, what happens is, if the resource file does not exist yet, the IDE throws an error message.
I will try to make a sample project here and attach here that reproduces this.
> So, what happens is, if the resource file does not exist yet, the IDE throws an error message.
It means you can verify the "execute before" was run correctly by deleting the file beforehand. Compilation will succeed only if the file was created before it.
@josiasmat, please give more information. Otherwise this will be resolved as "unable to reproduce".
||Yes I will make a sample project, but currently I'm a little busy with other projects, please give me some days! Thanks!|
Resolving now. Please reopen if you find ways to reproduce.
|2020-07-14 22:10||josiasmat||New Issue|
|2020-08-13 17:05||Juha Manninen||Assigned To||=> Juha Manninen|
|2020-08-13 17:05||Juha Manninen||Status||new => assigned|
|2020-08-13 21:11||Juha Manninen||Note Added: 0124856|
|2020-08-13 21:12||Juha Manninen||Status||assigned => feedback|
|2020-08-13 21:12||Juha Manninen||LazTarget||=> -|
|2020-08-13 21:45||josiasmat||Note Added: 0124858|
|2020-08-13 21:45||josiasmat||Status||feedback => assigned|
|2020-08-14 11:24||Juha Manninen||Note Added: 0124871|
|2020-08-20 13:55||Juha Manninen||Status||assigned => feedback|
|2020-08-20 13:55||Juha Manninen||Note Added: 0125015|
|2020-08-20 14:04||josiasmat||Note Added: 0125017|
|2020-08-20 14:04||josiasmat||Status||feedback => assigned|
|2020-09-03 09:05||Juha Manninen||Status||assigned => resolved|
|2020-09-03 09:05||Juha Manninen||Resolution||open => unable to reproduce|
|2020-09-03 09:05||Juha Manninen||Widgetset||Win32/Win64 => Win32/Win64|
|2020-09-03 09:05||Juha Manninen||Note Added: 0125334|