Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Ilja Friedel <ihf@google.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v5 4/7] tests/meson.build: create testlists for tests
Date: Fri, 1 Sep 2023 10:34:15 +0200	[thread overview]
Message-ID: <20230901103415.56a65e92@maurocar-mobl2> (raw)
In-Reply-To: <20230901094540.564ce3f6@maurocar-mobl2>

On Fri, 1 Sep 2023 09:45:40 +0200
Mauro Carvalho Chehab <mauro.chehab@linux.intel.com> wrote:

> On Thu, 31 Aug 2023 18:24:05 -0700
> Ilja Friedel <ihf@google.com> wrote:
> 
> > Hi Mauro,
> > 
> > On Thu, Aug 31, 2023 at 2:28 AM Mauro Carvalho Chehab <  
> > mauro.chehab@linux.intel.com> wrote:    
> >   
> > > The testlist files are used for two purposes:
> > >
> > > 1. for documentation build;
> > > 2. for CI automation to run the tests.
> > >
> > > While right now Intel CI doesn't depend on the produced testlists,
> > > this may change in the future. So, instead of making the testlist
> > > build dependent of testplan, the better seems to verify if the
> > > build is not a cross-compilation, e. g. with a patch similar to
> > > the enclosed one.
> > >    
> > 
> > In my experience it is better to separate build phases from phases that use
> > these binaries and execute them. It makes steps more modular and clearer
> > where any failures come from. Having test lists sounds like a good idea
> > and beneficial to other architectures.  
> 
> My original approach was to do that, but I had some issues due to the
> lack of some features with the minimal meson version supported by IGT
> (and upgrading the version would also break gitlab pipelines).

Btw, if you want to dig it deeper, the problem I faced is with
regards to the name for the custom_target, e.g., on this code
snippet:

	foreach prog : test_progs
		testexe = executable(prog, [prog + '.c'] + extra_sources.get(prog, []),
			   dependencies : test_deps + extra_dependencies.get(prog, []),
			   install_dir : libexecdir,
			   install_rpath : libexecdir_rpathdir,
			   install : true)
		test_executables += testexe
		test_list += prog
		name = prog.split('/').get(-1)
		if not meson.is_cross_build()
			testlist_files += custom_target(name + '.testlist',
				    build_by_default : true,
				    command : [testexe, '--show-testlist'],
				    capture : true,
				    output : name + '.testlist')
		endif
	endforeach

the custom_target needs name + '.testlist'. Newer versions of
Meson have a .name() function to get the name of the target built
via executable[1]. So, a simple for at the end would do the work.
Something like:

    if not meson.is_cross_build()
	foreach prog : test_executables
		name = prog.name()
		testlist_files += custom_target(name + '.testlist',
			    build_by_default : true,
			    command : [testexe, '--show-testlist'],
			    capture : true,
			    output : name + '.testlist')
	endif
    endif

But this would require setting meson minimal version to 0.54.

[1] https://mesonbuild.com/Reference-manual_returned_exe.html#build_tgtname

I was unable to find a way to do the same with version 0.48. One option
would be to change minimal version to 0.54, but, as I said, this would
require some changes at gitlab pipeline. No idea how to do that, nor I
have access to change pipeline settings.

We could do it on a different way, by creating a list of names, but
lists on Meson are constant and, on version 0.48, you can't append
values to them (at least this failed on my tests).

> > > Could you please check if this will address the issue? I don't have
> > > a cross-compilation environment handy to test it, so it would be
> > > easier if you could test it for me.
> > >    
> > 
> > The enclosed patch "[PATCH i-g-t] tests/meson.build: only generate
> > testlists
> > on native builds" works for our build system. If you want to stick with it,
> > could you please land it in the upstream tree?   
> 
> I sent the patch upstream too. Had to do a rebase today due to
> a conflict (that actually made the final patch simpler):
> 
> 	https://patchwork.freedesktop.org/series/123104/
> 
> Could you please re-test and review or ack it? I'll merge it after
> getting your R-B or A-B.
> 
> > Otherwise I could try a different patch as well.  
> 
> Sure! If you'd like to spin a different patch addressing it, go
> for it.
> 
> Regards,
> Mauro

  reply	other threads:[~2023-09-01  8:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 11:53 [igt-dev] [PATCH i-g-t v5 0/7] Speedup IGT build time Mauro Carvalho Chehab
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 1/7] tests/meson.build: Simplify builds for core and i915 targets Mauro Carvalho Chehab
2023-07-10 17:51   ` Kamil Konieczny
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 2/7] lib/igt_core: use the macro when checking for list_subtests Mauro Carvalho Chehab
2023-07-10 17:58   ` Kamil Konieczny
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 3/7] lib/igt_core: add an option to show the testlist Mauro Carvalho Chehab
2023-07-10 18:11   ` Kamil Konieczny
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 4/7] tests/meson.build: create testlists for tests Mauro Carvalho Chehab
2023-07-10 18:17   ` Kamil Konieczny
2023-08-30 21:41     ` Mark Yacoub
     [not found]       ` <CAAea8Y3a_RjknGcn6-v9CVUVpcmMuASnJKfn73KGtQzbXo0TcA@mail.gmail.com>
2023-08-31  9:28         ` Mauro Carvalho Chehab
     [not found]           ` <CAAea8Y13=CguTipLJjJJt_pBvaiv92DViWJBZwvtjm7W-SU+vw@mail.gmail.com>
2023-09-01  7:45             ` Mauro Carvalho Chehab
2023-09-01  8:34               ` Mauro Carvalho Chehab [this message]
2023-09-01 11:01               ` Mauro Carvalho Chehab
     [not found]               ` <CAAea8Y2hX2=TjXmGJN=tFBSgFPqe8J5EgDCkoR7OMVy+J2t+cA@mail.gmail.com>
2023-09-04  6:53                 ` Mauro Carvalho Chehab
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 5/7] scripts/test_list.py: speedup testlist check logic Mauro Carvalho Chehab
2023-07-10 18:23   ` Kamil Konieczny
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 6/7] tests/build: Generate and store an intel-ci.testlist Mauro Carvalho Chehab
2023-07-10 18:26   ` Kamil Konieczny
2023-07-10 11:53 ` [igt-dev] [PATCH i-g-t v5 7/7] scripts/test_list.py: optimize check regex Mauro Carvalho Chehab
2023-07-10 18:27   ` Kamil Konieczny
2023-07-10 13:50 ` [igt-dev] ✓ Fi.CI.BAT: success for Speedup IGT build time Patchwork
2023-07-10 14:00 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-10 17:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-31 11:36 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Speedup IGT build time (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230901103415.56a65e92@maurocar-mobl2 \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ihf@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox