Skip to content

Commit

Permalink
Fix waf code to work with SDK 3.13
Browse files Browse the repository at this point in the history
From a discussion on Slack with @girlgrammer:

i think what happened is task.env.RESOURCE_ID_HEADER was changed from
being a node to an absolute path. in the old sdk code, you would append
something to be scanned by using

    nodes.append(task.env.RESOURCE_ID_HEADER)

in 3.13+, this became:

    nodes.append(get_node_from_abspath(task.generator.bld, task.env.RESOURCE_ID_HEADER))

where the method get_node_from_abspath is

    def get_node_from_abspath(ctx, path):
        return ctx.root.make_node(path)

if you can replicate the sdk change in your own waftool, that should fix
your problem

when i rebuild with that change to pebble_cxx.py, i get other compiler
errors

hrm, that’s unfortunate

there was some internal discussion over whether to try to make nodes
continue to work, or to switch to abspath

we went with abspath, but i don’t know if that might change in the
future (sorry)

it’s a bit tricky because there are buggy wscript files out there that
mess with the envs when they’re not supposed to, and until we decide to
force upgrade everyone, there are some weird hacks we have to do to make
sure normal builds don’t break

feel free to poke me anytime something is going weirdly with waf or our
build system
  • Loading branch information
thirtythreeforty committed Jul 2, 2016
1 parent 2d99eaf commit e62dc92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion waftools/pebble_cxx.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ def fix_pebble_h_dependencies(task_gen):
from waflib.Tools import cxx, c_preproc

def wrap_c_preproc_scan(task):
def get_node_from_abspath(ctx, path):
return ctx.root.make_node(path)

(nodes, names) = c_preproc.scan(task)
if 'pebble.h' in names:
nodes.append(task.env.RESOURCE_ID_HEADER)
nodes.append(get_node_from_abspath(task.generator.bld, task.env.RESOURCE_ID_HEADER))
return (nodes, names)

for task in task_gen.tasks:
Expand Down

0 comments on commit e62dc92

Please sign in to comment.