aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2024-05-19Fix new linter warnings.lintfixesJussi Pakkanen14-8/+22
2024-05-15Merge pull request #11421 from mon/ti-armclangJussi Pakkanen3-10/+30
Basic support for TI Arm Clang toolchain
2024-05-09implement @PLAINNAME0@ and @BASENAME0@Stas Sergeev2-2/+13
@PLAINNAME@ and @BASENAME@ cannot be used in custom_target() with multiple inputs. For those, similar macros are needed with an index. Fixes #13164
2024-05-08mtest: Set MESON_TEST_ITERATION to the current iteration of the testDaan De Meyer1-2/+3
When running our integration tests in systemd we depend on each test having a unique name. This is always the case unless --repeat is used, in which case multiple tests with the same name run concurrently which causes issues when allocating resources that use the test name as the identifier. Let's set MESON_TEST_ITERATION to the current iteration of the test so we can use $TEST_NAME-$TEST_ITERATION as our test identifiers which will avoid these issues.
2024-05-07cuda: disable thin archives when 'cuda' is enabled globallyDavid Seifert1-1/+15
Bug: mesonbuild/meson/pull/9453 Bug: mesonbuild/meson/issues/9479#issuecomment-953485040
2024-05-07cuda: pass static archives to nvcc without -Xlinker= prefixDavid Seifert2-1/+13
2024-05-07cuda: pull in libdir when linking C/C++David Seifert1-1/+1
* In `CudaDependency._detect_language`, the first detected language is considered the linking one. Since `nvcc`/`cuda` implicitly know where the cuda dependency lives, this leads to situations where `cpp` as linking language is erroneously detected as `cuda` and then misses the `-L` argument.
2024-05-07Add support for GCC's null_terminated_string_arg function attributeTristan Partin1-0/+2
This is new as of 14.1.
2024-05-07Use correct subdir when generating processed file pathTristan Partin1-5/+1
We need the subdir of where the output file will actually be created, not the current subdir of the interpreter. Fixes: #13168
2024-05-01Add required kwarg to compiler.{compiles,links,run}Tristan Partin1-8/+39
This is a similar commit to the one that added required to all the compiler.has* functions.
2024-05-01use a for loop, check more linker optionsmatyalatte1-12/+26
2024-05-01vs2010backend: fix an error when using /MANIFEST:NOmatyalatte1-5/+20
2024-04-30Fix dependencies for vala.links #13158Ben Corby1-0/+44
Using the keyword argument dependencies with compiler.links() for vala doesn't work as the library being linked to needs to be prefixed with --pkg= before being passed to valac.
2024-04-28catch build files that cannot be opened in utf8 mode and emit useful errorEli Schwartz5-17/+28
Previously, if a junked meson.build or native.ini was used we got a lengthy traceback ending in UnicodeDecodeError. Fixes: #13154 Fixes: #13156
2024-04-28add punctuation mark to make log more understandablekkz1-3/+3
2024-04-28Add support for depending on ObjFWJonathan Schleifer2-0/+27
This uses objfw-config to get to the flags, however, there's still several todos that can only be addressed once dependencies can have per-language flags.
2024-04-28Prefer Clang over GCC for Objective-C(++)Jonathan Schleifer1-5/+4
GCC only has very limited support for Objective-C and doesn't support any of the modern features, so whenever Clang is available, it should be used instead. Essentially, the only reason to ever use GCC for Objective-C is that Clang simply does not support the target system.
2024-04-27mdist: gracefully handle stale Git indexBenjamin Gilbert1-0/+1
Running `touch` on a tracked file in Git, to update its timestamp, and then running `meson dist` would cause dist to fail: ERROR: Repository has uncommitted changes that will not be included in the dist tarball Use --allow-dirty to ignore the warning and proceed anyway Unlike `git status` and `git diff`, `git diff-index` doesn't refresh the index before comparing, so stat changes are assumed to imply content changes. Run `git update-index -q --refresh` first to refresh the index. Fixes: #12985
2024-04-27compilers/fortran: fix werror options for Intel compilersBenjamin Gilbert1-0/+6
Unlike in the Intel C compiler, -Werror and /WX are not accepted.
2024-04-27backend/ninja: use generate_basic_compiler_args() for C#, Java, SwiftBenjamin Gilbert3-14/+19
C#, Java, and Swift targets were manually collecting compiler arguments rather than using the helper function for this purpose. This caused each target type to add arguments in a different order, and to forget to add some arguments respectively: C#: /nologo, -warnaserror Java: warning level (-nowarn, -Xlint:all, -Xdoclint:all), debug arguments (-g, -g:none), -Werror Swift: -warnings-as-errors Fix this. Also fix up some no-longer-unused argument processing in the Compiler implementations.
2024-04-26nasm: Fallback to native compiler when cross compilingXavier Claessens1-3/+9
If nasm is not defined in cross file binaries we can fallback to build machine nasm. When cross compiling C code we need a different gcc binary for native and cross targets, e.g. `gcc` and `x86_64-w64-mingw32-gcc`. But when cross compiling NASM code the compiler is the same, it is the source code that has to be made for the target platform. We can thus use nasm from build machine's PATH to cross compile for Windows on Linux for example. The difference is the arguments Meson will pass when invoking nasm e.g. `-fwin64`. That is already handled by NasmCompiler class.
2024-04-25Catch Python exception in the event alignment can't be converted to intTristan Partin1-1/+9
The user almost certainly has to be using a compiler wrapper script that doesn't actually work if we land here. Fixes: #12982
2024-04-25find_library: improve the docs and FeatureNew to fully describe the changeEli Schwartz1-1/+1
The docs didn't really explain what the issue was with using it. And it's not actually a "crash" either way. The FeatureNew mentions that "name" is new, but it is standard for these warnings to tell you both the type of object you're operating on and the name of the method that is an issue. This omitted the former, and was very confusing.
2024-04-25dependencies/boost: Add new homebrew rootDylan Baker1-2/+7
On Apple Silicon the default search path is /opt/homebrew instead of /usr/local.
2024-04-24rust: Fix warning_level=everything caseXavier Claessens1-0/+1
Fixes: #13100
2024-04-24backend/ninja: use re.match instead of re.searchDylan Baker1-1/+1
Since we've already determined that the first character is the start of the expression anyway.
2024-04-24backend: fix type annotation of Backend.generateDylan Baker5-5/+6
`func(value: dict = None)` is invalid, it must be `func(value: dict | None = None)`, or in our older syntax: `T.Optional[T.Dict] = None`
2024-04-24backend/ninja: Fix bug in NinjaRule.length_estimateDylan Baker1-8/+7
The code would create a dictionary that was of type `str : list[str] | str | None`. Then would later try to call `len(' '.join(dict[key]))`. This would result in two different bugs: 1. If the value is `None` it would except, since None isn't iterable and cannot be converted to a string 2. If the value was a string, then it would double the length of the actual string and return that, by adding a space between each character
2024-04-24backend/ninja: add typing annotations to NinjaRuleDylan Baker1-14/+16
2024-04-24cmake/interpreter: Annotate and style module-level constantsJouke Witteveen1-23/+25
2024-04-24Merge pull request #13112 from DaanDeMeyer/interactiveJussi Pakkanen1-14/+24
Add meson test --interactive
2024-04-23mtest: Connect /dev/null to stdin when not running in interactive modeDaan De Meyer1-1/+5
This allows tests to check whether stdin is a tty to figure out if they're running in interactive mode or not. It also makes sure that tests that are not running in interactive mode don't inadvertendly try to read from stdin.
2024-04-23Add meson test --interactiveDaan De Meyer1-13/+19
This is very similar to --gdb, except it doesn't spawn GDB, but connects stdin/stdout/stderr directly to the test itself. This allows interacting with integration tests that spawn a shell in a container or virtual machine when the test fails. In systemd we're migrating our integration tests to run using the meson test runner. We want to allow interactive debugging of failed tests directly in the virtual machine or container that is spawned to run the test. To make this possible, we need meson test to connect stdin/stdout/stderr of the test directly to the user's terminal, just like is done with the --gdb option.
2024-04-23interpreter: implement the `name()` method for `ExternalLibraryHolder`Dylan Baker1-0/+8
This allows `cc.find_library().name()` to work, just like `dependency().name()`. Fixes: #13053
2024-04-23Fix compile.links for valaBen Corby1-0/+40
Fixes issue #12959 compiler.links command for vala crashes
2024-04-23Pass --quiet to glib-genmarshalTristan Partin1-1/+1
No need to spam about reading the input file. Fixes: #13119
2024-04-22add an error message for targets that are not dependenciesMomtchil Momtchev1-0/+2
2024-04-22coredata: Fix is_per_machine_option() for builtinsOle André Vadla Ravnås1-1/+1
The keys in BUILTIN_OPTIONS_PER_MACHINE are OptionKey values, not strings. This fixes a regression introduced in 71db6b0.
2024-04-22Merge pull request #12808 from U2FsdGVkX1/masterJussi Pakkanen1-4/+4
Fix ninja cannot find the library when libraries contain symlinks.
2024-04-18backend/ninja: Fix cases where None is passed when unexpectedDylan Baker1-5/+11
When getting debug file arguments we can sometimes pass None, where a None is unexpected. This becomes a particular problem in the Cuda compiler, where the output will unconditionally be concatenated with a static string, resulting in an uncaught exception. This is really easy to spot once we annotate the functions in question, where a static type checker like mypy easily spots the issue. This commit adds those annotations, and then fixes the resulting error. Fixes: #12997
2024-04-16python: Fix header check for system methodJonathon Anderson1-1/+1
Fixes https://github.com/mesonbuild/meson/issues/12862
2024-04-15allow any alternative python freeze tool to work with mesonEli Schwartz1-2/+5
Any code that needs to know mesonlib.python_command currently assumes the PyInstaller bundle reference is added to the sys module, which means that it assumes the only freeze tool used is PyInstaller. Really, all we need to check is sys.frozen as it's never normally set, but always set for a freeze. We don't care if it was PyInstaller specifically, and we don't need its bundle directory. See https://github.com/mesonbuild/meson/discussions/13007
2024-04-15compilers: fix crash when compiler check returns None outputEli Schwartz1-1/+1
Popen_safe_logged has a small inefficiency. It evaluates the stripped version of stdout/stderr before checking if it exists, for logging purposes. This would sometimes crash, if it was None instead of ''. Fixes #12979
2024-04-15micro-optimize iteration of evaluated setEli Schwartz1-1/+1
It is generally accepted practice to convert dict.keys() to a list before iterating over it and e.g. deleting values, as keys returns a live-action view. In this case, we use the difference of *two* dict keys, which returns a regular non-view set and doesn't need protecting. Iteration order doesn't matter (the set already randomizes it anyway). Avoid the cost of converting to a list.
2024-04-15Add bztar support to meson distTristan Partin1-3/+10
Some projects, like Postgres, distribute code in this format.
2024-04-15Don't sanitize a None path when checking for, but could not find, ↵William D. Jones1-2/+2
unsupported cl clones.
2024-04-14Clarify mutable objects usageXavier Claessens3-11/+40
Only Environment and ConfigurationData are mutable. However, only ConfigurationData becomes immutable after first use which is inconsistent. This deprecates modification after first use of Environment object and clarify documentation.
2024-04-14Merge pull request #11737 from ↵Jussi Pakkanen3-17/+108
amyspark/amyspark/add-nasm-building-rules-to-xcode backends: Add Nasm build rules to Xcode
2024-04-11dependencies/dev: make the warning about LLVM's CMake non-fatalDylan Baker1-4/+5
This isn't case where fatal is appropriate, as the end user has no control over this, and it may not be hit in all configurations of a project.
2024-04-11dependencies/llvm: Try to make warning about CMake betterDylan Baker1-3/+24
We have seen a number of bugs from people confused by warning that the need both a C and C++ compiler to use the CMake method. This attempts to provide a more helpful error message.