[Scons-users] How to import the env through which was env.SConscript( called
Zarko Berberski (Aditi Staffing LLC)
v-zaberb at microsoft.com
Tue Jun 13 00:02:09 EDT 2017
I do a clone and call Sconcript with that clone, but that connection seems to be lost
> SConsEnvironment.SConscript in SConscript line 541 --- still has self (which is env)
_SConscript in SConscript line 250 --- env connection lost
I can’t import by name since identical scripts needs to build in 2 folders (which may become - variant_dir) => they shouldn’t know which env to import – they should work with the one that’s given to them.
env_LKG = env.Clone()
no_prior, top_LKG = env_LKG.SConscript('ocaml-LKG/ocaml-output.scons')
From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of Bill Deegan
Sent: Monday, June 12, 2017 19:31
To: Mats Wichmann <mats at wichmann.us>
Cc: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] pointer to info on using a project-built tool?
O.k. Do you mean Builder() ? Or something else when you are saying tool?
Is this the bit of logic you expect to have a absolute path?
json2cbor = env.get('BUILD_DIR') + 'resource/csdk/security/tool/json2cbor'
-Bill
On Mon, Jun 12, 2017 at 4:58 PM, Mats Wichmann <mats at wichmann.us<mailto:mats at wichmann.us>> wrote:
On 06/12/2017 01:12 PM, Bill Deegan wrote:
> Any chance you can post any of your code to help better understand your
> issue?
sure, the basics I can put here if it helps. (I was actually hoping
there was some reading somewhere so I didn't need to pester people :)
meanwhile we're talking about the cross-build issue, which I guess is
something separate. That problem is the tool can't really be built "in
isolation" which is what would make more sense for how it wants to be used.
In a generic place, before descending into various subdirectories:
######################################################################
# Generate Cbor from json files
######################################################################
json2cbor = env.get('BUILD_DIR') + 'resource/csdk/security/tool/json2cbor'
def generate_actions(source, target, env, for_signature):
Depends(target, "json2cbor")
return " %s %s %s" % (str(json2cbor), source[0], target[0])
builder = Builder(generator = generate_actions,
suffix = '.dat',
src_suffix = '.json')
env.Append(BUILDERS = {'Cbor' : builder})
In one of those subdirectories, in a tool directory dedicated only to
the conversion tool, which does however needs bits from elsewhere in the
tree:
######################################################################
# Source files and Targets
######################################################################
json2cbor_src = ['json2cbor.c']
json2cbor = tools_env.Program('json2cbor', json2cbor_src)
Alias("json2cbor", [json2cbor])
tools_env.AppendTarget('json2cbor')
and then in a place that has data files which need conversion:
for json_file in Glob('*.json'):
examples += examples_env.Install(svr_db_build_dir, str(json_file))
examples += examples_env.Cbor(json_file)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170613/10f45c97/attachment-0001.html>
More information about the Scons-users
mailing list