AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

Initialize the record of temp file paths to be deleted. #22

Closed simonjwright closed 7 years ago

simonjwright commented 7 years ago

This proposed change is in response to AdaCore/xmlada#3, where building a relocatable library using a recent gprbuild built with GNAT GPL 2016 (or GCC 6.1.0) resulted in

raised CONSTRAINT_ERROR : g-dyntab.adb:259 access check failed
gprbuild: could not build library for project xmlada_unicode

This problem arose with 5f98f94, where Temp_Files was added to gpr.adb but not initialized (i.e. only default-initialized). Other instances of GNAT.Dynamic_Tables are used in the code, but they are all initialized (using GNAT.Dynamic_Tables.Init). It appears that a default-initialized instance works without an explicit Init in GCC 7, and, I’m sure, AdaCore’s current compilers.

pmderodat commented 7 years ago

Awesome, thank you very much for this fix, but also for the helpful explanation, @simonjwright!

simonjwright commented 7 years ago

Glad to help!

I think if I’d been writing gprbuild I’d have gone with Ada.Containers.Vectors throughout rather than GNAT.Dynamic_Tables.

t-14 commented 7 years ago

Oh assuredly. The original implementation was heavily derived from GNAT's own Ada frontend infrastructure, which has driven the design choices. But in parallel to using the current gpr engine, we are working on a long-term evolution of it, based on langkit. It is on our list to put the current WIP state on github, which should hopefully happen soon. The new system indeed makes use of various Containers.