Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewriter: Handle unknown write targets #13952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions mesonbuild/rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,21 @@ def process_kwargs(self, cmd):
arg_node = node.args
elif cmd['function'] == 'target':
tmp = self.find_target(cmd['id'])
if tmp:
node = tmp['node']
arg_node = node.args
if not tmp:
mlog.error('Unable to find the target', mlog.bold(cmd['id']), *self.on_error())
return self.handle_error()
node = tmp['node']
arg_node = node.args
elif cmd['function'] == 'dependency':
tmp = self.find_dependency(cmd['id'])
if tmp:
node = tmp['node']
arg_node = node.args
if not tmp:
mlog.error('Unable to find the dependency', mlog.bold(cmd['id']), *self.on_error())
return self.handle_error()
node = tmp['node']
arg_node = node.args
if not node:
mlog.error('Unable to find the function node')
mlog.error('Unable to find the function node', *self.on_error())
return self.handle_error()
assert isinstance(node, FunctionNode)
assert isinstance(arg_node, ArgumentNode)
# Transform the key nodes to plain strings
Expand Down
Loading