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

meson setup fails on Windows with an absolute path for libdir on E:\ drive and is case sensitive for Windows drive #6395

Closed
azmr opened this issue Dec 30, 2019 · 1 comment · Fixed by #6398
Labels
bug OS:windows Winodows OS specific issues

Comments

@azmr
Copy link

azmr commented Dec 30, 2019

Describe the bug
I'm learning to use Meson following the tutorial (which for Windows requires quite a lot of additional research to get things to work - something to address another time)

I have python and Meson on the C:\ drive, source and libraries on E:. (E:\ is currently a USB drive if that's relevant.)
When trying to add a dependency to a library, I tried to set the libdir to the library location on E:\ with meson setup build --libdir=E:/Documents/Coding/C/lib (after an rm -rf build) and got a python stack trace in response:

$ meson setup build --libdir=E:/Documents/Coding/C/lib
The Meson build system
Version: 0.52.1
Source dir: E:\Documents\Coding\C\meson_test
Build dir: E:\Documents\Coding\C\meson_test\build
Build type: native build
Traceback (most recent call last):
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\mesonmain.py", line 129, in run
    return options.run_func(options)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\msetup.py", line 245, in run
    app.generate()
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\msetup.py", line 159, in generate
    self._generate(env)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\msetup.py", line 176, in _generate
    intr = interpreter.Interpreter(b)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 2110, in __init__
    self.parse_project()
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 397, in parse_project
    self.evaluate_codeblock(self.ast, end=1)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 436, in evaluate_codeblock
    raise e
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 430, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 441, in evaluate_statement
    return self.function_call(cur)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 776, in function_call
    return func(node, posargs, kwargs)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 143, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreterbase.py", line 174, in wrapped
    return f(*wrapped_args, **wrapped_kwargs)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\interpreter.py", line 2723, in func_project
    self.coredata.set_default_options(default_options, self.subproject, self.environment)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\coredata.py", line 742, in set_default_options
    self.set_options(options, subproject=subproject)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\coredata.py", line 674, in set_options
    if self._try_set_builtin_option(k, v):
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\coredata.py", line 531, in _try_set_builtin_option
    value = self.sanitize_dir_option_value(prefix, optname, value)
  File "C:\Users\<user>\AppData\Roaming\Python\Python38\site-packages\mesonbuild\coredata.py", line 479, in sanitize_dir_option_value
    if os.path.commonpath([value, prefix]) != str(PurePath(prefix)):
  File "c:\users\liz\appdata\local\programs\python\python38\lib\ntpath.py", line 763, in commonpath
    raise ValueError("Paths don't have the same drive")
ValueError: Paths don't have the same drive

This is possibly related to #3239

If I try the same instruction but with the libraries copied to the C:\ drive, I get the following response:

$ meson setup build --libdir=C:/Documents/Coding/C/lib
The Meson build system
Version: 0.52.1
Source dir: E:\Documents\Coding\C\meson_test
Build dir: E:\Documents\Coding\C\meson_test\build
Build type: native build

meson.build:1:0: ERROR: The value of the 'libdir' option is 'C:/Documents/Coding/C/lib' which must be a subdir of the prefix 'c:/'.
Note that if you pass a relative path, it is assumed to be a subdir of prefix.

A full log can be found at E:\Documents\Coding\C\meson_test\build\meson-logs\meson-log.txt

If I do the same again but with $ meson setup build --libdir=c:/Documents/Coding/C/lib (note the lowercase c) I get the same response as for $ meson setup build (i.e. it seems to work).

(I'm aware that I should be setting the prefix argument to the "installation directory" but I'm not yet sure what that is)

Files To Reproduce
I don't think the contents of the files matters. These are as barebones as it gets.
main.c
meson.build

Expected behavior
I would expect Meson to show me an error message and a way to fix things (rather than a stack trace).
I would also expect Windows paths to be case insensitive or to be warned that they are case sensitive.

System Parameters

  • Native build
  • Windows 10
  • Python 3.8.1
  • meson --version => 0.52.1
  • ninja --version => 1.9.0.git.kitware.dyndep-1.jobserver-1

Notes
Thanks for all your work on Meson, it looks it will be a useful tool once I've figured it out.
If I can provide any more information, do let me know.

@jpakkane
Copy link
Member

Can you test if the linked MR fixes this for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug OS:windows Winodows OS specific issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants