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

can't build a simple java project #13870

Open
oldoldman opened this issue Nov 5, 2024 · 2 comments
Open

can't build a simple java project #13870

oldoldman opened this issue Nov 5, 2024 · 2 comments

Comments

@oldoldman
Copy link

oldoldman commented Nov 5, 2024

Describe the bug

To Reproduce
meson.build

project('test','java')
executable('Test','Test.java')

command line
meson setup builddir
got the follow error

The Meson build system
Version: 1.6.0
Source dir: D:\notes\tmp
Build dir: D:\notes\tmp\builddir
Build type: native build
Project name: test
Project version: undefined
Java compiler for the host machine: javac (unknown 20.0.1)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Traceback (most recent call last):
  File "D:\Python\3.9\lib\site-packages\mesonbuild\mesonmain.py", line 193, in run
    return options.run_func(options)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\msetup.py", line 365, in run
    app.generate()
  File "D:\Python\3.9\lib\site-packages\mesonbuild\msetup.py", line 188, in generate
    return self._generate(env, capture, vslite_ctx)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\msetup.py", line 227, in _generate
    intr.run()
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 3063, in run
    super().run()
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 169, in run
    self.evaluate_codeblock(self.ast, start=1)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 195, in evaluate_codeblock
    raise e
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 187, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 201, in evaluate_statement
    return self.function_call(cur)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 528, in function_call
    res = func(node, func_args, kwargs)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 103, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 237, in wrapper
    return f(*nargs, **wrapped_kwargs)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 556, in wrapper
    return f(*wrapped_args, **wrapped_kwargs)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 1861, in func_executable
    return self.build_target(node, args, kwargs, build.Executable)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 3483, in build_target
    self.add_target(name, target)
  File "D:\Python\3.9\lib\site-packages\mesonbuild\interpreter\interpreter.py", line 3237, in add_target
    tobj.process_compilers_late()
  File "D:\Python\3.9\lib\site-packages\mesonbuild\build.py", line 937, in process_compilers_late
    self.post_init()
  File "D:\Python\3.9\lib\site-packages\mesonbuild\build.py", line 2036, in post_init
    and ('cs' in self.compilers or self.uses_rust() or self.get_using_msvc())
  File "D:\Python\3.9\lib\site-packages\mesonbuild\build.py", line 1685, in get_using_msvc
    compiler, _ = self.get_clink_dynamic_linker_and_stdlibs()
  File "D:\Python\3.9\lib\site-packages\mesonbuild\build.py", line 1640, in get_clink_dynamic_linker_and_stdlibs
    raise AssertionError(f'Could not get a dynamic linker for build target {self.name!r}')
AssertionError: Could not get a dynamic linker for build target 'Test'

meson.build:5:0: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!

Expected behavior
the target get built

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?
  • native build
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
  • Win 11
  • what Python version are you using e.g. 3.8.0
  • Python 3.9.10
  • what meson --version
  • 1.6.0
  • what ninja --version if it's a Ninja build
  • 1.12.1
@andy5995
Copy link
Contributor

andy5995 commented Nov 7, 2024

There's an example for java in the docs at https://mesonbuild.com/Java.html#compiling-java-applications

@dcbaker
Copy link
Member

dcbaker commented Nov 7, 2024

This is pretty obviously a bug, but I'm not sure what the proper solution is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants