Skip to contentSkip to conversation

meson: Allow source location to be configurable

PATCH In review Richard Purdie 3 participants 5 messages Mar 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 meson: Allow source location to be configurable

Hardcoding a build source path inside a binary when cross compiling isn't appropriate and breaks build reproducibility. Allow the srcdir to be specified by an optional configuration option to meson which can be used to override with the correct path.

---
 lib/meson.build   | 6 +++++-
 meson_options.txt | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
lib/meson.build +5 -1
index 114eadde..672b4206 100644
@@ -125,7 +125,11 @@ if chamelium.found()
 	lib_sources += 'igt_chamelium_stream.c'
 endif
 
-srcdir = join_paths(meson.source_root(), 'tests')
+if get_option('srcdir') != ''
+    srcdir = join_paths(get_option('srcdir'), 'tests')
+else
+    srcdir = join_paths(meson.source_root(), 'tests')
+endif
 
 lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
 		      fallback : 'NO-GIT',
meson_options.txt +4 -0
index ff3abf08..bed63efa 100644
@@ -50,3 +50,7 @@ option('use_rpath',
        type : 'boolean',
        value : false,
        description : 'Set runpath on installed executables for libigt.so')
+
+option('srcdir',
+       type : 'string',
+       description : 'Override the source code path embedded inside target binaries (optional)')
Signature · 6 lines
2.27.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for meson: Allow source location to be configurable (rev2)

== Series Details ==

== Series Details ==

Series: meson: Allow source location to be configurable (rev2)
URL : https://patchwork.freedesktop.org/series/87456/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9818 -> IGTPW_5561
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/index.html

Known issues
------------

Here are the changes found in IGTPW_5561 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@amdgpu/amd_basic@semaphore:
- fi-icl-y: NOTRUN -> [SKIP][1] ([fdo#109315]) +17 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-icl-y/igt@amdgpu/[email protected]

* igt@gem_exec_fence@basic-busy@bcs0:
- fi-apl-guc: NOTRUN -> [SKIP][2] ([fdo#109271]) +1 similar issue
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-apl-guc/igt@gem_exec_fence@[email protected]

* igt@gem_huc_copy@huc-copy:
- fi-icl-y: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-icl-y/igt@[email protected]

* igt@i915_hangman@error-state-basic:
- fi-apl-guc: NOTRUN -> [DMESG-WARN][4] ([i915#1610])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-apl-guc/igt@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-icl-y: NOTRUN -> [SKIP][5] ([fdo#109284] / [fdo#111827]) +8 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-icl-y/igt@[email protected]

* igt@kms_chamelium@hdmi-crc-fast:
- fi-bsw-n3050: NOTRUN -> [SKIP][6] ([fdo#109271] / [fdo#111827]) +8 similar issues
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-bsw-n3050/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-icl-y: NOTRUN -> [SKIP][7] ([fdo#109285])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-icl-y/igt@[email protected]

* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-icl-y: NOTRUN -> [SKIP][8] ([fdo#109278])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-icl-y/igt@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
- fi-bsw-n3050: NOTRUN -> [SKIP][9] ([fdo#109271]) +39 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-bsw-n3050/igt@[email protected]

* igt@kms_psr@primary_mmap_gtt:
- fi-icl-y: NOTRUN -> [SKIP][10] ([fdo#110189]) +3 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-icl-y/igt@kms_psr@primary_mmap_gtt.html

* igt@prime_vgem@basic-userptr:
- fi-tgl-y: [PASS][11] -> [DMESG-WARN][12] ([i915#402]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9818/fi-tgl-y/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-tgl-y/igt@[email protected]

* igt@runner@aborted:
- fi-apl-guc: NOTRUN -> [FAIL][13] ([i915#2426])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-apl-guc/igt@[email protected]

#### Possible fixes ####

* igt@fbdev@read:
- fi-tgl-y: [DMESG-WARN][14] ([i915#402]) -> [PASS][15] +2 similar issues
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9818/fi-tgl-y/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-tgl-y/igt@[email protected]

* igt@gem_linear_blits@basic:
- fi-kbl-8809g: [TIMEOUT][16] ([i915#2502]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9818/fi-kbl-8809g/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-kbl-8809g/igt@[email protected]

* igt@kms_chamelium@hdmi-edid-read:
- fi-kbl-7500u: [FAIL][18] ([i915#2128]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9818/fi-kbl-7500u/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/fi-kbl-7500u/igt@[email protected]

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1610]: https://gitlab.freedesktop.org/drm/intel/issues/1610
[i915#2128]: https://gitlab.freedesktop.org/drm/intel/issues/2128
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2426]: https://gitlab.freedesktop.org/drm/intel/issues/2426
[i915#2502]: https://gitlab.freedesktop.org/drm/intel/issues/2502
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402

Participating hosts (42 -> 40)
------------------------------

Additional (3): fi-icl-y fi-apl-guc fi-bsw-n3050
Missing (5): fi-ilk-m540 fi-bsw-cyan fi-ctg-p8600 fi-dg1-1 fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_6016 -> IGTPW_5561

CI-20190529: 20190529
CI_DRM_9818: fb3b93df7979b1cf6b69ac801d1703c0bf1dde66 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5561: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/index.html
IGT_6016: 2107b0a53692fb329175bc16169c3699712187aa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.IGT: success for meson: Allow source location to be configurable (rev2)

In reply to Richard Purdie
== Series Details ==

== Series Details ==

Series: meson: Allow source location to be configurable (rev2)
URL : https://patchwork.freedesktop.org/series/87456/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_9818_full -> IGTPW_5561_full
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/index.html

Changes
-------

No changes found

Participating hosts (10 -> 8)
------------------------------

Missing (2): pig-kbl-iris pig-icl-1065g7

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_6016 -> IGTPW_5561
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_9818: fb3b93df7979b1cf6b69ac801d1703c0bf1dde66 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_5561: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/index.html
IGT_6016: 2107b0a53692fb329175bc16169c3699712187aa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_5561/index.html

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

Reviewed-by on v2 1/1
#3 lore raw
In reply to Richard Purdie
Quoted 6 lines · Richard Purdie

Hardcoding a build source path inside a binary when cross compiling isn't appropriate and breaks build reproducibility. Allow the srcdir to be specified by an optional configuration option to meson which can be used to override with the correct path.

Quoted 41 lines
---
 lib/meson.build   | 6 +++++-
 meson_options.txt | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
lib/meson.build +5 -1
index 114eadde..672b4206 100644
@@ -125,7 +125,11 @@ if chamelium.found()
 	lib_sources += 'igt_chamelium_stream.c'
 endif
 
-srcdir = join_paths(meson.source_root(), 'tests')
+if get_option('srcdir') != ''
+    srcdir = join_paths(get_option('srcdir'), 'tests')
+else
+    srcdir = join_paths(meson.source_root(), 'tests')
+endif
 
 lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
 		      fallback : 'NO-GIT',
meson_options.txt +4 -0
index ff3abf08..bed63efa 100644
@@ -50,3 +50,7 @@ option('use_rpath',
        type : 'boolean',
        value : false,
        description : 'Set runpath on installed executables for libigt.so')
+
+option('srcdir',
+       type : 'string',
+       description : 'Override the source code path embedded inside target binaries (optional)')
Signature · 6 lines
2.27.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw
Quoted 9 lines · Petri Latvala
Quoted 6 lines · Richard Purdie

Hardcoding a build source path inside a binary when cross compiling isn't appropriate and breaks build reproducibility. Allow the srcdir to be specified by an optional configuration option to meson which can be used to override with the correct path.

And merged now.

Signature · 1 line
Petri Latvala
Quoted 39 lines
Quoted 39 lines

---
 lib/meson.build   | 6 +++++-
 meson_options.txt | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
lib/meson.build +5 -1
index 114eadde..672b4206 100644
@@ -125,7 +125,11 @@ if chamelium.found()
 	lib_sources += 'igt_chamelium_stream.c'
 endif
 
-srcdir = join_paths(meson.source_root(), 'tests')
+if get_option('srcdir') != ''
+    srcdir = join_paths(get_option('srcdir'), 'tests')
+else
+    srcdir = join_paths(meson.source_root(), 'tests')
+endif
 
 lib_version = vcs_tag(input : 'version.h.in', output : 'version.h',
 		      fallback : 'NO-GIT',
meson_options.txt +4 -0
index ff3abf08..bed63efa 100644
@@ -50,3 +50,7 @@ option('use_rpath',
        type : 'boolean',
        value : false,
        description : 'Set runpath on installed executables for libigt.so')
+
+option('srcdir',
+       type : 'string',
+       description : 'Override the source code path embedded inside target binaries (optional)')
Signature · 1 line
2.27.0
Quoted 8 lines
Quoted 4 lines

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev