Commit Graph

44 Commits

Author SHA1 Message Date
Xavier Claessens d9b9eecd54 msetup: Restore .gitignore after wipe 2021-04-17 22:54:03 -04:00
Xavier Claessens 20a90cf709 cmd_line_file.txt: Use cross/native file path resolved by coredata
This fix issue when using --wipe and the machine file was passed as a
pipe and written locally, or when the file was resolved in XDG_DATA_HOME
or XDG_DATA_DIRS.

Fixes: #8560
2021-03-22 14:45:10 -04:00
Xavier Claessens 598e968993 Add `meson devenv` command and meson.add_devenv() 2021-03-16 09:00:50 -04:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
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).
2021-01-04 12:20:58 -08:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Samuel Longchamps e11218c153 Incorrect source-build directory error when using network paths on Windows 2020-12-28 22:14:48 +00:00
Jussi Pakkanen 7437d9862a Add VCS ignore files to build dir on creation. Closes #6509. 2020-12-13 10:01:06 +00:00
Corey McNeish b6dc4d5e5c Fix host machine reporting typo in msetup.py 2020-11-07 12:03:24 +02:00
Nirbheek Chauhan 7fbdf38ce3 mcompile: Add some basic XCode support
I wrote this to convert run_tests.get_backend_commands() over to the
new meson wrappers, but that turned out to be harder than I expected,
so just splitting this out for now.
2020-09-13 20:44:30 +03:00
Daniel Mensinger 23818fc5a3
typing: more fixes 2020-09-08 20:15:58 +02:00
Daniel Mensinger c637b913c9
typing: fully annotate mcompile, minit, and msetup 2020-09-08 20:15:57 +02:00
Laurent Pinchart c5d2299cac Fix symlink deletion with --wipe option
When wiping a build tree with --wipe, every entry in the build directory
is removed with mesonlib.windows_proof_rmtree() for directories and
mesonlib.windows_proof_rm() for other files. Symlinks to directories are
considered directories, resulting in the former being called. This
causes an exception to be raised, as the implementation calls
shutil.rmtree(), which isn't allowed on symlinks.

Fix this by using mesonlib.windows_proof_rm() for symlinks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-29 18:55:17 +03:00
Jens Carl 2008cb2109
Fix typo in help of option '--wipe' [skip ci] 2020-04-10 17:27:51 +03:00
Michael Brockus 98ddd52ced
Cherry-picking - (rm python2 % add python3 .format) (#6725) 2020-03-03 21:45:43 +02:00
Marcel Hollerbach 66bf339e33 meson: unbreak --profile-self
This broke in 668610c0d2.
2020-02-12 04:00:10 +05:30
Daniel Mensinger 668610c0d2 backend: refactor: set self.interpreter in the constructor 2020-01-28 21:18:25 +02:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Michael Hirsch, Ph.D 6e708208dd CI: add initial type annotation checking 2019-11-07 22:18:21 +02:00
Xavier Claessens 2e7f0ce557 Print user defined options in meson-log.txt
It can be useful to know what options have been passed to the command
line, excluding default values.

Closes: #5956
2019-09-25 22:50:48 +03:00
John Ericson d8335fb032 Put native file before cross file in options list
I think this makes more sense by matching how build comes before host.
Native builds are also more common than cross builds.
2019-08-12 01:21:32 +03:00
Jussi Pakkanen 8764e4f579 Print only host platform info in some cases during native builds
Build and target info is confusing in that case. However still log that
information, as it is useful in case something slips out of sync and
needs to be debugged.
2019-08-11 20:38:35 +03:00
Dylan Baker 56f7e5c74f coredata: Correctly handle receiving a pipe for native/cross files
* coredata: Correctly handle receiving a pipe for native/cross files

In some cases a cross/native file may be a pipe, such as when using bash
process replacement `meson --native-file
<([binaries]llvm-config='/opt/bin/llvm-config')`, for example. In this
case we copy the contents of the pipe into a file in the meson-private
directory so we can create a proper ninja dependency, and be able to
reload the file on --wipe/--reconfigure. This requires some extra
negotiation to preserve these native/cross files.

Fixes #5505

* run_unitests: Add a unit test for native files that are pipes

Using mkfifo.
2019-06-23 17:53:17 +03:00
Clouds a0cf7ad3d8 fix error when show default config of list
the error would occurs when specifying c_winlibs
2019-05-05 21:26:11 +03:00
Elliott Sales de Andrade eaed4aecbe Run postconf scripts absolutely last.
Introspection is broken if they are run any earlier.
2019-04-13 04:30:59 +00:00
Dylan Baker 569e646e1e dependencies: Add command line option for pkg_config_path
This creates a new command line option to store pkg_config_path into,
and store the environment variable into that option. Currently this
works like the environment variable, for both cross and native targets.
2019-04-05 15:08:17 -07:00
Ross Burton 65e59c84a1 mesonbuild: allow multiple --cross-file options
Just like --native-file, allow multiple --cross-file options.  This is mostly
unifying the logic between cross_files and config_files.
2019-03-20 10:06:17 +00:00
Jussi Pakkanen 3bf2ca483e
Merge pull request #4732 from mensinda/introMesonInfo2
mintro: Added `meson-info.json` introspection information about the latest meson run
2019-01-07 23:10:22 +02:00
Nicolas Schneider 3232f780d8 use same code for printing options in mconf and msetup
Also, options are now responsible for providing a suitable printable
representation of their value instead of handling this at the caller.
2019-01-06 19:41:24 -05:00
Daniel Mensinger ab32f1fe00 Added meson-info.json 2019-01-06 22:03:29 +01:00
Daniel Mensinger c4eb5c79fe
Added unit test 2019-01-06 12:19:28 +01:00
Daniel Mensinger a5be893b19
Some code cleanup 2019-01-06 12:19:28 +01:00
Daniel Mensinger 74274e23ca
Moved the source and compiler generation to the backend 2019-01-06 12:19:28 +01:00
Daniel Mensinger 111e596200
Fixed tests and benchmarks 2019-01-06 12:19:27 +01:00
Daniel Mensinger f4285f350e
Initial automatic target file generation 2019-01-06 12:19:27 +01:00
Dylan Baker f9a35e08ac msetup: Fix callig meson --wipe inside a build directory
This seems to be related to deleting the current working directory.
Simply deleting all of the trees inside the build directory instead
seems to fix it. This only appears with some combination of generated
targets, running the test case against say "1 trivial" doesn't show the
bug.

See this mesa bug: https://bugs.freedesktop.org/show_bug.cgi?id=109071
2018-12-20 13:30:30 -05:00
Dylan Baker bd630fbe55 msetup: Give a nice error message if cmd_line.txt cannot be read
As would happen if someone tried to manually call meson --wipe on a
directory configured with a version < 0.49.0
2018-12-19 13:33:16 -05:00
Dylan Baker 3af4407a16 Get basic native config file loading working 2018-11-14 15:57:37 -08:00
Xavier Claessens 425133fd0f Add --wipe command line option
It is similar to --reconfigure but completely wipe the build directory
first. It is intended to make easier to rebuild project when builddir somehow
got corrupted.

Fixes #3542.
2018-11-06 16:37:13 -05:00
Xavier Claessens 43101489cd Recover when coredata cannot be loaded
Write command line options into a separate file to be able to
reconfigure from scatch in the case coredata cannot be loaded. The most
common case is when we are reconfiguring with a newer meson version.

This means that we should try as much as possible to maintain backward
compatibility for the cmd_line.txt file format.

The main difference with a normal reconfigure is it will use new
default options values and will read again environment variables like
CFLAGS, etc.
2018-11-06 16:37:13 -05:00
Xavier Claessens f0b1f0340c msetup: Remove dead code 2018-10-17 21:56:49 -04:00
Jussi Pakkanen 4d986563dc Expose wrap_mode as an option. Closes #4266. 2018-10-07 22:52:54 +03:00
Xavier Claessens 37067a53c4 Use a single ArgumentParser for all subcommands
This has the adventage that "meson --help" shows a list of all commands,
making them discoverable. This also reduce the manual parsing of
arguments to the strict minimum needed for backward compatibility.
2018-10-04 09:40:21 -04:00
Xavier Claessens f8913d1d28 Move setup command handling to its own msetup.py file 2018-10-04 09:40:21 -04:00