[Scons-users] Forcing projects to build in order

Sven Lars Tobias Stål smp428 at alumni.ku.dk
Fri Aug 7 06:54:42 EDT 2015


Dear all,

I’d like to second that wish. The option to pin processes to run first or last would be very useful also in other applications, especially for us who are not experts in compilation and construction tools.

I’m using Scons only to build reproducible processing flows for geophysical data. SCons is really great for the purpose of many reasons! However, processing times are often long and it would be fantastic to be able to e.g. run a python code to notify when it’s done, or the run a conversion program for all results, without having to name them all. A process pinned to the beginning of the SConstruct flow would be useful to inform the user of the process and, especially, check some parameters instead of forcing halt in the middle of the process, when I’m not in office. Some Boolean operations to name files and set parameters would also be very useful to run before the construction starts and it would be useful to force a file to be processed first, so that I can check the result without running all processes.

For now, I’m managing by constructing empty files that have ‘artificial' dependencies, but it causes confusion for other users - and for me and adds a lot of lines. I also tried to run SConst as a subprocess to a  script, but that really feels like complicating things.

I do understand that such function is somehow violating the principle of dependency order, but I’d guess that it could be easy to implement and, for those who are better at using construction tools, easy to just to leave out.

All the best
Tobbe



On 07 Aug 2015, at 11:22 , Ora <orshalev at gmail.com<mailto:orshalev at gmail.com>> wrote:

Hi,

During a few of the build steps the script calls various tools which MUST be run in a specific directory.  That is not something I can change at this point.

Each such step is defined as its own builder which changes the directory and runs the required tool.

However, when running with the '-j' option, Scons tries to run several such steps in parallel, and therefore, tries to execute commands in the wrong directory.

I cannot avoid parallelism altogether as it it would make my script run for so long, it would be useless.
I cannot avoid changing directories.

I wish SCons would handle changing directories properly on its own, but I understand that's not going to happen.

I am therefore looking for a solution to this problem by partially limiting parallelism so that the builder steps / projects which change directory would not be called in parallel with other builders.


Ora

On Thu, Aug 6, 2015 at 7:11 PM, William Blevins <wblevins001 at gmail.com<mailto:wblevins001 at gmail.com>> wrote:

On Thu, Aug 6, 2015 at 11:09 AM, Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>> wrote:


On Thu, Aug 6, 2015 at 8:04 AM, William Blevins <wblevins001 at gmail.com<mailto:wblevins001 at gmail.com>> wrote:
I cannot think of many (if any) good reasons to perform CWD.

Can you modify your build to work without?
On Thu, Aug 6, 2015 at 10:26 AM, Bill Deegan <bill at baddogconsulting.com<mailto:bill at baddogconsulting.com>> wrote:
Ora,

Why do you want to force build order and/or limit parallelism?


He is performing "change working directory" commands which cause issues with parallel builds.

When I run into those I typically do env.Command(target,source,"cd xyz; do actual command")  or wrap said command in a script and run that from the command.

That makes sense.  Keeps the CWD commands outside the SCons context :)


-Bill

On Thu, Aug 6, 2015 at 3:58 AM, Ora <orshalev at gmail.com<mailto:orshalev at gmail.com>> wrote:
Hi,

My script builds several different projects which are not necessarily related.   How can I force those projects to build in a certain order?

That is, I have three projects: a, b and c.
I want 'b' to start building only after 'a' finishes, and for 'c' to start building only after 'b' finishes.

This is necessary in order to avoid problems with changing directories during parallel builds.

I tried using 'Requires', with every target requiring the target before it.
Requires (b, a)
Requires (c, b)

But that doesn't solve the problem because, if I understood correctly, it only tells Scons that it should finish building 'a' before it finishes building 'b', and doesn't prevent it from compiling both projects at the same time.

Any suggestions on how to deal with this issue would be appreciated.

Thanks in advance,
Ora

_______________________________________________


_______________________________________________
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


_______________________________________________
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/20150807/5eb54b29/attachment-0001.html>


More information about the Scons-users mailing list