aboutsummaryrefslogtreecommitdiff
path: root/test cases/vala
AgeCommit message (Collapse)AuthorFilesLines
2024-04-30Fix dependencies for vala.links #13158Ben Corby1-0/+64
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-23Fix compile.links for valaBen Corby1-0/+24
Fixes issue #12959 compiler.links command for vala crashes
2024-01-11Vala: fixes to gresource handling (#12418)Valeri4-0/+53
* Vala: depend on gresources Valac uses gresource at compile time to look up .ui files * Automatically pass `--gresourcesdir` to valac * gnome.compile_resources: clean up duplicate paths better * Add a test for improved gresouce handling
2023-12-05ninja backend: don't hide all compiler warnings for transpiled languagesEli Schwartz1-4/+0
This was originally added for vala only, with the rationale that vala generates bad code that has warnings. Unfortunately, the rationale was fatally flawed. The compiler warns about a number of things, which the user can control depending on their code (or their code generator's code), but some of those things are absolutely critical to warn about. In particular, GCC 14 and clang 17 are updating their defaults to warn -- and error by default for -- invalid C code that breaks the standard, but has been silently accepted for over 20 years "because lots of people do it". The code in question is UB, and compilers will generate faulty machine code that behaves erroneously and probably has a mass of CVEs waiting to happen. Compiler warnings are NOT safe to just... universally turn off. Compiler warnings could be either: - coding style lints - threatening statements that the code is factually and behaviorally wrong There is no magic bullet to ignore the former while respecting the latter. And the very last thing we should ever do is pass `-w`, since that causes ALL warnings to be disabled, even the manually added `-Werror=XXX`. If vala generated code creates warnings, then the vala compiler can decrease the log level by generating better code, or by adding warning suppression pragmas for *specific* issues, such as unused functions.
2023-10-09interpreter: Handle BuildTarget.vala_args as Files in the interpreterDylan Baker4-0/+138
Way back in Meson 0.25, support was added to `vala_args` for Files. Strangely, this was never added to any other language, though it's been discussed before. For type safety, it makes more sense to handle this in the interpreter level, and pass only strings into the build IR. This is accomplished by adding a `depend_files` field to the `BuildTarget` class (which is not exposed to the user), and adding the depend files into that field, while converting the arguments to relative string paths. This ensures both the proper build dependencies happen, as well as that the arguments are always strings.
2023-09-07Fix crash when installing a vala library and python sourcesXavier Claessens3-1/+8
Installing python sources causes the python module to call create_install_data() before Ninja backends adds extra outputs to Vala targets. Target objects are supposed to be immutable, adding outputs that late is totally wrong. Add extra vala outputs immediately, but be careful because the main output is only added later in post_init(). Luckily the base class already puts a placeholder item in self.outputs for the main filename so we can just replace self.outputs[0] instead of replacing the whole list which would contain vala outputs at that stage. This is surprisingly what SharedLibrary was already doing.
2023-02-07test cases/vala: Fix clang error during int to pointer coercionNirbheek Chauhan2-3/+3
``` clang [...] -c valaprog.p/GLib.Thread.c ../test cases/vala/5 target glib/GLib.Thread.vala:17:17: error: incompatible integer to pointer conversion passing 'gint' (aka 'int') to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion] g_thread_exit (get_ret_code ()); ^~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gthread.h:158:66: note: passing argument to parameter 'retval' here void g_thread_exit (gpointer retval); ^ 1 error generated. ```
2022-02-27test cases/vala: Fix test 14Mark Bolhuis1-1/+1
2022-01-15tests: Add a regression test for vapigen metadatadirNirbheek Chauhan2-0/+8
https://github.com/mesonbuild/meson/pull/9806
2021-11-08tests/vala: remove useless keyword argumentDylan Baker2-2/+0
The `packages` argument to `gnome.generate_gir` was allowed, but never did anything, so stop passing it.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz3-6/+4
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-05-20Revert "Disable failing Cygwin GIR test."Jon Turney1-4/+0
This partially reverts commit add502c6483bde9dc6a0ba80b3c79163304465a4.
2021-05-20vala: Test that adding C manually isn't requiuredDylan Baker1-1/+2
2021-02-18Disable failing Cygwin GIR test.Jussi Pakkanen1-0/+4
2020-11-17gnome: Drop use of volatile in GLib type functionsPhilip Withnall1-4/+4
See https://gitlab.gnome.org/GNOME/glib/-/issues/600 `volatile` was previously mistakenly used in GLib to indicate that a variable was accessed atomically or otherwise multi-threaded. It’s not meant for that, and up to date compilers (like gcc-11) will rightly warn about it. Drop the `volatile` qualifiers. Based on a patch by Jeff Law. See also http://isvolatileusefulwiththreads.in/c/. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-08-07interpreter: Lower case languages before checking if 'c' is in the listXavier Claessens1-1/+2
Fixes: #7495
2020-02-25test: merge installed_files.txt into test.jsonDaniel Mensinger10-26/+46
2019-03-22Disallow add_languages('vala') without 'c'Jon Turney1-1/+2
v2: Exercise add_lanagues('vala') after 'c' in a test case
2018-09-14run_proect_tests: add cygwin as platform fix nameMarco Trevisan (Treviño)3-5/+5
2018-09-14test cases: add missing files to installed_files.txtMarco Trevisan (Treviño)4-4/+10
All these are marked as files to be installed, so we need list them.
2018-08-15Kill tabs dead! For good!Jussi Pakkanen3-41/+41
2018-06-10vala: fix extract_all_objects() resultPaolo Bonzini8-0/+89
Because vala is not listed in clike_langs, is_source(fname) is returning False for Vala source files. Therefore, extract_all_objects() is completely empty for Vala programs. Fixes #791
2018-05-10vala: Fix shared_module linking with export_dynamic executableNirbheek Chauhan3-0/+44
Need to generate a vapi and a header, and then use that in the shared module. Needed for GNOME games. Closes https://github.com/mesonbuild/meson/issues/3538
2018-02-20vala: Fix path of C file with generated Vala filesNirbheek Chauhan1-0/+5
We missed one particular edge-case in #2413: when the generated vala file is inside --basedir, the path is not just the basename.c Since this case can never happen in a project test, this includes a unit test for the same. Closes https://github.com/mesonbuild/meson/issues/815
2018-01-06Use GObject-based libraries in test case/vala/11 generated vapiJon Turney5-10/+52
Non-GObject-based libraries are not (reliably) introspectable, and this only happens to work by accident, at the moment. Briefly: In non-libtool mode, g-ir-scanner inspects the run-time dependencies of a generated executable to determine the shared library name an -l flag corresponds to. But this generated executable only references the libraries by *_get_type() functions. So, if the library doesn't contain any Gobject-based types, it is not referenced, and this inspection fails with PECOFF binaries. It seems that distutils doesn't currently decide to use --as-needed, so this just happens to work on ELF.
2018-01-06Fix installed files check for gobject-introspection tests on CygwinJon Turney3-5/+5
g-ir-scanner --no-libtool needed some fixes similar to [1] for Cygwin, as well. Now that is done, it's possible to make these tests run and pass on Cygwin. [1] https://bugzilla.gnome.org/show_bug.cgi?id=781525
2017-12-11Fix Vala thread flag breakage (#2756)Ernestas Kulik2-0/+9
2017-10-03Add additional directory depth tests to Vala test case 22Alistair Thomas6-11/+22
2017-10-03Reduce code complexity, fix nested array in files instructionCorentin Noël1-2/+2
2017-10-02Allow different directories for Vala filesCorentin Noël4-0/+30
2017-09-18ninja: Fix the dependency on the VAPI when 'vala_vapi' is usedGuillaume Poirier-Morency2-3/+7
2017-06-30vala: Add a shared module testcase using 'GLib.TypeModule'Guillaume Poirier-Morency5-0/+106
2017-06-27Merged Genie support.Jussi Pakkanen10-0/+72
2017-06-27Merge pull request #1986 from phako/masterJussi Pakkanen1-1/+4
Skip handling non-available dependencies
2017-06-26Add test for Genie with multiple and mixed sourcesAlistair Thomas8-0/+64
2017-06-26Add test case for compiling a Genie fileAlistair Thomas2-0/+8
2017-06-26Add a test for ignoring not-found vala depsNirbheek Chauhan1-1/+4
https://github.com/mesonbuild/meson/pull/1986
2017-06-22vala: Only add --use-header for unity buildsNirbheek Chauhan1-1/+9
Closes https://github.com/mesonbuild/meson/issues/1969
2017-06-17Make external library no-op when used with incompatible target (#1941)Nirbheek Chauhan1-1/+5
* tests: Add a test for C library in Vala target https://github.com/mesonbuild/meson/issues/1939 * Make external library no-op when used with incompatible target This is how it used to behave earlier, but we accidentally regressed Closes https://github.com/mesonbuild/meson/issues/1939
2017-06-02Don't add dependencies recursively while linkingNirbheek Chauhan1-1/+1
We were doing this on the basis of an old comment, but there was no test for it and I couldn't reproduce the issue with clang on Linux at all. Let's add a (somewhat comprehensive) test and see if it breaks anywhere if we stop doing this. Halves the size of gstreamer's build.ninja from 20M to 8.7M Closes https://github.com/mesonbuild/meson/issues/1057
2017-05-14ninja: Deduplicate dependent vapisOle André Vadla Ravnås4-0/+52
The Vala compiler does not like being fed the same .vapi multiple times.
2017-05-13ninja: Also include Vala headers in generated headersOle André Vadla Ravnås7-0/+60
2017-04-12vala: Allow installation into default directoriesNirbheek Chauhan4-13/+11
For generated headers, vapis, and GIRs. https://github.com/mesonbuild/meson/pull/1469#issuecomment-292814000
2017-04-04Support multiple install dirs for built/custom targetsNirbheek Chauhan2-0/+40
You can now pass a list of strings to the install_dir: kwarg to build_target and custom_target. Custom Targets: =============== Allows you to specify the installation directory for each corresponding output. For example: custom_target('different-install-dirs', output : ['first.file', 'second.file'], ... install : true, install_dir : ['somedir', 'otherdir]) This would install first.file to somedir and second.file to otherdir. If only one install_dir is provided, all outputs are installed there (same behaviour as before). To only install some outputs, pass `false` for the outputs that you don't want installed. For example: custom_target('only-install-second', output : ['first.file', 'second.file'], ... install : true, install_dir : [false, 'otherdir]) This would install second.file to otherdir and not install first.file. Build Targets: ============== With build_target() (which includes executable(), library(), etc), usually there is only one primary output. However some types of targets have multiple outputs. For example, while generating Vala libraries, valac also generates a header and a .vapi file both of which often need to be installed. This allows you to specify installation directories for those too. # This will only install the library (same as before) shared_library('somevalalib', 'somesource.vala', ... install : true) # This will install the library, the header, and the vapi into the # respective directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : ['libdir', 'incdir', 'vapidir']) # This will install the library into the default libdir and # everything else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [true, 'incdir', 'vapidir']) # This will NOT install the library, and will install everything # else into the specified directories shared_library('somevalalib', 'somesource.vala', ... install : true, install_dir : [false, 'incdir', 'vapidir']) true/false can also be used for secondary outputs in the same way. Valac can also generate a GIR file for libraries when the `vala_gir:` keyword argument is passed to library(). In that case, `install_dir:` must be given a list with four elements, one for each output. Includes tests for all these. Closes https://github.com/mesonbuild/meson/issues/705 Closes https://github.com/mesonbuild/meson/issues/891 Closes https://github.com/mesonbuild/meson/issues/892 Closes https://github.com/mesonbuild/meson/issues/1178 Closes https://github.com/mesonbuild/meson/issues/1193
2016-12-19tree-wide: remove unused importsIgor Gnatenko1-1/+0
./setup.py:17:1: F401 'os' imported but unused import os ^ ./setup.py:37:1: F401 'stat.ST_MODE' imported but unused from stat import ST_MODE ^ ./run_tests.py:17:1: F401 'os' imported but unused import subprocess, sys, os ^ ./run_tests.py:18:1: F401 'shutil' imported but unused import shutil ^ ./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency ^ ./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused from . import coredata ^ ./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/interpreter.py:32:1: F401 're' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused import os, stat, glob, subprocess, shutil ^ ./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused import platform, subprocess, operator, os, shutil, re, sys ^ ./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused import os, subprocess ^ ./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused from .. import coredata, build ^ ./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused import subprocess ^ ./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused import os, sys, subprocess ^ ./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException ^ ./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused import re ^ ./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused import sys, os ^ ./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ ./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused import os ^ ./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-16tests/vala/14: Disable running of GTK+ testNirbheek Chauhan1-1/+2
There's no X on the Travis CI, so disable this for now.
2016-12-15Add a test that uses hand-written vapi filesNirbheek Chauhan3-0/+23
To use these, you just need to add the .vapi file to your target as a source. This test specifically tests that hand-written vapis referring to C headers work.
2016-12-15Test target glib version and gresources in ValaNirbheek Chauhan5-0/+76
Test that the --target-glib= argument while compiling Vala files is set properly by using a feature (GtkTemplate) that requires glib >=2.38. At the same time, also test that the appropriate gresource arguments are also set for Vala targets. For each gresource.xml that is compiled, we must pass --gresources=path/to/gresource.xml to valac.
2016-12-15Add a testcase for 'Duplicate outputs' bugSam Thursfield8-0/+136
With current Meson, this fails to configure with the following error: Duplicate output 'dependency-generated/enum-types.h' from 'CustomTarget' 'enum-types.h'; conflicts with 'dependency-generated/enum-types.h' from 'CustomTarget' 'enum-types.h'
2016-12-04Renamed dirs to plug holes in numbering.Jussi Pakkanen18-0/+0