Skip to content

Commit

Permalink
build: simplify validation of BuildTarget(extra_files: )
Browse files Browse the repository at this point in the history
There is some validation going on here that cannot (currently) be done
the KwargInfo validators, namely that the files exist. Additionally,
BuildTarget.extra_files is doing some membership checking for dups,
which means it should probably be an OrderedSet instead of a list.
  • Loading branch information
dcbaker committed Jan 13, 2025
1 parent be83a7d commit 8e937b1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,8 @@ def process_kwargs(self, kwargs: BuildTargetKeywordArguments) -> None:
(str, bool))
self.install_mode = kwargs.get('install_mode', None)
self.install_tag = stringlistify(kwargs.get('install_tag', [None]))
extra_files = extract_as_list(kwargs, 'extra_files')
extra_files = kwargs.get('extra_files', [])
for i in extra_files:
assert isinstance(i, File)
if i in self.extra_files:
continue
trial = os.path.join(self.environment.get_source_dir(), i.subdir, i.fname)
Expand Down

0 comments on commit 8e937b1

Please sign in to comment.