aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-02build: use typing.Mapping for lru_cached dictsDylan Baker1-9/+9
Thankfully the typing module provides us an immutable protocol for mappings, so we don't have to write one ourselves.
2021-06-02use an immutable list for an lru_cached functionsDylan Baker8-21/+31
When mutable items are stored in an lru cache, changing the returned items changes the cached items as well. Therefore we want to ensure that we're not mutating them. Using the ImmutableListProtocol allows mypy to find mutations and reject them. This doesn't solve the problem of mutable values inside the values, so you could have to do things like: ```python ImmutableListProtocol[ImmutableListProtocol[str]] ``` or equally hacky. It can also be used for input types and acts a bit like C's const: ```python def foo(arg: ImmutableListProtocol[str]) -> T.List[str]: arg[1] = 'foo' # works while running, but mypy errors ```
2021-06-02adding a _typing moduleDylan Baker2-0/+117
this is a place that *must* only be imported inside a if typing.TYPE_CHECKING block. It is a mixture of smoothing over thinigs that moved from typing_extensions to typing in later python versions and useful but typing only code. This makes typing_extensions required for python versions older than 3.8 *when running mypy*. typing_extensions should *only* be imported inside an `if typing.TYPE_CHECKING` block (include the new _typing.py module) to ensure that it doesn't become a runtime dependency
2021-06-02test cases/common/103 has header symbol: set c++ standardDylan Baker1-1/+5
On mac this appears to default to c++98, which in turn falls over with boost that requires at least c++11
2021-06-02Merge pull request #8812 from mensinda/cmakeToolchainJussi Pakkanen13-99/+234
CMake toolchain file improvements (fixes #8293)
2021-06-02Do not delete workdir in case scan-build fails.Jussi Pakkanen1-8/+13
2021-06-02docs: Fix typo in github pages repo URLXavier Claessens1-1/+1
2021-06-02ci: Automatically update website when pushing to masterXavier Claessens2-2/+41
2021-06-01typed_kwargs: Add since and deprecated annotationsXavier Claessens2-4/+47
2021-05-31interpreter: wrap access to Feature valuePaolo Bonzini1-4/+8
This will allow adding "forced-off" Feature objects in the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-31interpreter: add feature.allowed()Paolo Bonzini3-0/+11
This method simplifies the conversion of Feature objects to booleans. Often, one has to use the "not" operator in order to treat "auto" and "enabled" the same way. "allowed()" also works well in conjunction with the require method that is introduced in the next patch. For example, if get_option('foo').require(host_machine.system() == 'windows').allowed() then src += ['foo.c'] config.set10('HAVE_FOO', 1) endif can be used instead of if host_machine.system() != 'windows' if get_option('foo').enabled() error('...') endif endif if not get_option('foo').disabled() then src += ['foo.c'] config.set10('HAVE_FOO', 1) endif Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-05-30modules/fs: Use typed_kwargsDylan Baker1-7/+11
2021-05-30interpreterbase: Add a function for type checking keyword argumentsDylan Baker2-0/+233
2021-05-30cmake: select correct generator in toolchain.pyDaniel Mensinger4-16/+29
2021-05-30Don't use `os.path.relpath` in dist commandNaveen M K1-1/+1
This is problematic when we meson is installed in the different root(say C:) while building from another root(say D:). This is how it is done in mesonpep517 and causes problems because of that.
2021-05-30Only try to get RSP syntax if RSP is supported (#8804)Dylan Baker2-14/+24
2021-05-29cmake: exclude generated files from the buildsystem files listDaniel Mensinger1-0/+2
2021-05-29cmake: Update test caseDaniel Mensinger5-3/+31
2021-05-29cmake: Fix CMakeToolchain (fixes #8293)Daniel Mensinger4-68/+128
Instead of guessing the internal compiler variables, Meson now runns CMake once to determine what they actually are.
2021-05-29cmake: CMakeTraceParser improvementsDaniel Mensinger2-13/+45
- handle cached CMake variables differently - associate variables with source files - better performance (str to Path and generator expressions)
2021-05-28vsenv: Recommend using "meson compile" wrapperXavier Claessens2-1/+12
When meson has setup the VS environment, running ninja to build won't work, user should use meson wrapper to compile.
2021-05-29Remove HFS workaround as everyone should use APFS by now.Jussi Pakkanen1-7/+0
2021-05-28unstable_external_project: Remove unused importsXavier Claessens1-2/+1
2021-05-28modules: Replace find_program_impl() by state.find_program()Xavier Claessens6-54/+47
2021-05-28modules: Add methods dict everywhereXavier Claessens20-19/+113
This fix calling random internal methods from meson.build as long as they were not prefixed by underscore.
2021-05-28modules: Stop using ModuleReturnValue where it's not neededXavier Claessens9-61/+45
It is only needed in functions that need to add targets to the interpreter.
2021-05-28modules: Stop using InterpreterObjectXavier Claessens7-70/+79
Custom objects returned by modules must be subclass of ModuleObject and have the state argument in its methods. Add MutableModuleObject base class for objects that needs to be deep copied on assignation.
2021-05-28modules: Remove snippet methodsXavier Claessens13-65/+38
The only advantage they have is they have the interpreter in arguments, but it's already available as self.interpreter. We should discourage usage of the interpreter API and rely on ModuleState object instead in the future. This also lift the restriction that a module method cannot add build targets, but that was not enforced for snippet methods anyway (and some modules were doing it) and it's really loose restriction as it should check for many other things if we wanted to make it consistent.
2021-05-28Remove `Microsoft.VisualStudio.Workload.WDExpress`Naveen M K1-1/+0
2021-05-28Find Visual Studio Build Tools 2019Naveen M K1-9/+19
Got the Idea from setuptools https://github.com/pypa/setuptools/blob/a5131f0b82e098da6c07a03a47f36f3a52f73fb6/setuptools/msvc.py#L176
2021-05-28Vala: Add missing FeatureNew() when C is missingXavier Claessens1-0/+1
It was previously an hard error, only permitted since 0.59.0.
2021-05-28Add a helper to simplify the usage of PerMachineDefaultableDylan Baker3-24/+29
2021-05-28tests: Add a test for dependencies with native set in a host == build ↵Dylan Baker2-0/+32
configuration
2021-05-28build: Use a PerMachineDefaultable for (project|global)[_link]_argsDylan Baker1-4/+15
2021-05-28coredata: Use a PerMachineDefaultable for the deps cacheDylan Baker1-5/+9
2021-05-28build: Use a PerMachineDefaultable for dependency override cacheDylan Baker1-2/+8
This way if we're doing a host == build configuration then the build and host dependencies will be stored correctly.
2021-05-28mesonlib: Allow PerMachineDefaultable to take arguments at initializationDylan Baker1-2/+2
2021-05-28dependencies/zlib: System Dependency needs a clib_compiler on windowsDylan Baker1-3/+8
Otherwise it'll except when it tries to get an attribute from None that doesn't exist.
2021-05-28mesonlib: Fix return type of PerMachineDefaultable.default_missing()Dylan Baker1-1/+1
2021-05-28build: fix type annotation importDylan Baker1-1/+1
2021-05-28modules/gnome: Correctly handle generated sources for generate_girDylan Baker3-7/+39
We need to pass any generated sources down the CustomTarget inititalizers so that they will generate a dependency correctly, otherwise we get race conditions.
2021-05-27test cases: Disable whole archive test on older VS IDEChun-wei Fan1-0/+4
The pre-2015 Visual Studio IDE do not handle things correctly for this test, so disable this.
2021-05-27MSVC: Always enable common tests 137 and 170Chun-wei Fan2-15/+0
This will test the "whole archive" and "generator link whole" for all Visual C++ versions.
2021-05-27ninjabackend.py: Implement `link_whole:` for pre-VS2015Chun-wei Fan1-3/+20
...Update 2, to be exact, since the Visual Studio linker only gained the `/WHOLEARCHIVE:` feature since Visual Studio 2015 Update 2. This checks whether we have the corresponding `cl.exe` which is versioned at or after Visual Studio 2015 Update 2 before we try to apply the `/WHOLEARCHIVE:xxx` linker flag. If we aren't, use built-in methods in Meson to grab the object files of the dependent static lib's, along with the objects that were `link_whole:`'ed into them, and feed this list into the linker instead. This would make `link_whole:` work on Visual Studio 2015 Update 1 and earlier, including previous Visual Studio versions.
2021-05-26Update chat info. [skip ci]Jussi Pakkanen1-4/+5
2021-05-23Also skip VS activation if gcc is found.Jussi Pakkanen1-0/+2
2021-05-23Fix double negative in 'No CMake binary not found'Jon Turney1-1/+1
2021-05-23Add swift executable support in Xcode.Jussi Pakkanen3-7/+14
2021-05-23Handle macOS filesystem sometimes setting lower digits to zero.Jussi Pakkanen1-1/+15
2021-05-23Fix text used to validate test output.Jussi Pakkanen1-1/+1