This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.
This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.
SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
D lang compilers have an option -release (or similar) which turns off
asserts, contracts, and other runtime type checking. This patch wires
that up to the b_ndebug flag.
Fixes#7082
Instead of using fragile guessing to figure out how to invoke meson,
set the value when meson is run. Also rework how we pass of
meson_script_launcher to regenchecker.py -- it wasn't even being used
With this change, we only need to guess the meson path when running
the tests, and in that case:
1. If MESON_EXE is set in the env, we know how to run meson
for project tests.
2. MESON_EXE is not set, which means we run the configure in-process
for project tests and need to guess what meson to run, so either
- meson.py is found next to run_tests.py, or
- meson, meson.py, or meson.exe is in PATH
Otherwise, you can invoke meson in the following ways:
1. meson is installed, and mesonbuild is available in PYTHONPATH:
- meson, meson.py, meson.exe from PATH
- python3 -m mesonbuild.mesonmain
- python3 /path/to/meson.py
- meson is a shell wrapper to meson.real
2. meson is not installed, and is run from git:
- Absolute path to meson.py
- Relative path to meson.py
- Symlink to meson.py
All these are tested in test_meson_commands.py, except meson.exe since
that involves building the meson msi and installing it.
./mesonbuild/scripts/regen_checker.py:35:5: F841 local variable 'scriptdir' is assigned to but never used
scriptdir = os.path.split(__file__)[0]
^
./mesonbuild/scripts/yelphelper.py:84:13: F841 local variable 'symfile' is assigned to but never used
symfile = os.path.join(install_dir, m)
^
./mesonbuild/backend/backends.py:164:13: F841 local variable 'lang' is assigned to but never used
lang = comp.get_language()
^
./mesonbuild/backend/ninjabackend.py:1286:9: F841 local variable 'scriptdir' is assigned to but never used
scriptdir = self.environment.get_script_dir()
^
./mesonbuild/backend/vs2010backend.py:736:9: F841 local variable 'additional_options_set' is assigned to but never used
additional_options_set = True
^
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Using 'mesonbuild' as the module can cause it to use the
system-installed module and can also break if we rename the directory,
so avoid that by always using relative imports.
The Meson script is not always in $scriptdir/../../ -- for instance if
installed with pip on Windows, the scriptdir is in:
C:/Python35/Lib/site-packages/meson-0.33.0.dev1-py3.5.egg/mesonbuild/scripts
and the meson.py script is in:
C:/Python35/Scripts
So, let's save the path available as Environment().meson_script_file
into the coredata.dat private file and use that to invoke Meson when
doing regen.
Also, let's fetch the backend that was used from the coredata too
instead of hard-coding vs2010.
Both these were causing a hard failure while doing regen with msbuild or
visual studio.