Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mtest: only build what is needed for the tests #7902

Merged
merged 2 commits into from
Dec 15, 2020

Conversation

bonzini
Copy link
Contributor

@bonzini bonzini commented Oct 26, 2020

It is a usual workflow to fix something and retest to see if it is fixed using a particular test. When tests start to become numerous, it becomes time consuming for "meson test" to relink all of them (and in fact rebuild the whole project) where the user has already specified the tests they want to run, as well as the tests' dependencies.

Teach meson to be smart and only build what is needed for the test (or suite) that were specified.

Fixes: #7473

@bonzini bonzini requested a review from jpakkane as a code owner October 26, 2020 12:53
@bonzini bonzini force-pushed the mtest-build-depends-only branch from d51724f to 7fefdf8 Compare October 26, 2020 13:11
@lgtm-com
Copy link

lgtm-com bot commented Oct 26, 2020

This pull request introduces 1 alert when merging 7fefdf8 into 431f0b0 - view on LGTM.com

new alerts:

  • 1 for Unreachable code

@bonzini bonzini force-pushed the mtest-build-depends-only branch 2 times, most recently from 85669c6 to 3aeb3e6 Compare October 26, 2020 13:39
@bonzini bonzini force-pushed the mtest-build-depends-only branch from 3aeb3e6 to fce03a7 Compare November 2, 2020 20:06
@bonzini
Copy link
Contributor Author

bonzini commented Nov 2, 2020

The failure is weird since it's a SIGSEGV in a test. It shouldn't be affected by this patch. Let's see if it's transient...

EDIT: it went away upon rebase.

@bonzini bonzini force-pushed the mtest-build-depends-only branch 2 times, most recently from 770ec55 to 004b986 Compare November 15, 2020 13:22
@bonzini bonzini mentioned this pull request Nov 19, 2020
13 tasks
@bonzini bonzini force-pushed the mtest-build-depends-only branch from 004b986 to 9d05b6d Compare November 24, 2020 21:47
@nickbroon
Copy link

This is great. I have targets that consists of 100s of file and have LTO enabled by default so take a long time build, but are unneeded by UT tests. This would allow to rapidly build tests during a iterative develop work.

@bonzini
Copy link
Contributor Author

bonzini commented Dec 12, 2020

ping...

With the next patch, "meson test" will be using the targets introspection
information.  Provide helper functions to share bits of code between
mintro.py and mtest.py.
It is a usual workflow to fix something and retest to see if it is fixed using a
particular test.  When tests start to become numerous, it becomes time consuming
for "meson test" to relink all of them (and in fact rebuild the whole project)
where the user has already specified the tests they want to run, as well as
the tests' dependencies.

Teach meson to be smart and only build what is needed for the test (or suite)
that were specified.

Fixes: mesonbuild#7473
Related: mesonbuild#7830
@bonzini bonzini force-pushed the mtest-build-depends-only branch from 9d05b6d to 79e2c52 Compare December 14, 2020 09:54
@jpakkane jpakkane merged commit d32d0d6 into mesonbuild:master Dec 15, 2020
wereii added a commit to wereii/meson that referenced this pull request Dec 28, 2020
@wereii wereii mentioned this pull request Dec 28, 2020
jpakkane pushed a commit that referenced this pull request Dec 28, 2020
@bonzini bonzini deleted the mtest-build-depends-only branch January 6, 2021 10:01
@xclaesse
Copy link
Member

I think this PR causes this regression: https://gitlab.freedesktop.org/ocrete/libnice/-/jobs/7348274

CC @ocrete

@xclaesse
Copy link
Member

os.path.relpath(f, wd) returns path with \ seperator on Windows, but ninja targets always uses / separator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

meson test with a specific test should only build what is needed for the test
5 participants