summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-07-31Fix some small typing issues in interpreter.pymasterNirbheek Chauhan
2024-07-30backend/ninja: stop adding random attributes to BuildTargetsDylan Baker
Instead of storing the generated header cache in the Target, store it in the NinjaBackend, as it really is just data for the NinjaBackend to use.
2024-07-30tests: nasm: make it easier to debug generator() style buildEli Schwartz
By default, we build with debug info which can be useful for investigating why a test segfaults instead of either passing or failing. The nasm language hooks this up, but using nasm as a generator program does not. Bug: https://bugs.gentoo.org/936911
2024-07-30mdist: correctly detect dirty hg repos with non-English localeEli Schwartz
The command we use to heuristically parse whether it is dirty by interpreting prose descriptions of the repository state, is vulnerable to changes in locale resulting in failing to match the English word that means it is clean. Unfortunately, I am no mercurial expert so I am unaware if mercurial supports scripting, like git does. Perhaps the technology simply does not exist. A quick attempt at searching for the answer turned nothing up. It appears that #4278 had good cause indeed for using this prose parsing command. So, we simply sanitize the environment due to lack of any better idea. Bug: https://bugs.gentoo.org/936670
2024-07-30unittests: fix EncodingWarnings. minus 123 warnings collected by pytestEli Schwartz
2024-07-30compilers: straighten out CompileResult according to how it is actually usedEli Schwartz
In particular, it is only ever constructed once, and all but two of its arguments are always passed. So there's no reason or valid justification to initialize them as None or pretend that you have to check them for None values. Nor in fact does the command list need to be a default_factory. There are also two instance attributes which it is never instantiated with, but which are tracked after the fact. Don't add this to the signature for `__init__` as that is misleading.
2024-07-30compilers: simplify CompileResult / RunResult by using dataclassesEli Schwartz
None sentinel is replaced by field(), so we don't need to declare it Optional anymore.
2024-07-30flake8: move unused typing-only imports to TYPE_CHECKINGEli Schwartz
2024-07-30backends: start disentangling some hairy global annotationsEli Schwartz
create_target_linker_introspection is only ever called from one place, which passes in CompilerArgs. This was implemented in commit 5eb55075baa2883170a3d0cf3c0621aae56a1632 which performed this conversion as a preventative measure, since its type was not obvious (and thereby modified the *type* of the variable in place).
2024-07-30mypy: add annotation for object attribute used as a private cache via hasattrEli Schwartz
If it exists, we want to know it has the right type when we use it in ninjabackend.py.
2024-07-30mypy: reduce layers of indirection to ensure narrower type inferenceEli Schwartz
We have a function that wraps two others because it first checks whether the input is static or shared. By the same token, it has to return types valid for either. We already *know* that we are a shared library, so we can and should use the real function directly, which is both a micro-optimization of function call overhead, and fixes a mypy "union-attr" error.
2024-07-30mypy: fix broken logic checks that used "if func"Eli Schwartz
It's always true because the func is always a real, truthy func object. In the cmake case, the logic seems to be broken because if a path is not a file, then that includes the case where it does not exist. It also clearly meant "or" instead of "and". What actually ended up happening was that this check never fired at all. Because "if not func and not ..." would always fail, because "not func" is always false. Maybe we don't need this logic at all...
2024-07-30various low-hanging typing fruitEli Schwartz
ninjabackend.py goes down from 322 type errors to 253, mainly by marking functions as returning None.
2024-07-30ci: Update actions/upload-artifact to v4 to fix deprecationsNirbheek Chauhan
2024-07-30ci: Update actions/setup-python to v5 to fix deprecationsNirbheek Chauhan
2024-07-30ci: update actions/cache to v4 to fix deprecationsNirbheek Chauhan
2024-07-30ci: Update codeql-analysis action to fix deprecationsNirbheek Chauhan
2024-07-30ci: Update to checkout@v4 to squelch node warningsNirbheek Chauhan
Keep using v3 for Bionic because of https://github.com/mesonbuild/meson/pull/13424
2024-07-28add initial support for llvm-flangH. Vetinari
2024-07-28mtest: remove superfluous '\r' from read_decode()Mateusz Patyk
On Windows, the output read from the stream has '\r\n', which in .txt, .json and console logger (when captured to a file) translates to '\n\n'. This results in every log line being separated by an empty line.
2024-07-25coverage: improve llvm-cov detectionJannik Glückert
Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
2024-07-25backends/ninja: Add annotation for generate_coverage_commandsDylan Baker
2024-07-25backends/base: fix annotation for as_meson_exe_cmdlineDylan Baker
It returns (list[str], str)
2024-07-25backends/ninja: fix annotation of NinjaBuildElement.add_itemDylan Baker
The `elems` annotation was invalid
2024-07-25backends/ninja: Add annotation for NinjaBuildElement.ruleDylan Baker
This is a bit of a hack, since the rule is added outside of the `__init__` method, and that's probably bad. But at least we can get some additional help by telling type checkers what it will be
2024-07-25wrap: Use OSError instead of URLError for exception handlingNirbheek Chauhan
URLError is a subclass of OSError and intermittent server errors can manifest as OSError while reading instead of a URLError while establishing a connection, which will cause the fallback url to be ignored: ``` Looking for a fallback subproject for the dependency gudev-1.0 Downloading libgudev source from https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 HTTP Error 404: Not Found WARNING: failed to download with error: could not get https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 is the internet available?. Trying after a delay... HTTP Error 404: Not Found WARNING: failed to download with error: could not get https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 is the internet available?. Trying after a delay... HTTP Error 404: Not Found WARNING: failed to download with error: could not get https://gitlab.gnome.org/GNOME/libgudev/-/archive/238/libgudev-238.tar.bz2 is the internet available?. Trying after a delay... WARNING: failed to download with error: The read operation timed out. Trying after a delay... WARNING: failed to download with error: The read operation timed out. Trying after a delay... ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment. ```
2024-07-25backend/ninja: use 32k byte limit for command lines on !WindowsDylan Baker
At an OS level, Unix-like OSes usually have very large or even unlimited sized command line limits. In practice, however, many applications do not handle this (intentionally or otherwise). Notably Wine has the same limits Windows does, 32,768 characters. Because we previously double counted most characters, we papered over most situations that we would need an RSP file on Unix-like OSes with Wine. To fix this issue I have set the command line limit to 32k, this is still a massive command line to pass without an RSP file, and will only cause the use of an RSP file where it is not strictly necessary in a small number of cases, but will fix Wine applications. Projects who wish to not use an RSP file can still set the MESON_RSP_THRESHOLD environment variable to a very large number instead. Fixes: #13414 Fixes: cf0fecfce ("backend/ninja: Fix bug in NinjaRule.length_estimate")
2024-07-25backend/ninja: fix off-by-one in cmd length estimateDylan Baker
This causes us to not count the spaces between arguments, thereby undercounting the number of elements. This is extra important because we previously double counted all actual characters, covering this issue up. Fixes: cf0fecfce ("backend/ninja: Fix bug in NinjaRule.length_estimate")
2024-07-24CI: arch: do not package up source files for stepping through code with gdbEli Schwartz
makepkg can do this, if when building packages from source you enable debug. This is apparently being shipped in the /etc/makepkg.conf in docker containers, which means building AUR packages now requires installing debugedit, and then bloating your container with /usr/src/debug. We really do not want that. Reconfigure so that we do not, in fact, need that.
2024-07-24CI: gentoo: avoid bloating up the image with cache dataEli Schwartz
2024-07-24CI: arch: fix failing to detect any glib ecosystem toolsEli Schwartz
Due to reasons, Arch has chosen to split out the glib2 package into a glib2-devel package containing a small handful of python programs. The references to these programs are contained in the main glib2 package, so meson fails a lot in CI with e.g. ``` test cases/frameworks/7 gnome/gdbus/meson.build:1:18: ERROR: Dependency 'gio-2.0' tool variable 'gdbus_codegen' contains erroneous value: '/usr/bin/gdbus-codegen' This is a distributor issue -- please report it to your gio-2.0 provider. ```
2024-07-23CI: skip LTO tests on cygwinEli Schwartz
A GCC update broke this and is being investigated Bug: #13465
2024-07-23depfixer: Add missing annotation that breaks mypy checkDylan Baker
2024-07-23depfixer: deduplicate rpaths on darwinMonson Shao
Duplicated -delete_rpath arguments will cause macOS's install_name_tool failed.
2024-07-23Ensure override var exists. Closes #13402.Jussi Pakkanen
2024-07-23Remove reference to GPL in test filesCharles Brunet
We have permission to use that file. Fixes #13442.
2024-07-22mdist: don't fail on readonly source treesEli Schwartz
In commit c9aa4aff66ebbbcd3eed3da8fbc3af0e0a8b90a2 we added a refresh call to git to catch cases where checking for uncommitted changes would misfire. Unfortunately, that refresh performs a write operation, which in turn misfires on readonly media. We don't actually care about the return value of the refresh, since its purpose is solely to make the next command more accurate -- so ignore it. Fixes: c9aa4aff66ebbbcd3eed3da8fbc3af0e0a8b90a2 Fixes: #13461
2024-07-22cmake: extend library pattern to work on GNU/Hurd as wellPino Toscano
The existing "*-linux-gnu*" works on the Debian multiarch model for Linux architectures; tweak it to be "*-gnu*" so it works also for Hurd architectures. This makes the cmake-based search of dependencies work on Debian GNU/Hurd.
2024-07-22docs: make tutorial compatible with GLib versions older than 2.74LegStrong
2024-07-21zsh: Fix incorrect __meson_wrap_modes expansionJoey Pabalinas
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21zsh: Add completions for {rewrite,devenv,env2mfile,format,help} subcommandsJoey Pabalinas
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21zsh: Fix spelling errorsJoey Pabalinas
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21zsh: Add new vs backendsJoey Pabalinas
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21compilers: fix partial refactor of coredata optionsEli Schwartz
Fallout from the OptionStore refactor, and specifically commit 9a6fcd4d9a0c7bb248c5d0587632b741a3301e03. The `std` object was migrated from having an option itself, to having the value fetched and saved directly. In most cases, this also meant avoiding `.value`, but in a couple cases this refactor went overlooked, and crashed at runtime. Only affects Elbrus and Intel C++ compilers, seemingly. Fixes #13401
2024-07-21Remove the exe_exists functionMads Andreasen
This function is no longer used since shutil.which() is used instead.
2024-07-19modules/gnome: gnome.compile_resources() must have 'install_dir' if installingRaviRahar
Since they do not implement a default install dir like BuildTargets do. gnome.compile_resources() would result in an unhandled python exception when missing install_dir argument together with providing following arguments: gresource_bundle: true install: true closes: https://github.com/mesonbuild/meson/issues/13447 Signed-off-by: RaviRahar <ravirahar33@gmail.com>
2024-07-19compilers: handle -Wno-attributes= for GCCSam James
For other reasons, Meson transforms "-Wno-x" into "-Wx -Wno-x" for GCC, but this breaks with "-Wno-attributes=x" with: ``` cc1plus: error: arguments ignored for '-Wattributes='; use '-Wno-attributes=' instead ``` Suppress that workaround for -Wno-attributes=. Closes: https://github.com/mesonbuild/meson/issues/13022
2024-07-18Link include_directories to implicit_include_directoriesEnrico Zini
2024-07-17update script to build releases, to also build wheelsEli Schwartz
The commented-out command used "bdist", which produces a "dumb" format (that's what the setuptools docs call it! it's an alias for "bdist_dumb"). A tarball that can be extracted to / and installs a system image containing e.g. /usr/lib/python3.12 and /usr/share/, but no metadata outside of that. It apparently may have also generated a wheel at some point? But current versions of setuptools do no such thing. And wheels are what we actually want, since we uploaded them for years and they are faster for PyPI users to install. The canonical command name for producing wheels is actually "bdist_wheel" instead of "bdist_dumb". No clue what setuptools changed, about the latter, but the former definitely works.
2024-07-17Add script that builds releases.Jussi Pakkanen