We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Unhandled python exception with 0.62 on windows (0.61 ok)
**Describe the bug**
When running meson 0.62 on win32 and a project using `dependency()` (ex glib):

Unhandled python exception
ModuleNotFoundError: No module named 'mesonbuild.dependencies.data'

```
Traceback (most recent call last):
  File "mesonbuild\mesonmain.py", line 151, in run
  File "mesonbuild\msetup.py", line 301, in run
  File "mesonbuild\msetup.py", line 185, in generate
  File "mesonbuild\msetup.py", line 229, in _generate
  File "mesonbuild\interpreter\interpreter.py", line 2698, in run
  File "mesonbuild\interpreterbase\interpreterbase.py", line 149, in run
  File "mesonbuild\interpreterbase\interpreterbase.py", line 174, in evaluate_codeblock
  File "mesonbuild\interpreterbase\interpreterbase.py", line 167, in evaluate_codeblock
  File "mesonbuild\interpreterbase\interpreterbase.py", line 182, in evaluate_statement
  File "mesonbuild\interpreterbase\interpreterbase.py", line 567, in assignment
  File "mesonbuild\interpreterbase\interpreterbase.py", line 180, in evaluate_statement
  File "mesonbuild\interpreterbase\interpreterbase.py", line 455, in function_call
  File "mesonbuild\interpreterbase\decorators.py", line 768, in wrapped
  File "mesonbuild\interpreterbase\decorators.py", line 768, in wrapped
  File "mesonbuild\interpreterbase\decorators.py", line 768, in wrapped
  [Previous line repeated 5 more times]
  File "mesonbuild\interpreterbase\decorators.py", line 109, in wrapped
  File "mesonbuild\interpreterbase\decorators.py", line 127, in wrapped
  File "mesonbuild\interpreterbase\decorators.py", line 277, in wrapper
  File "mesonbuild\interpreter\interpreter.py", line 1620, in func_dependency
  File "mesonbuild\interpreter\dependencyfallbacks.py", line 352, in lookup
  File "mesonbuild\interpreter\dependencyfallbacks.py", line 93, in _do_dependency
  File "mesonbuild\dependencies\detect.py", line 112, in find_external_dependency
  File "mesonbuild\dependencies\cmake.py", line 135, in __init__
  File "mesonbuild\dependencies\cmake.py", line 183, in _get_cmake_info
  File "mesonbuild\dependencies\cmake.py", line 614, in _call_cmake
  File "mesonbuild\dependencies\cmake.py", line 585, in _setup_cmake_dir
  File "importlib\resources.py", line 103, in read_text
  File "importlib\resources.py", line 82, in open_text
  File "importlib\resources.py", line 43, in open_binary
  File "importlib\_common.py", line 66, in get_package
  File "importlib\_common.py", line 57, in resolve
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mesonbuild.dependencies.data'
```

**To Reproduce**
project('foo')
pcre = dependency('libpcre')

**system parameters**
meson 0.62 (MSI) on windev VM (https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/)
works as expected on 0.61

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `packaging/hook-mesonbuild.py`
Content:
```
1 #!hint/python3
2 
3 """
4 PyInstaller hook to make mesonbuild include everything it needs to.
5 """
6 
7 import os
8 from glob import glob
9 
10 hiddenimports = []
11 
12 def get_all_modules_from_dir(dirname):
13     '''
14     Get all modules required for Meson itself from directories.
15     '''
16     modname = os.path.basename(dirname)
17     modules = [os.path.splitext(os.path.split(x)[1])[0] for x in glob(os.path.join(dirname, '*'))]
18     modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]
19     return modules
20 
21 hiddenimports += get_all_modules_from_dir('mesonbuild/modules')
22 hiddenimports += get_all_modules_from_dir('mesonbuild/scripts')
23 
24 # Python packagers want to be minimal and only copy the things
25 # that they can see being used. They are blind to many things.
26 hiddenimports += [
27     # we run distutils as a subprocess via INTROSPECT_COMMAND.
28     'distutils.archive_util',
29     'distutils.cmd',
30     'distutils.config',
31     'distutils.core',
32     'distutils.debug',
33     'distutils.dep_util',
34     'distutils.dir_util',
35     'distutils.dist',
36     'distutils.errors',
37     'distutils.extension',
38     'distutils.fancy_getopt',
39     'distutils.file_util',
40     'distutils.spawn',
41     'distutils.util',
42     'distutils.version',
43     'distutils.command.build_ext',
44     'distutils.command.build',
45     'distutils.command.install',
46 
47     # needed for gtk's find_program() scripts
48     'filecmp',
49 ]
50
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/packaging/hook-mesonbuild.py b/packaging/hook-mesonbuild.py
--- a/packaging/hook-mesonbuild.py
+++ b/packaging/hook-mesonbuild.py
@@ -7,6 +7,9 @@
 import os
 from glob import glob
 
+from PyInstaller.utils.hooks import collect_data_files
+
+datas = []
 hiddenimports = []
 
 def get_all_modules_from_dir(dirname):
@@ -18,6 +21,10 @@
     modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]
     return modules
 
+datas += collect_data_files('mesonbuild.scripts')
+datas += collect_data_files('mesonbuild.cmake.data')
+datas += collect_data_files('mesonbuild.dependencies.data')
+
 hiddenimports += get_all_modules_from_dir('mesonbuild/modules')
 hiddenimports += get_all_modules_from_dir('mesonbuild/scripts')

{"golden_diff": "diff --git a/packaging/hook-mesonbuild.py b/packaging/hook-mesonbuild.py\n--- a/packaging/hook-mesonbuild.py\n+++ b/packaging/hook-mesonbuild.py\n@@ -7,6 +7,9 @@\n import os\n from glob import glob\n \n+from PyInstaller.utils.hooks import collect_data_files\n+\n+datas = []\n hiddenimports = []\n \n def get_all_modules_from_dir(dirname):\n@@ -18,6 +21,10 @@\n     modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]\n     return modules\n \n+datas += collect_data_files('mesonbuild.scripts')\n+datas += collect_data_files('mesonbuild.cmake.data')\n+datas += collect_data_files('mesonbuild.dependencies.data')\n+\n hiddenimports += get_all_modules_from_dir('mesonbuild/modules')\n hiddenimports += get_all_modules_from_dir('mesonbuild/scripts')\n", "issue": "Unhandled python exception with 0.62 on windows (0.61 ok)\n**Describe the bug**\r\nWhen running meson 0.62 on win32 and a project using `dependency()` (ex glib):\r\n\r\nUnhandled python exception\r\nModuleNotFoundError: No module named 'mesonbuild.dependencies.data'\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"mesonbuild\\mesonmain.py\", line 151, in run\r\n  File \"mesonbuild\\msetup.py\", line 301, in run\r\n  File \"mesonbuild\\msetup.py\", line 185, in generate\r\n  File \"mesonbuild\\msetup.py\", line 229, in _generate\r\n  File \"mesonbuild\\interpreter\\interpreter.py\", line 2698, in run\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 149, in run\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 174, in evaluate_codeblock\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 167, in evaluate_codeblock\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 182, in evaluate_statement\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 567, in assignment\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 180, in evaluate_statement\r\n  File \"mesonbuild\\interpreterbase\\interpreterbase.py\", line 455, in function_call\r\n  File \"mesonbuild\\interpreterbase\\decorators.py\", line 768, in wrapped\r\n  File \"mesonbuild\\interpreterbase\\decorators.py\", line 768, in wrapped\r\n  File \"mesonbuild\\interpreterbase\\decorators.py\", line 768, in wrapped\r\n  [Previous line repeated 5 more times]\r\n  File \"mesonbuild\\interpreterbase\\decorators.py\", line 109, in wrapped\r\n  File \"mesonbuild\\interpreterbase\\decorators.py\", line 127, in wrapped\r\n  File \"mesonbuild\\interpreterbase\\decorators.py\", line 277, in wrapper\r\n  File \"mesonbuild\\interpreter\\interpreter.py\", line 1620, in func_dependency\r\n  File \"mesonbuild\\interpreter\\dependencyfallbacks.py\", line 352, in lookup\r\n  File \"mesonbuild\\interpreter\\dependencyfallbacks.py\", line 93, in _do_dependency\r\n  File \"mesonbuild\\dependencies\\detect.py\", line 112, in find_external_dependency\r\n  File \"mesonbuild\\dependencies\\cmake.py\", line 135, in __init__\r\n  File \"mesonbuild\\dependencies\\cmake.py\", line 183, in _get_cmake_info\r\n  File \"mesonbuild\\dependencies\\cmake.py\", line 614, in _call_cmake\r\n  File \"mesonbuild\\dependencies\\cmake.py\", line 585, in _setup_cmake_dir\r\n  File \"importlib\\resources.py\", line 103, in read_text\r\n  File \"importlib\\resources.py\", line 82, in open_text\r\n  File \"importlib\\resources.py\", line 43, in open_binary\r\n  File \"importlib\\_common.py\", line 66, in get_package\r\n  File \"importlib\\_common.py\", line 57, in resolve\r\n  File \"importlib\\__init__.py\", line 126, in import_module\r\n  File \"<frozen importlib._bootstrap>\", line 1050, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 1004, in _find_and_load_unlocked\r\nModuleNotFoundError: No module named 'mesonbuild.dependencies.data'\r\n```\r\n\r\n**To Reproduce**\r\nproject('foo')\r\npcre = dependency('libpcre')\r\n\r\n**system parameters**\r\nmeson 0.62 (MSI) on windev VM (https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/)\r\nworks as expected on 0.61\n", "before_files": [{"content": "#!hint/python3\n\n\"\"\"\nPyInstaller hook to make mesonbuild include everything it needs to.\n\"\"\"\n\nimport os\nfrom glob import glob\n\nhiddenimports = []\n\ndef get_all_modules_from_dir(dirname):\n    '''\n    Get all modules required for Meson itself from directories.\n    '''\n    modname = os.path.basename(dirname)\n    modules = [os.path.splitext(os.path.split(x)[1])[0] for x in glob(os.path.join(dirname, '*'))]\n    modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]\n    return modules\n\nhiddenimports += get_all_modules_from_dir('mesonbuild/modules')\nhiddenimports += get_all_modules_from_dir('mesonbuild/scripts')\n\n# Python packagers want to be minimal and only copy the things\n# that they can see being used. They are blind to many things.\nhiddenimports += [\n    # we run distutils as a subprocess via INTROSPECT_COMMAND.\n    'distutils.archive_util',\n    'distutils.cmd',\n    'distutils.config',\n    'distutils.core',\n    'distutils.debug',\n    'distutils.dep_util',\n    'distutils.dir_util',\n    'distutils.dist',\n    'distutils.errors',\n    'distutils.extension',\n    'distutils.fancy_getopt',\n    'distutils.file_util',\n    'distutils.spawn',\n    'distutils.util',\n    'distutils.version',\n    'distutils.command.build_ext',\n    'distutils.command.build',\n    'distutils.command.install',\n\n    # needed for gtk's find_program() scripts\n    'filecmp',\n]\n", "path": "packaging/hook-mesonbuild.py"}], "after_files": [{"content": "#!hint/python3\n\n\"\"\"\nPyInstaller hook to make mesonbuild include everything it needs to.\n\"\"\"\n\nimport os\nfrom glob import glob\n\nfrom PyInstaller.utils.hooks import collect_data_files\n\ndatas = []\nhiddenimports = []\n\ndef get_all_modules_from_dir(dirname):\n    '''\n    Get all modules required for Meson itself from directories.\n    '''\n    modname = os.path.basename(dirname)\n    modules = [os.path.splitext(os.path.split(x)[1])[0] for x in glob(os.path.join(dirname, '*'))]\n    modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')]\n    return modules\n\ndatas += collect_data_files('mesonbuild.scripts')\ndatas += collect_data_files('mesonbuild.cmake.data')\ndatas += collect_data_files('mesonbuild.dependencies.data')\n\nhiddenimports += get_all_modules_from_dir('mesonbuild/modules')\nhiddenimports += get_all_modules_from_dir('mesonbuild/scripts')\n\n# Python packagers want to be minimal and only copy the things\n# that they can see being used. They are blind to many things.\nhiddenimports += [\n    # we run distutils as a subprocess via INTROSPECT_COMMAND.\n    'distutils.archive_util',\n    'distutils.cmd',\n    'distutils.config',\n    'distutils.core',\n    'distutils.debug',\n    'distutils.dep_util',\n    'distutils.dir_util',\n    'distutils.dist',\n    'distutils.errors',\n    'distutils.extension',\n    'distutils.fancy_getopt',\n    'distutils.file_util',\n    'distutils.spawn',\n    'distutils.util',\n    'distutils.version',\n    'distutils.command.build_ext',\n    'distutils.command.build',\n    'distutils.command.install',\n\n    # needed for gtk's find_program() scripts\n    'filecmp',\n]\n", "path": "packaging/hook-mesonbuild.py"}]}