View Issue Details

IDProjectCategoryView StatusLast Update
0037141FPCCompilerpublic2020-06-10 15:59
ReporterNetspirit Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionreopened 
Summary0037141: Resource compilling regression since 3.0.0
DescriptionWhen directive {$R} appears in a unit source file *.pp (not project main file) and "-FU" command-line switch used to specify directory for newly compiled units (*.ppu/*.o), then only first compilation finished succesfully.

On next compilations compiler use already compiled units from "-FU" dir and search for resources relative to that dir, but *.res file was specified relative to unit *.pp file, that resides in different dir.

Suggested behavior: when compiler decide to use *.ppu/*.o instead of unit source file, he must first search for resources relative to unit source (if avail) and if not avail - relative to *.ppu.

This bug first appear in FPC 3.0.0, in FPC 2.6.4 and Delphi work correct.
Tested on official win32/cross-win64 binaries for Windows.
Steps To ReproduceSee attached project. Unpack. Edit 'compile.bat' appropriatelly. Execute 'compile.bat' few times.
Tagsresources
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

Netspirit

2020-05-25 11:16

reporter  

Test resource bug.zip (1,833 bytes)

Thaddy de Koning

2020-06-05 20:35

reporter   ~0123244

You need to specify -B when you update resources.

Netspirit

2020-06-09 10:26

reporter   ~0123353

Last edited: 2020-06-09 12:10

View 3 revisions

This will cause all units rebuild? Yes, this is bypass bug (by "emulating" "first compilation"), but is not acceptable solution. Units must rebuild only when they changed, not on every compilation. In FPC 2.6.4 and Delphi subject case work correct.

> when you update resources.

Resource is not updated. Just multiple compilations with exact same conditions have different behaviour.

Michael Van Canneyt

2020-06-10 10:12

administrator   ~0123367

This can not be correct.
The resource file must be where the .ppu file is: the sources may not even be available when compiling.

Delphi behaves the same: you must copy the .res file to where the DCU files are, I did it hundreds of times.

Netspirit

2020-06-10 13:56

reporter   ~0123376

Not agree.

> The resource file must be where the .ppu file is
Yes. When "the sources may not even be available when compiling".

Need one step before: "When sources avail - search for resources relative to sources". If not found or not avail - search relative to *.ppu instead.


> Delphi behaves the same: you must copy the .res file to where the DCU files are

I just check it now in Delphi 2007: no, *.res file placed near unit *.pas file, *.dcu's go to subdir, all compilations succesfull, no need manually copying something.

In FPC we have the unchanged project, unchanged build script (command line) - and got different results (actually - error) between two compilations. Is it good for you?

Michael Van Canneyt

2020-06-10 15:59

administrator   ~0123380

I reopened, and will let the compiler people decide.

Issue History

Date Modified Username Field Change
2020-05-25 11:16 Netspirit New Issue
2020-05-25 11:16 Netspirit File Added: Test resource bug.zip
2020-05-25 12:12 Netspirit Tag Attached: resources
2020-06-05 20:35 Thaddy de Koning Note Added: 0123244
2020-06-09 10:26 Netspirit Note Added: 0123353
2020-06-09 12:09 Netspirit Note Edited: 0123353 View Revisions
2020-06-09 12:10 Netspirit Note Edited: 0123353 View Revisions
2020-06-10 10:12 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-06-10 10:12 Michael Van Canneyt Status new => resolved
2020-06-10 10:12 Michael Van Canneyt Resolution open => no change required
2020-06-10 10:12 Michael Van Canneyt FPCTarget => -
2020-06-10 10:12 Michael Van Canneyt Note Added: 0123367
2020-06-10 13:56 Netspirit Note Added: 0123376
2020-06-10 15:59 Michael Van Canneyt Status resolved => new
2020-06-10 15:59 Michael Van Canneyt Resolution no change required => reopened
2020-06-10 15:59 Michael Van Canneyt Note Added: 0123380