[Scons-users] Code generation in SCons

Arvid Rosén arvid at softube.com
Tue Apr 28 10:13:49 EDT 2020


Alright, thanks for the information!

Maybe I should take a look at this again, and finally get rid of our (not as clever) workarounds.

Cheers,
Arvid

From: Scons-users <scons-users-bounces at scons.org> on behalf of Bill Deegan <bill at baddogconsulting.com>
Reply to: SCons users mailing list <scons-users at scons.org>
Date: Friday, 24 April 2020 at 17:18
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] Code generation in SCons

We believe that issues been resolved by the migration to Python 3.5+ as they improved some file i/o issues.
In addition we have an issue filed with another method to resolve, basically a post action which does nothing but wait until the file is writable.  (See:https://github.com/SCons/scons/issues/3592)
(Very clever)


On Thu, Apr 23, 2020 at 11:32 PM Arvid Rosén <arvid at softube.com<mailto:arvid at softube.com>> wrote:
There used to be issues with massive parallel builds and generated files on Windows. SCons would handle the dependencies correctly, but something with Python on Windows made the synchronization between threads unreliable so that the compiler would try to open the .c file for reading too early, and would get a permission error.

I think this only happened when the .c file was written by Python though, and not by external tools.

This might be fixed now, but I spent lots of time on it to implement workarounds, so watch out!

Cheers,
Arvid


From: Scons-users <scons-users-bounces at scons.org<mailto:scons-users-bounces at scons.org>> on behalf of Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>>
Reply to: SCons users mailing list <scons-users at scons.org<mailto:scons-users at scons.org>>
Date: Thursday, 23 April 2020 at 21:00
To: SCons users mailing list <scons-users at scons.org<mailto:scons-users at scons.org>>
Subject: Re: [Scons-users] Code generation in SCons

Erik,

Please take a look at the yacc builder.

It has similar functionality in that it reads a source file and spits out .c and .h files.
SCons is fully capable of "doing the right thing" in such cases if the builder is properly constructed.

-Bill

On Thu, Apr 23, 2020 at 7:42 AM Mats Wichmann <mats at wichmann.us<mailto:mats at wichmann.us>> wrote:
Someone else will hopefully help... this is the sort of thing I *believe* Depends() was intended for. And emitters. Also, there's a protobuf builder or two floating around somewhere if that helps (see the wiki)
On April 23, 2020 7:49:05 AM MDT, Erik Kazandjian <erik.kazandjian at gmail.com<mailto:erik.kazandjian at gmail.com>> wrote:
I start from a YANG file. From that file I create proto fiels for Google protobuf and heade files. These files are than given to 'standard' builders who generate libraries out of them. But as said before because these proto files and C files (both .c and .h) get generated SCons can not pick them up the first time as they are not there, the second time he considers them to have changed only the thirds time Scons sees that the files are identical and doesn't build them any longer. Is there a way to recalculate the md5 database after building ?

On Thu, 23 Apr 2020 at 15:14, Mats Wichmann <mats at wichmann.us<mailto:mats at wichmann.us>> wrote:
On 4/23/20 2:21 AM, Erik Kazandjian wrote:
> Hi,
>
> I've created a builder that generates C code nad header files from a
> yang file. The problem I'm having is the first I build these c and h
> files are not there so scons rebuilds them , but than the second time
> when I build scons decides that the C and header files have changes and
> so it rebuilds again generating the exact same c and h file, do only the
> third time it builds it decide bot to rebuild anything. Is there a way
> in scons to get around this or do I have to write a custom decider myself ?

Since there's existing practice (lex, swig and yacc included with SCons
itself as well as external efforts), there should be a way to get it to
work. Perhaps if you share what you're doing?  There is a bit of
plumbing to get hooked up.




_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users
_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20200428/03835aab/attachment-0001.html>


More information about the Scons-users mailing list