Skip to content

Commit

Permalink
Identify machine in error accesing compiler object for missing language
Browse files Browse the repository at this point in the history
Also add a failing test case for that error.
  • Loading branch information
jon-turney authored and nirbheek committed Sep 10, 2020
1 parent 7996ca3 commit 79b2eeb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2093,7 +2093,7 @@ def get_compiler_method(self, args, kwargs):
clist = self.interpreter.coredata.compilers[for_machine]
if cname in clist:
return CompilerHolder(clist[cname], self.build.environment, self.interpreter.subproject)
raise InterpreterException('Tried to access compiler for unspecified language "%s".' % cname)
raise InterpreterException('Tried to access compiler for language "%s", not specified for %s machine.' % (cname, for_machine.get_lower_case_name()))

@noPosargs
@permittedKwargs({})
Expand Down
2 changes: 2 additions & 0 deletions test cases/failing/109 compiler no lang/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
project('compiler without lang')
meson.get_compiler('c')
7 changes: 7 additions & 0 deletions test cases/failing/109 compiler no lang/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"stdout": [
{
"line": "test cases/failing/109 compiler no lang/meson.build:2:6: ERROR: Tried to access compiler for language \"c\", not specified for host machine."
}
]
}

0 comments on commit 79b2eeb

Please sign in to comment.