Re: [Vala] Rules for updating generated C files



Same here

Can you open a bug for this?

I would prefer timestamps instead of checksums.

Another idea would be to make vala return 0 or 1 like 'test' do. So it would be integrated with Makefiles.

It would be also useful to make vala print out which files has changed:

$ valac --check a.vala b.vala...
a.vala

This method would be easily integrated with makefiles.

--pancake

On Jun 3, 2010, at 11:24 PM, Arc Riley <arcriley gmail com> wrote:

Please do.  "This bug affects me too."

On Thu, Jun 3, 2010 at 5:13 PM, Robert Powell <rob yorba org> wrote:

Hello,

My understanding of the current rule for generating a C file from a vala
file is, if the contents of the C file has the same hash value, don't
rewrite the file. When dealing with larger systems using libraries, this
rule may not be sufficient.

I've attached an example program that illustrates the problem I describe
below.  To exhibit the problem:
1. execute make
2. execute ./main.  Note the output.
3. comment out the variable comment_and_uncomment_me in file
BaseClass.vala.  Remember to save.
4. execute make
5. execute ./main.  Note the output is different and wrong.

What is going on here
-------------------------------
We have a library BaseClass.vapi that is generated from BaseClass.vala. This defines the class BaseClass. We also have Derived.vala, which defines
a class that derives from BaseClass.

If a member variable is added to BaseClass, BaseClass.vapi will change.
The
C file that is generated from Derived.vala will be identical, but it needs
to be recompiled because the base class has changed.  valac will not
regenerate Derived.c because it hasn't changed.

I propose that if the C file (Derived.c in this instance) that is generated has the same hash value as the existing C file BUT the corresponding vala file (Derived.vala) imports anything from a vapi (BaseClass.vapi) that has an earlier timestamp, the C file (Derived.c) should be touched. Does valac
have enough of this information to perform this check?

For this simple system, it would be easy enough to update the makefile to watch for this dependency. For larger systems, however, I could see that this could quickly get much more complex and error-prone. I think that
with
the addition of this rule, it avoids this dependency problem.

Is this a reasonable request?  Shall I file a bug?

Thanks

Rob

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list


_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]