Repository: mesonbuild/meson

Issue:
meson dist fails with cryptic error, no logs
**Describe the bug**
`meson dist -C build --formats zip` fails with the following error message:

```
Testing distribution package /home/lambda/dev/gba/sdk-seven/subprojects/minrt/build/meson-dist/minrt-0.1.0.zip
usage: meson [-h] {setup,configure,dist,install,introspect,init,test,wrap,subprojects,rewrite,compile,devenv,env2mfile,help} ...
meson: error: unrecognized arguments: /home/lambda/dev/gba/sdk-seven/subprojects/minrt/build/meson-private/dist-unpack/minrt-0.1.0 /home/lambda/dev/gba/sdk-seven/subprojects/minrt/build/meson-private/dist-build
Running Meson on distribution package failed
Dist check build directory was /home/lambda/dev/gba/sdk-seven/subprojects/minrt/build/meson-private/dist-build
```

**To Reproduce**

```meson
project('minrt', 'c',
  version: '0.1.0',
  license: 'MPL-2.0')

sources = [
  'src/crt0.s',
  'src/ram.c',
]

include = ['include']

lib = meson.project_source_root() / 'lib'

link_args = ['-specs=' + lib / 'nocrt0.specs', '-L' + lib]

minrt = static_library(
  'minrt',
  sources,
  include_directories: include + 'src')

minrt_dep = declare_dependency(
  include_directories: include,
  link_with: minrt,
  link_args: link_args + '-Trom.ld')

minrt_mb_dep = declare_dependency(
  include_directories: include,
  link_with: minrt,
  link_args: link_args + '-Tmultiboot.ld')

meson.override_dependency('minrt', minrt_dep)
meson.override_dependency('minrt-multiboot', minrt_mb_dep)
```

**Expected behavior**
`meson compile` works fine, `meson test` says no tests defined, `meson install` says nothing to install. There's no immediately apparent reason why `meson dist` should be failing, especially since it's unclear why.

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)? **Cross**
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) **Arch Linux**
* what Python version are you using e.g. 3.8.0 **3.10.8**
* what `meson --version` **0.63.3**
* what `ninja --version` if it's a Ninja build **1.11.1**



Discussion:
I cannot locally replicate this.
My repository is at https://github.com/LunarLambda/sdk-seven

Supposed to build with an `arm-none-eabi-gcc` toolchain

```sh
git clone https://github.com/LunarLambda/sdk-seven
cd sdk-seven/subprojects/minrt
meson setup --cross-file=../../cross/arm-none-eabi.txt --cross-file=../../cross/arm7tdmi.txt build
meson dist -C build
```

reproduces it for me on a clean clone and setup. again, `meson compile`, `test`, `install` all run fine by themselves.

Resolving patch:
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -1035,9 +1035,9 @@ def update_cmd_line_file(build_dir: str, options: argparse.Namespace):
 def format_cmd_line_options(options: argparse.Namespace) -> str:
     cmdline = ['-D{}={}'.format(str(k), v) for k, v in options.cmd_line_options.items()]
     if options.cross_file:
-        cmdline += [f'--cross-file {f}' for f in options.cross_file]
+        cmdline += [f'--cross-file={f}' for f in options.cross_file]
     if options.native_file:
-        cmdline += [f'--native-file {f}' for f in options.native_file]
+        cmdline += [f'--native-file={f}' for f in options.native_file]
     return ' '.join([shlex.quote(x) for x in cmdline])
 
 def major_versions_differ(v1: str, v2: str) -> bool:


Test patch: