| Summary: | It is not clear how to manually run tasks from the devshell | ||
|---|---|---|---|
| Product: | [Documentation] Development Manual | Reporter: | ulfalizer |
| Component: | development | Assignee: | Scott Rifenbark <srifenbark> |
| Status: | VERIFIED FIXED | QA Contact: | Bogdan Alexandru Voiculescu <bogdanx.a.voiculescu> |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | bogdanx.a.voiculescu, joshuagloe, srifenbark |
| Version: | 2.2 | ||
| Target Milestone: | 2.1 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | 3 March 2016: RESOLVED | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Done (doc changes complete) | |
*** Bug 9128 has been marked as a duplicate of this bug. *** From #9128: "Some developers expect that once in a devshell they can call commands as if in a normal shell, whereas the reality is that the devshell is a mechanism to get into the bitbake task execution environment and commands must be called in the same manner as bitbake calls them i.e. with appropriate options for cross-compilation, etc. We should update the "Using the development shell" section of the developer manual to make this clearer. Furthermore we could point out that a user can use the run.do_* files in temp to a) look at how the tasks are run by bitbake and b) run the commands exactly as bitbake does. i.e. if I'm in a devshell for connman in a build directory where connman has already built I can re-run the compilation steps by calling ../temp/run.do_compile" Hi, Please see http://www.yoctoproject.org/docs/2.1/dev-manual/dev-manual.html#platdev-appdev-devshell and provide feedback on the changes. Thanks, Scott " To manually run a specific task using devshell, run the corresponding run.* script in the ${WORKDIR}/temp (e.g., run.do_configure.pid). If a task's script does not exist, which would be the case if the task was skipped by way of the sstate cache, you can create the task by first running it outside of the devshell:
$ bitbake -c task
"
Two improvements I'd like to see:
1) can we somehow emphasis that the run script is exactly what bitbake runs and therefore executing it re-runs the task exactly as bitbake would do. I couldn't readily form a reedit to include this without changing it into an unwieldy mess of words…
2) it would be worth pointing out (or linking elsewhere that points this out if we have a general section on temp layout, .run & .log files) that the .run file without a pid extension is a symlink to the most recent version of that file.
Joshua, Look that section over again. I added a "Notes" box. Let me know if that works. Scott Here's two more things that might be worth adding/changing:
* "When you invoke devshell, source files are extracted into your working directory and patches are applied" could be put a bit more explicitly as "When you invoke devshell, all tasks up to and including do_patch are run for the specified target".
* "Then, a new terminal is opened and you are placed in the working directory" seems wrong from looking at meta/classes/devshell.bbclass, which has
DEVSHELL_STARTDIR ?= "${S}"
Maybe "then, a new terminal opened and you are placed in ${S}, the source directory".
(Small unrelated note: I just noticed do_devpyshell in devshell.bbclass. That one seems to be undocumented.) (In reply to comment #6) > Here's two more things that might be worth adding/changing: > > * "When you invoke devshell, source files are extracted into your working > directory and patches are applied" could be put a bit more explicitly as > "When you invoke devshell, all tasks up to and including do_patch are run > for the specified target". > > * "Then, a new terminal is opened and you are placed in the working > directory" seems wrong from looking at meta/classes/devshell.bbclass, which > has > > DEVSHELL_STARTDIR ?= "${S}" > > Maybe "then, a new terminal opened and you are placed in ${S}, the source > directory". "a new terminal IS opened" even. One more: "...run the corresponding run.* script in the ${WORKDIR}/temp (e.g., run.do_configure.pid)" is missing "directory" before the opening parenthesis.
Hi, I have addressed all these except for Comment 7. I am going to open a separate bug for documenting that class (see Bug 9166). Please look at http://www.yoctoproject.org/docs/2.1/dev-manual/dev-manual.html#platdev-appdev-devshell for the other changes. Thanks, Scott Looks good. Thanks. Thanks, Setting status to RESOLVED and moving the doc flag to "done." Scott Verified |
Knowing how to do this can be very handy. I'd add something like the following to section 4.5 - Using a Development Shell: Specific tasks can be run manually from the devshell by running the corresponding run.* scripts in ${WORKDIR}/temp - e.g., run.do_configure.<pid>. If the task's script does not exist (e.g., because the task was skipped via the sstate cache), it can be created by first running 'bitbake -c <task>' outside of the devshell.