<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/devshell.bbclass, branch yocto-3.1.23</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-3.1.23</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-3.1.23'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2022-05-09T10:51:59+00:00</updated>
<entry>
<title>install/devshell: Introduce git intercept script due to fakeroot issues</title>
<updated>2022-05-09T10:51:59+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2022-04-20T15:11:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=90cf135b046e4195512daeb8e8f516603d0f5d6c'/>
<id>urn:sha1:90cf135b046e4195512daeb8e8f516603d0f5d6c</id>
<content type='text'>
In a devshell, recent versions of git will complain if the repo is owned
by someone other than the current UID - consider this example:

 ------
  bitbake -c devshell linux-yocto

  [...]

  kernel-source#git branch
  fatal: unsafe repository ('/home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source' is owned by someone else)
  To add an exception for this directory, call:

        git config --global --add safe.directory /home/paul/poky/build-qemuarm64/tmp/work-shared/qemuarm64/kernel-source
  kernel-source#
 ------

Of course the devshell has UID zero and the "real" UID is for "paul" in
this case.  And so recent git versions complain.

As the whole purpose of the devshell is to invoke a shell where development
can take place, having a non-functional git is clearly unacceptable.

Richard suggested we could use PSEUDO_UNLOAD=1 to evade this issue, and I
suggested we probably will see other similar instances like this and should
make use of PATH to intercept via devshell wrappers - conveniently we already
have examples of this.

Here, we copy the existing "ar" example and tune it to the needs of git to
combine Richard's suggestion and mine.

As such we now also can store commit logs and use send-email with our user
specific settings, instead of "root", so in additon to fixing basic
commands like "git branch" it should also increase general usefulness.

RP: Tweaked the patch so the PATH change only applies to the devshell task
and is a generic git intercept rather than devshell specific.

RP: Also apply the PATH change to do_install tasks since that also runs under
fakeroot and several software projects inject "git describe" output into
their binaries (systemd, iputils, llvm, ipt-gpu-tools at least) causing
reproducibility issues from systems with different git versions.

(From OE-Core rev: 0ff2cff2c1eac3fe6304644db0fc27ba3130c237)

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 3266c327dfa186791e0f1e2ad63c6f5d39714814)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devshell.bbclass: Exceptions displayed within devpyshell</title>
<updated>2021-03-28T21:31:47+00:00</updated>
<author>
<name>Dorinda Bassey</name>
<email>dorindabassey@gmail.com</email>
</author>
<published>2021-03-18T15:49:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=d1ca70156603d502c21217373544d5aee173903f'/>
<id>urn:sha1:d1ca70156603d502c21217373544d5aee173903f</id>
<content type='text'>
If you type something into devpyshell, an exception should be triggered,
but that exception isn't printed out because it is not being flushed out
of the buffer. This patch fixes that issue.

[YOCTO #12156]

(From OE-Core rev: 92b2da5824c11063d0bb8e39bc221530137e29b4)

Signed-off-by: Dorinda Bassey &lt;dorindabassey@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
(cherry picked from commit 9f95e82a3b27bfd5177a855326dcad8a5bdf5b2d)
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devshell.bbclass: clean up trailing whitespaces</title>
<updated>2017-06-06T18:02:43+00:00</updated>
<author>
<name>Chang Rebecca Swee Fun</name>
<email>rebecca.swee.fun.chang@intel.com</email>
</author>
<published>2017-05-29T04:42:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8b66ad49a00c7bfabb0db824f727d741833f97ec'/>
<id>urn:sha1:8b66ad49a00c7bfabb0db824f727d741833f97ec</id>
<content type='text'>
(From OE-Core rev: fac6c0fcb30d7cb49036cb32247569d65d1c5e7f)

Signed-off-by: Chang Rebecca Swee Fun &lt;rebecca.swee.fun.chang@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devshell.bbclass: ensure toolchains available for do_devshell</title>
<updated>2017-06-06T18:02:43+00:00</updated>
<author>
<name>Chang Rebecca Swee Fun</name>
<email>rebecca.swee.fun.chang@intel.com</email>
</author>
<published>2017-05-30T00:58:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2e388503fe0efcac1130a9d542f759eca8efa311'/>
<id>urn:sha1:2e388503fe0efcac1130a9d542f759eca8efa311</id>
<content type='text'>
Toolchains are required to be prepopulated in sysroot before
entering devshell.

[YOCTO #11464]

(From OE-Core rev: eb8a1cdf5106d119f77db76f9a690826af9fcda3)

Signed-off-by: Chang Rebecca Swee Fun &lt;rebecca.swee.fun.chang@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>meta: remove True option to getVarFlag calls</title>
<updated>2016-12-16T10:23:23+00:00</updated>
<author>
<name>Joshua Lock</name>
<email>joshua.g.lock@intel.com</email>
</author>
<published>2016-12-14T21:13:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=3c59b1bf93adb0b9f723bda1d8702c8720733677'/>
<id>urn:sha1:3c59b1bf93adb0b9f723bda1d8702c8720733677</id>
<content type='text'>
getVarFlag() now defaults to expanding by default, thus remove the
True option from getVarFlag() calls with a regex search and
replace.

Search made with the following regex:
getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\)

(From OE-Core rev: 2dea9e490a98377010b3d4118d054814c317a735)

Signed-off-by: Joshua Lock &lt;joshua.g.lock@intel.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>meta: remove True option to getVar calls</title>
<updated>2016-12-16T10:23:23+00:00</updated>
<author>
<name>Joshua Lock</name>
<email>joshua.g.lock@intel.com</email>
</author>
<published>2016-12-14T21:13:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=c4e2c59088765d1f1de7ec57cde91980f887c2ff'/>
<id>urn:sha1:c4e2c59088765d1f1de7ec57cde91980f887c2ff</id>
<content type='text'>
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock &lt;joshua.g.lock@intel.com&gt;
Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devpyshell: python3: flush stdout explicitly</title>
<updated>2016-07-08T08:57:23+00:00</updated>
<author>
<name>Ed Bartosh</name>
<email>ed.bartosh@linux.intel.com</email>
</author>
<published>2016-07-04T22:08:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e8feb1976a04d0a0850fc316cfff390d0569ec4a'/>
<id>urn:sha1:e8feb1976a04d0a0850fc316cfff390d0569ec4a</id>
<content type='text'>
Opening text stream in unbuffered mode raises the following
exception In Python 3:
    ValueError: can't have unbuffered text I/O

Fixed by leaving std* streams in text mode and flushing
stdout explicitly.

(From OE-Core rev: 732001cb268683f5b56e251e2964ec5b694a2147)

Signed-off-by: Ed Bartosh &lt;ed.bartosh@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devshell.bbclass: fix double unbuffering</title>
<updated>2016-07-08T08:57:23+00:00</updated>
<author>
<name>Ed Bartosh</name>
<email>ed.bartosh@linux.intel.com</email>
</author>
<published>2016-07-04T22:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=250955ab8c9b67a43e9cb6dc1f837bbca5141705'/>
<id>urn:sha1:250955ab8c9b67a43e9cb6dc1f837bbca5141705</id>
<content type='text'>
stdout is already unbuffered in bitbake code. Attempt to
do it again in devshell.bbclass causes this crash when
running devpyshell:
  File "scripts/oepydevshell-internal.py", line 29, in &lt;module&gt;
      pty = open(sys.argv[1], "w+b", 0)
  IOError: [Errno 13] Permission denied: '/dev/pts/6'

(From OE-Core rev: 875910451e1ce97d0c42b41b1140c8160ed1f40a)

Signed-off-by: Ed Bartosh &lt;ed.bartosh@linux.intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>classes/lib: Add expand parameter to getVarFlag</title>
<updated>2016-02-04T23:39:00+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2016-02-02T23:45:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=7fa6eeba1c1e4667820c8543343083fad75cabee'/>
<id>urn:sha1:7fa6eeba1c1e4667820c8543343083fad75cabee</id>
<content type='text'>
This sets the scene for removing the default False for expansion
from getVarFlag. This would later allow True to become the default.

On the most part this is an automatic translation with:

sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, True):g'  -i `grep -ril getVar *`

In this case, the default was False, but True was used since in most
cases here expansion would be expected.

(From OE-Core rev: 42a10788e89b07b14a150ced07113566cf99fcdd)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devshell: allow the starting directory to be overridden</title>
<updated>2015-03-16T17:41:55+00:00</updated>
<author>
<name>Ross Burton</name>
<email>ross.burton@intel.com</email>
</author>
<published>2015-03-11T10:00:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8a9ac1de34e6c23dc04fb1464ad2285d43ad3584'/>
<id>urn:sha1:8a9ac1de34e6c23dc04fb1464ad2285d43ad3584</id>
<content type='text'>
Some people like to have the devshell start in ${B} instead of ${S}, so allow
this to be overridden.

(From OE-Core rev: 217af639d13258429949b14c67110650288cba7a)

Signed-off-by: Ross Burton &lt;ross.burton@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
