aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-07-12Remove type comments from compilers.pyTristan Partin1-53/+59
2023-07-06CI: gracefully handle jsonschema update requiring rust to buildEli Schwartz2-2/+4
This has issues on Windows with msys2/cygwin, where we need to build it ourselves since binary wheels aren't supported on PyPI. And we don't have a rust compiler available for either one -- we may not be *able* to do so for cygwin? For msys2, the solution is pretty easy, just rely on the official msys2 packages for jsonschema, which handle both it and its dependencies for us and don't require us to compile anything. Currently they still have an older jsonschema that doesn't use rust deps at all, but that's because the new jsonschema was released today. We'll automatically catch up at some point. For cygwin, there is no rust compiler in the cygwin repository, and jsonschema there is old as the hills. I do not know if there's a good answer here, but an adequate answer is to cap jsonschema at the version we were testing with yesterday.
2023-07-06Fix typo in Disabler.mdmeator1-1/+1
2023-07-05Bump version number for rc2.1.2.0rc2Jussi Pakkanen2-2/+2
2023-07-05Renumber test dirs for rc2.Jussi Pakkanen6-2/+2
2023-07-05comp.preprocess(): Do not treat every file as assemblyXavier Claessens3-10/+14
Fixes: #11940
2023-07-05build: use self.compilers instead of all_compilers for stdlib langsDylan Baker1-1/+4
We need a union of the compilers used by the target, and by those used by all dependencies, not all the compilers in all projects. We do, however, need to look compilers up from all possible compilers, as a dependency that is a subproject could use a language not present in the current project.
2023-07-05Merge pull request #11742 from xclaesse/link-whole-casesJussi Pakkanen16-84/+195
Fix niche cases when linking static libs
2023-07-04tests: add standard option to get_define() testKacper Michajłow1-0/+10
This properly tests MSVC case which produce different preprocessed output depending on language version.
2023-07-04compilers: strip get_define outputKacper Michajłow1-1/+1
Fixes get_define() for MSVC. cl with /std:c11 and newer add a trailing space character when substituting, even if macro is empty. This breaks parsing preprocessed output to extract value. Since they cannot contain spaces it is safe to simply strip parsed value. Fixes: #10179
2023-07-04Merge pull request #11924 from dcbaker/submit/c++stdlib-fixesJussi Pakkanen1-31/+44
Do a better job of detecting libc++ vs libstdc++
2023-07-04environment: separate illumos and Solaris kernels in MachinesDylan Baker2-2/+14
While both kernels are derived from the OpenSolaris project of Sun, they have diverged and code that works with one may not work with the other. As such, we should provide different values for them. This was requested by both Oracle and the illumos upstreams. Fixes: #11922
2023-07-03fix the use of setup --profile-self in combination with --genvsliteDan Hawson1-2/+4
After the recent change to the backend `generate(...)` signature for '--genvslite', `profile.runctx('...')` needs to construct the correct cmd string and also extract the return result from `locals()`.
2023-07-02remove CI workaround for clang+msys2Eli Schwartz1-1/+0
Reverts part of commit 4e17d60d47357b7e3a4fd772ce031cd7cd7bc57e. msys2 is now fixed, so clang works well with the python headers.
2023-07-02genvslite: greatly simplify the implementation of non-genvslite backendsEli Schwartz6-45/+30
By avoiding Java-style variable naming, the code becomes considerably more readable while simultaneously becoming *more* easy to understand. It's no longer necessary to ask questions like "what's a captured buildtype" when trying to read through the code for a backend, because it can be dismissed as not relevant to the current context by re-reading it as "context for vslite". The primary goal here has been to revert regressions in the developer experience for users of the ninja backend, so there may still be issues in vs2010backend.py Post-facto application of issues that were raised during review, ignored, and merged despite such.
2023-07-02genvslite: fix badly overflowing line lengthsEli Schwartz2-2/+6
Function comments that overflow the screen width by coming after code, instead of on their own line, are hard to read. Same applies to message strings that are all on one line. Fix by reflowing them. Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-07-02genvslite: improve readability of the mconf help textEli Schwartz1-3/+2
The option description has a lot of data packed into it, which is squeezed into a small, hard to read column. Give a bit less information, focusing on essentials, to make it fit better. Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-07-02genvslite: fix the core option being listed as one of the per-project optionsEli Schwartz1-0/+1
Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-06-29compilers/cpp: remove special libc++ handling from the AppleClangCPPCompilerDylan Baker1-7/+1
The base implementation handles this already, with the added bonuses of caching, and having one less code path to test.
2023-06-29compilers/cpp: try to do a better job of detecting libc++ vs libstdc++Dylan Baker1-3/+31
Currently, we hardcode libc++ for MacOS (and derivatives), and libstdc++ for all other cases. Clang had some hackery to make this work in many cases. However, this doesn't always work, namely if you try to to use Rust as the linker when libc++ is required. This implementation does, as an optimization, provide a hardcoded list of OSes we know always use libc++, and otherwise will attempt to detect it. As a second optimization, the detected values are cached, so the lookup is only done once fixes: #11921
2023-06-29compilers/cpp: use a Mixin to share the stdlib flags between clang++ and g++Dylan Baker1-18/+15
Which will make subsequent work easier
2023-06-29compilers/cpp: use a list comprehension instead of a for loopDylan Baker1-9/+3
It's slightly faster, and less code
2023-06-29compilers/cpp: Actually add the search dirs to for gccDylan Baker1-1/+1
We calculate them, but then don't use them. Clang does use them, so this looks like a simple oversight
2023-06-28Bump version number for rc1.1.2.0rc1Jussi Pakkanen2-3/+3
2023-06-28Experimental 'genvslite' WIP. (#11049)GertyP16-354/+1112
* Capture all compile args from the first round of ninja backend generation for all languages used in building the targets so that these args, defines, and include paths can be applied to the .vcxproj's intellisense fields for all buildtypes/configurations. Solution generation is now set up for mutiple build configurations (buildtypes) when using '--genvslite'. All generated vcxprojs invoke the same high-level meson compile to build all targets; there's no selective target building (could add this later). Related to this, we skip pointlessly generating vcxprojs for targets that aren't buildable (BuildTarget-derived), which aren't of interest to the user anyway. When using --genvslite, no longer inject '<ProjectReference ...>' dependencies on which a generated .vcxproj depends because that imposes a forced visual studio build dependency, which we don't want, since we're essentially bypassing VS's build in favour of running 'meson compile ...'. When populating the vcxproj's shared intellisense defines, include paths, and compiler options fields, we choose the most frequent src file language, since this means more project src files can simply reference the project shared fields and fewer files of non-primary language types need to populate their full set of intellisense fields. This makes for smaller .vcxproj files. Paths for generated source/header/etc files, left alone, would be added to solution projects relative to the '..._vs' build directory, where they're never generated; they're generated under the respective '..._[debug/opt/release]' ninja build directories that correspond to the solution build configuration. Although VS doesn't allow conditional src/header listings in vcxprojs (at least not in a simple way that I'm aware of), we can ensure these generated sources get adjusted to at least reference locations under one of the concrete build directories (I've chosen '..._debug') under which they will be generated. Testing with --genvslite has revealed that, in some cases, the presence of 'c:\windows\system32;c:\windows' on the 'Path' environment variable (via the make-style project's ExecutablePath element) is critical to getting the 'meson compile ...' build to succeed. Not sure whether this is some 'find and guess' implicit defaults behaviour within meson or within the MSVC compiler that some projects may rely on. Feels weird but not sure of a better solution than forcibly adding these to the Path environment variable (the Executable Path property of the project). Added a new windows-only test to windowstests.py ('test_genvslite') to exercise the --genvslite option along with checking that the 'msbuild' command invokes the 'meson compile ...' of the build-type-appropriate-suffixed temporary build dir and checks expected program output. Check and report error if user specifies a non-ninja backend with a 'genvslite' setup, since that conflicts with the stated behaviour of genvslite. Also added this test case to 'WindowsTests.test_genvslite' I had problems tracking down some problematic environment variable behaviour, which appears to need a work-around. See further notes on VSINSTALLDIR, in windowstests.py, test_genvslite. 'meson setup --help' clearly states that positional arguments are ... [builddir] [sourcedir]. However, BasePlatformTests.init(...) was passing these in the order [sourcedir] [builddir]. This was producing failures, saying, "ERROR: Neither directory contains a build file meson.build." but when using the correct ordering, setup now succeeds. Changed regen, run_tests, and run_install utility projects to be simpler makefile projects instead, with commands to invoke the appropriate '...meson.py --internal regencheck ...' (or install/test) on the '[builddir]_[buildtype]' as appropriate for the curent VS configuration. Also, since the 'regen.vcxproj' utility didn't work correctly with '--genvslite' setup build dirs, and getting it to fully work would require more non-trivial intrusion into new parts of meson (i.e. '--internal regencheck', '--internal regenerate', and perhaps also 'setup --reconfigure'), for now, the REGEN project is replaced with a simpler, lighter-weight RECONFIGURE utility proj, which is unlinked from any solution build dependencies and which simply runs 'meson setup --reconfigure [builddir]_[buildtype] [srcdir]' on each of the ninja-backend build dirs for each buildtype. Yes, although this will enable the building/compiling to be correctly configured, it can leave the solution/vcxprojs stale and out-of-date, it's simple for the user to 'meson setup --genvslite ...' to fully regenerate an updated, correct solution again. However, I've noted this down as a 'fixme' to consider implementing the full regen behaviour for the genvslite case. * Review feedback changes - - Avoid use of 'captured_compile_args_per_buildtype_and_target' as an 'out' param. - Factored a little msetup.py, 'run(...)' macro/looping setup steps, for genvslite, out into a 'run_genvslite_setup' func. * Review feedback: Fixed missing spaces between multi-line strings. * 'backend_name' assignment gets immediately overwritten in 'genvslite' case so moved it into else/non-genvslite block. * Had to bump up 'test cases/unit/113 genvslites/...' up to 114; it collided with a newly added test dir again. * Changed validation of 'capture' and 'captured_compile_args_...' to use MesonBugException instead of MesonException. * Changed some function param and closing brace indentation.
2023-06-28Condense test directory names for release.Jussi Pakkanen5-0/+0
2023-06-28fix setuptools deprecation warning for renamed metadata keyEli Schwartz1-1/+1
Licenses can be plural, so the official key here has an "s" at the end and triggers a deprecation warning for the old name.
2023-06-28add additional setuptools metadata pointing to the source repositoryEli Schwartz1-0/+2
Currently, PyPI shows one link for meson -- to the homepage (the docs site). Provide an additional convenient link to the github repo.
2023-06-27Merge pull request #11902 from dcbaker/submit/rust-module-enhancementsJussi Pakkanen18-27/+275
Rust module enhancements for mesa
2023-06-27Archive shared library in AIX (#11850)Aditya Kamath5-1/+66
* Archive shared library in AIX This code change to ensure we archive shared libraries in AIX. The things we do are: Archive shared library Install archived shared library Build all must build the archived shared library blibpath must have the archived shared library dependency. * Archive shared library in AIX. Made changes as per the review comments given in the first PR request. They are:- Use self.environment.machines[t.for_machine].is_aix() Remove trial spaces Use of val instead of internal Changed comments wherever requested * Space after octothorpe * Fixed failed test case causing build break during install section * Moved AIX specific code to AIXDynamicLinker from backend * Fix indentation, trailing spaces, add type annotations and Linux/macOS build break * Remove some more trailing space issues * Fixed the wrong return type in linkers
2023-06-27rust: Override the default MSVCRT when linking Rust and !rust togetherDylan Baker2-1/+69
Rust by default links with the default MSVCRT, (dynamic, release). MSVCRT's cannot be mixed, so if Meson compiles a C or C++ library and links it with the debug MSVCRT, then tries to link that with the Rust library there will be failures. There is no built-in way to fix this for rustc, so as a workaround we inject the correct arguments early in the linker line (before any libs at least) to change the runtime. This seems to work and is recommended as workaround in the upstream rust bug report: https://github.com/rust-lang/rust/issues/39016. Given that this bug report has been opened since 2017, it seems unlikely to be fixed anytime soon, and affects all (currently) released versions of Rust.
2023-06-27rust: get stdlib arguments for non-rust languages when linkingDylan Baker6-12/+83
Otherwise we might not get things like libstdc++, which we need.
2023-06-27modules/rust: Add a keyword argument to pass extra args to the rust compilerDylan Baker5-7/+28
This may be necessary to, for example, stop rustc complaining about unused functions
2023-06-27modules/rust: Add a machine file property for extra clang args with bindgenDylan Baker6-6/+57
It's currently impossible to inject extra clang arguments when using bindgen, which is problematic when cross compiling since you may need critical arguments like `--target=...`. Because such arguments must be passed after the `--` it's impossible to inject them currently without going to something like a wrapper script. Fixes: #11805
2023-06-27modules/rust: Add a `link_with` kwarg to the test methodDylan Baker6-4/+41
This was requested by Mesa, where a bunch of `declare_dependency` objects are being created as a workaround for the lack of this keyword
2023-06-27Fix pylint.Jussi Pakkanen1-1/+0
2023-06-27interpreter: use os.listdir instead of os.scandir to avoid ResourceWarningNathan Goldbaum1-1/+2
2023-06-27Added a little more useful info to 'link_whole' documentation, describing ↵Dan Hawson1-2/+4
the use of /LINKWHOLE with MSVC and the behaviour of re-exporting symbols of individual objects in a static library.
2023-06-26mintro: record subproject in install_planDaniele Nicolodi6-0/+56
2023-06-26Revert "modules: move gnome targets into gnome module"Eli Schwartz5-26/+23
This reverts commit a2def550c586aeba4269588e79a1a308467f2582. This results in a 2k line file being unconditionally imported at startup, and transitively loading two more (for a total cost of 2759 lines of code), and it's not clear it was ever needed to begin with...
2023-06-26linkers: delay implementations import until detect is runEli Schwartz26-222/+117
This saves on a 1500-line import at startup and may be skipped entirely if no compiled languages are used. In exchange, we move the implementation to a new file that is imported instead. Followup to commit ab20eb5bbc21ae855bcd211131132d2778602bcf.
2023-06-26fix regression in handling output overwriting for ar-like linkersEli Schwartz2-2/+4
Linkers that aren't actually ar, were refactored into a base class in commit 253ff71e6b801786290b6ecb23aea61dcfeebeca, which however didn't take into account that we were doing checks for this.
2023-06-26WIP: cmake: do not re-export unused top-level objectsEli Schwartz1-12/+3
We should try to figure out what is a cross-submodule object and what isn't.
2023-06-26stop importing cmake when it isn't usedEli Schwartz3-19/+4
We don't need a CMakeInterpreter until and unless we actually attempt to use a cmake subproject via the cmake module. Minus 10 files and 3679 lines of code imported at startup.
2023-06-26dependencies: switch the delayed-import mechanism for custom dependenciesEli Schwartz14-69/+114
Simply store the module it is expected to be found in. That module then appends to the packages dict, which guarantees mypy can verify that it's got the right type -- there is no casting needed.
2023-06-26dependencies: defer importing a custom dependency until it is usedEli Schwartz12-111/+83
This lessens the amount of code imported at Meson startup by mapping each dependency to a dictionary entry and using a programmable import to dynamically return it. Minus 16 files and 6399 lines of code imported at startup.
2023-06-26dependencies: delay often-unused importsEli Schwartz3-7/+6
We expose detect.py as the mesonbuild.dependencies entrypoint and import it upfront everywhere. But unless the `dependency()` function is actually invoked, we don't need *any* of the private implementations for this. Avoid doing so until, as part of actual dependency lookup, we attempt that specific dependency method. This avoids importing big modules if `method:` is specified, and in most cases hopefully pkg-config works and we can avoid importing the cmake implementation particularly. Actually avoiding most of these imports requires more refactoring. But even so, the garden path no longer needs to import the dub dependency impl.
2023-06-26dependencies: Don't Repeat Yourself when it comes to lookup methodsEli Schwartz1-24/+17
We need to extend the candidates the same way per method, but we handle each method twice: once in explicit method checks, and once for auto. We can just handle auto as a special list of methods, though.
2023-06-26dependencies: move dub to a hidden package internal detailEli Schwartz2-6/+5
Do not import it and expose it at the package scope, it's never used elsewhere except inside the dub module.
2023-06-26tree-wide: reduce unneeded imports on specific Dependency implsEli Schwartz4-13/+12
We can check something's subtype using properties, without importing the module up front and doing isinstance checks on specific subclasses of the interface -- or worse, solving cyclic imports by doing the import inside the function. ;)