Repository: mesonbuild/meson

Issue:
Regression: "No module named 'mesonbuild.dependencies.ui'" in Windows MSI version
**Describe the bug**
Using the 1.2.0 MSI, the module 'mesonbuild.dependencies.ui' is missing, while it seems to be available in 1.1.1

**To Reproduce**
Minimal meson.build (bug also appears if there is an actual `executable()` line):
```meson
project('bug', 'c')

dependency('sdl2')
```
```cmd
> md subprojects
> meson wrap install sdl2
> meson setup build
The Meson build system
Version: 1.2.0
Source dir: F:\bug
Build dir: F:\bug\build
Build type: native build
Project name: bug
Project version: undefined
C compiler for the host machine: cl (msvc 19.36.32537 "Microsoft (R) C/C++-Optimierungscompiler Version 19.36.32537 f�r x64")
C linker for the host machine: link link 14.36.32537.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Traceback (most recent call last):
  File "mesonbuild\mesonmain.py", line 194, in run
  File "mesonbuild\msetup.py", line 358, in run
  File "mesonbuild\msetup.py", line 183, in generate
  File "mesonbuild\msetup.py", line 228, in _generate
  File "mesonbuild\interpreter\interpreter.py", line 2997, in run
  File "mesonbuild\interpreterbase\interpreterbase.py", line 164, in run
  File "mesonbuild\interpreterbase\interpreterbase.py", line 190, in evaluate_codeblock
  File "mesonbuild\interpreterbase\interpreterbase.py", line 182, in evaluate_codeblock
  File "mesonbuild\interpreterbase\interpreterbase.py", line 196, in evaluate_statement
  File "mesonbuild\interpreterbase\interpreterbase.py", line 521, in function_call
  File "mesonbuild\interpreterbase\decorators.py", line 826, in wrapped
  File "mesonbuild\interpreterbase\decorators.py", line 826, in wrapped
  File "mesonbuild\interpreterbase\decorators.py", line 826, in wrapped
  [Previous line repeated 4 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\interpreterbase\decorators.py", line 596, in wrapper
  File "mesonbuild\interpreter\interpreter.py", line 1774, in func_dependency
  File "mesonbuild\interpreter\dependencyfallbacks.py", line 355, in lookup
  File "mesonbuild\interpreter\dependencyfallbacks.py", line 87, in _do_dependency
  File "mesonbuild\dependencies\detect.py", line 115, in find_external_dependency
  File "mesonbuild\dependencies\detect.py", line 193, in _build_external_dependency_list
  File "collections\__init__.py", line 1123, in __getitem__
  File "mesonbuild\dependencies\detect.py", line 39, in __missing__
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'mesonbuild.dependencies.ui'

meson.build:3:0: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!
```

**Expected behavior**
setup step should complete successfully, like it does with 1.1.1

**system parameters**
* Plain native build
* Windows 10
* System Python is 3.11.0, 
* meson 1.2.0
* ninja 1.11.1



Discussion:

Resolving patch:
diff --git a/packaging/hook-mesonbuild.py b/packaging/hook-mesonbuild.py
--- a/packaging/hook-mesonbuild.py
+++ b/packaging/hook-mesonbuild.py
@@ -25,7 +25,11 @@ def get_all_modules_from_dir(dirname):
 datas += collect_data_files('mesonbuild.cmake.data')
 datas += collect_data_files('mesonbuild.dependencies.data')
 
+# lazy-loaded
+hiddenimports += get_all_modules_from_dir('mesonbuild/dependencies')
+# imported by meson.build files
 hiddenimports += get_all_modules_from_dir('mesonbuild/modules')
+# executed when named on CLI
 hiddenimports += get_all_modules_from_dir('mesonbuild/scripts')
 
 # Python packagers want to be minimal and only copy the things


Test patch: