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

Detect missing files with trailing space on Windows #14145

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions mesonbuild/interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3179,6 +3179,8 @@ def source_strings_to_files(self, sources: T.List['SourceInputs'], strict: bool
results: T.List['SourceOutputs'] = []
for s in sources:
if isinstance(s, str):
if s.endswith(' '):
raise MesonException(f'{s!r} ends with a space. This is probably an error.')
if not strict and s.startswith(self.environment.get_build_dir()):
results.append(s)
mlog.warning(f'Source item {s!r} cannot be converted to File object, because it is a generated file. '
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/utils/universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def __repr__(self) -> str:

@staticmethod
@lru_cache(maxsize=None)
def from_source_file(source_root: str, subdir: str, fname: str) -> 'File':
def from_source_file(source_root: str, subdir: str, fname: str) -> File:
if not os.path.isfile(os.path.join(source_root, subdir, fname)):
raise MesonException(f'File {fname} does not exist.')
return File(False, subdir, fname)
Expand Down
Loading