Re: Order of execution of a one-file builder

"Javier Llopis" <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <[email protected]>
Thanks for the suggestion, however I still have the issue.

My SConscript file is now:

instexe = env.Installer(installer_name, "InstallEncVPG.nsi") # NSIS
builder from Contributed Builders page
if must_sign:
    instexe = env.AddPostAction(instexe, env.Sign(instexe, KEYFILE=keyfile, PASSWORD=password))
env["installer"] = instexe
Return("env")

I'm using the builder as the action. The documentation for AddPostAction says the action can be anything that can be converted to an action; I guess a builder can, since the file gets signed albeit in the wrong order.

J

----------------------------------------
From: Mats Wichmann <[email protected]>
Sent: 11/22/22 5:37 PM
To: [email protected]
Subject: Re: [Scons-users] Order of execution of a one-file builder
On 11/22/22 09:57, Javier Llopis wrote:
> Hello All,
>
> I have written a builder around SignTool.exe, a program that comes with
> Visual Studio which digitally signs an executable or a DLL, and have
> included it in the build system for a piece of software that I have written.
>
> The problem is that the input and output of the builder are the same
> file, i.e. the builder just runs SignTool on the source[0] parameter and
> the target is the same file which can create the problem below.
>
> This is my code (the relevant parts):
>
> # on SConscript
> instexe = env.Installer(installer_name, "InstallEncVPG.nsi") # NSIS
> builder from Contributed Builders page
> if must_sign:
>     env.Sign(instexe, KEYFILE=keyfile, PASSWORD=password)
> env["installer"] = instexe
> Return("env")
>
> #on SConstruct
> env = SConscript("Installer/SConscript", exports=["env"])
> Install("distrib", env["installer"])
>
> Since the input and output are the same, scons apparently doesn't seem
> to know when a file is 'ready'.
>
> The issue I am running into is that the actions are done in the wrong
> order: The 'instexe' is built on SConscript, then Install copies it to
> the 'distrib' directory on SConstruct, then Sign on SConscript signs it
> on the original directory, so the installer on 'distrib' is unsigned.
>
> I cannot reproduce the issue on a smaller script. I tried to write an
> illustrative, simpler example but then the issue doesn't happen. Only on
> the big builds.
>
> Is there any way I can force an order of execution?

SCons is always going to have trouble if the soruce and target are the same.

The typical approach in this case - where you need to modify a target in
place - is to use AddPostAction.

Can you check if that will work for you?

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.