Merge pull request #5942 from scivision/duck
interpreter: raise Meson exception when non-found module is used anyway
This commit is contained in:
commit
ae9723a5c1
|
@ -2388,6 +2388,8 @@ external dependencies (including libraries) must go to "dependencies".''')
|
||||||
msg = 'Program {!r} was overridden with the compiled executable {!r}'\
|
msg = 'Program {!r} was overridden with the compiled executable {!r}'\
|
||||||
' and therefore cannot be used during configuration'
|
' and therefore cannot be used during configuration'
|
||||||
raise InterpreterException(msg.format(progname, cmd.description()))
|
raise InterpreterException(msg.format(progname, cmd.description()))
|
||||||
|
if not cmd.found():
|
||||||
|
raise InterpreterException('command {!r} not found or not executable'.format(cmd))
|
||||||
elif isinstance(cmd, CompilerHolder):
|
elif isinstance(cmd, CompilerHolder):
|
||||||
cmd = cmd.compiler.get_exelist()[0]
|
cmd = cmd.compiler.get_exelist()[0]
|
||||||
prog = ExternalProgram(cmd, silent=True)
|
prog = ExternalProgram(cmd, silent=True)
|
||||||
|
|
|
@ -1389,13 +1389,13 @@ class BuildDirLock:
|
||||||
msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1)
|
msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1)
|
||||||
self.lockfile.close()
|
self.lockfile.close()
|
||||||
|
|
||||||
def relpath(path, start):
|
def relpath(path: str, start: str) -> str:
|
||||||
# On Windows a relative path can't be evaluated for paths on two different
|
# On Windows a relative path can't be evaluated for paths on two different
|
||||||
# drives (i.e. c:\foo and f:\bar). The only thing left to do is to use the
|
# drives (i.e. c:\foo and f:\bar). The only thing left to do is to use the
|
||||||
# original absolute path.
|
# original absolute path.
|
||||||
try:
|
try:
|
||||||
return os.path.relpath(path, start)
|
return os.path.relpath(path, start)
|
||||||
except ValueError:
|
except (TypeError, ValueError):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue