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

FileNotFoundError: [Errno 2] No such file or directory: '/home/me/test01/meson-private/coredata.dat' #9584

Closed
rusty-snake opened this issue Nov 17, 2021 · 4 comments · Fixed by #9859

Comments

@rusty-snake
Copy link
Contributor

Describe the bug

Calling meson compile outside of a build directory (or without -C builddir) shows a traceback since 0.60.

To Reproduce

$ mkdir test01 && cd test01 && python3 -m venv venv && source venv/bin/activate && pip3 install meson==0.59.4 && rehash && meson --version && meson compile
Collecting meson==0.59.4
  Using cached meson-0.59.4-py3-none-any.whl (823 kB)
Installing collected packages: meson
Successfully installed meson-0.59.4
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/home/me/test01/venv/bin/python3 -m pip install --upgrade pip' command.
0.59.4

ERROR: Current directory is not a meson build directory: `/home/me/test01`.
Please specify a valid build dir or change the working directory to it.
It is also possible that the build directory was generated with an old
meson version. Please regenerate it in this case.
zsh: exit 1     meson compile
$ mkdir test02 && cd test02 && python3 -m venv venv && source venv/bin/activate && pip3 install meson==0.60.1 && rehash && meson --version && meson compile
Collecting meson==0.60.1
  Using cached meson-0.60.1-py3-none-any.whl (837 kB)
Installing collected packages: meson
Successfully installed meson-0.60.1
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/home/me/test02/venv/bin/python3 -m pip install --upgrade pip' command.
0.60.1
Traceback (most recent call last):
  File "/home/me/test02/venv/lib64/python3.10/site-packages/mesonbuild/mesonmain.py", line 138, in run
    return options.run_func(options)
  File "/home/me/test02/venv/lib64/python3.10/site-packages/mesonbuild/mcompile.py", line 324, in run
    cdata = coredata.load(options.wd)
  File "/home/me/test02/venv/lib64/python3.10/site-packages/mesonbuild/coredata.py", line 1030, in load
    with open(filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/me/test02/meson-private/coredata.dat'
zsh: exit 2     meson compile

Expected behavior

Same error message as in 0.59.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?
  • what operating system? Fedora Linux 35
  • what Python version are you using? Python 3.10.0
  • what meson --version? 0.59.4/0.60.1
  • what ninja --version if it's a Ninja build? 1.10.2
@lkantola
Copy link

FYI: Bisected to commit: abaa980

@Techcable
Copy link

I can confirm this is still an issue on Meson 0.61.1 (running on Mac).

However, passing -C <builddir> is an effective workaround.

@eli-schwartz
Copy link
Member

However, passing -C <builddir> is an effective workaround.

It's not a workaround.

As the original report notes, the bug here is that this is supposed to error out, with an informative error message rather than a traceback.

That informative error message literally tells you to specify a builddir.

eli-schwartz added a commit to eli-schwartz/meson that referenced this issue Jan 21, 2022
In commit 9280789 a good error message
about the directory not being a valid build directory, was replaced by a
worse message.

In commit abaa980 the error message was
replaced by a traceback when trying to load the coredata before checking
if it was a build directory.

Revert back to using the helper function with the good error message.
Reorganize code so that we check basic things first, and do less work
before detecting errors.

Fixes mesonbuild#9584
@Karmavil
Copy link

Karmavil commented Jan 23, 2022

To compile outside the build directory maybe you should just use ninja, ninja -C builddir
but yea.. meson compile -C builddir works as it's supposed to.
I saw the "This is a Meson bug and should be reported!" too so good job creating this report, it was helpful for me

xclaesse pushed a commit that referenced this issue Jan 26, 2022
In commit 9280789 a good error message
about the directory not being a valid build directory, was replaced by a
worse message.

In commit abaa980 the error message was
replaced by a traceback when trying to load the coredata before checking
if it was a build directory.

Revert back to using the helper function with the good error message.
Reorganize code so that we check basic things first, and do less work
before detecting errors.

Fixes #9584
nirbheek pushed a commit that referenced this issue Feb 14, 2022
In commit 9280789 a good error message
about the directory not being a valid build directory, was replaced by a
worse message.

In commit abaa980 the error message was
replaced by a traceback when trying to load the coredata before checking
if it was a build directory.

Revert back to using the helper function with the good error message.
Reorganize code so that we check basic things first, and do less work
before detecting errors.

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

Successfully merging a pull request may close this issue.

5 participants