Bug 13970

Summary: gobject-introspection-native-1.64.1-r0 do_install: Tries to access `~/.cache/g-ir-scanner/.cache-version`
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Paul Menzel <pmenzel+bugzilla.yoctoproject.org>
Component: meta-yoctoAssignee: Jeremy A. Puhlman <jpuhlman>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie
Version: 3.1   
Target Milestone: 3.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Paul Menzel 2020-07-05 02:40:49 UTC
Following *Yocto Project Quick Build* [1], installation of *gobject-introspection-native-1.64.1-r0* fails as it tries to read a file from the home directory of the build user: `~/.cache/g-ir-scanner/.cache-version`. This is not allowed on this host.

```
ERROR: gobject-introspection-native-1.64.1-r0 do_install: Execution of '/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/temp/run.do_install.53999' failed with exit code 1:
[1/5] /dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/recipe-sysroot-native/usr/bin/python3-native/python3 tools/g-ir-scanner --quiet --output=tests/scanner/Headeronly-1.0.gir --no-libtool --warn-all --warn-error --reparse-validate --namespace=Headeronly --nsversion=1.0 --header-only ../gobject-introspection-1.64.1/tests/scanner/headeronly.h
FAILED: tests/scanner/Headeronly-1.0.gir 
/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/recipe-sysroot-native/usr/bin/python3-native/python3 tools/g-ir-scanner --quiet --output=tests/scanner/Headeronly-1.0.gir --no-libtool --warn-all --warn-error --reparse-validate --namespace=Headeronly --nsversion=1.0 --header-only ../gobject-introspection-1.64.1/tests/scanner/headeronly.h
Traceback (most recent call last):
  File "tools/g-ir-scanner", line 104, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/build/giscanner/scannermain.py", line 580, in scanner_main
    transformer = create_transformer(namespace, options)
  File "/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/build/giscanner/scannermain.py", line 387, in create_transfor
mer
    transformer = Transformer(namespace,
  File "/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/build/giscanner/transformer.py", line 49, in __init__
    self._cachestore = CacheStore()
  File "/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/build/giscanner/cachestore.py", line 52, in __init__
    self._check_cache_version()
  File "/dev/shm/poky/build/tmp/work/x86_64-linux/gobject-introspection-native/1.64.1-r0/build/giscanner/cachestore.py", line 68, in _check_cache_vers
ion
    with open(version, 'r') as version_file:
PermissionError: [Errno 13] Permission denied: '/home/pmenzel/.cache/g-ir-scanner/.cache-version'
```

The package should not depend on the build user home directory in any way.

[1]: https://www.yoctoproject.org/docs/3.1.1/brief-yoctoprojectqs/brief-yoctoprojectqs.html
Comment 1 Paul Menzel 2020-07-05 02:42:02 UTC
The tag is 3.1+snapshot-20200705.
Comment 2 Jeremy A. Puhlman 2020-08-13 10:39:14 UTC
Just needs an export like in do_compile to disable the cache generation.

Patch submitted:

https://patchwork.openembedded.org/patch/175313/