<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11387</bug_id>
          
          <creation_ts>2017-04-19 20:24:06 +0000</creation_ts>
          <short_desc>devtool edit-recipe fails within crops/extsdk-container</short_desc>
          <delta_ts>2017-08-29 20:56:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>CROPS</product>
          <component>crops-default</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Kurle">brianx.j.kurle</reporter>
          <assigned_to name="brian avery">brian.avery</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>brianx.j.kurle</cc>
    
    <cc>randy.e.witt</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72672</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Kurle">brianx.j.kurle</who>
    <bug_when>2017-04-19 20:24:06 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
 $ docker pull crops/extsdk-container
Using default tag: latest
latest: Pulling from crops/extsdk-container
Digest: sha256:a015a1d601371a9b58b3248c3a288e63116d56387d7003555ad671d1ac9e8056
Status: Image is up to date for crops/extsdk-container:latest

Triggering Action/Cause
-----------------------
devtool edit-recipe &lt;any valid recipe&gt;

Expectation
-----------
vi, (nor any other editor discovered) appears not to be installed within crops/extsdk-container.   Thus, devtool fails when attempting to execute subcommand edit-recipe

Expected vi or some preconfigured editor to be available when executing devtool subcommands that require an editor.

Actual Result
-------------
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
sdkuser@43c20f0c6d57:/workdir$ devtool edit-recipe mbedtls
/bin/sh: 1: vi: not found
Traceback (most recent call last):
  File &quot;/workdir/sysroots/x86_64-pokysdk-linux/usr/bin/devtool&quot;, line 344, in &lt;module&gt;
    ret = main()
  File &quot;/workdir/sysroots/x86_64-pokysdk-linux/usr/bin/devtool&quot;, line 331, in main
    ret = args.func(args, config, basepath, workspace)
  File &quot;/workdir/layers/poky/scripts/lib/devtool/utilcmds.py&quot;, line 52, in edit_recipe
    return scriptutils.run_editor(recipefile)
  File &quot;/workdir/layers/poky/scripts/lib/scriptutils.py&quot;, line 115, in run_editor
    return subprocess.check_call(&apos;%s %s&apos; % (editor, params), shell=True)
  File &quot;/workdir/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.5/subprocess.py&quot;, line 581, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command &apos;vi &quot;/workdir/workspace/recipes/mbedtls/mbedtls_git.bb&quot;&apos; returned non-zero exit status 127

Reproducibility
---------------
100%

Where:
n = total number of attempts
m = number of times the phenomenon is visible</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72691</commentid>
    <comment_count>1</comment_count>
    <who name="Brian Kurle">brianx.j.kurle</who>
    <bug_when>2017-04-20 01:04:23 +0000</bug_when>
    <thetext>In conversation with Randy Witt, it was suggested that this be moved to documentation on the wiki of HOWTO augment the containers with the user preferred editor.  Need to know where to submit documentation (and which wiki)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72727</commentid>
    <comment_count>2</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-04-20 14:59:08 +0000</bug_when>
    <thetext>adding paul.

Question how about changing &quot;devtool edit-recipe&quot; to &quot;devtool find-recipe&quot; then we would just get a path to the recipe so people can do what they want with it.  Admittedly, we would still have the problem with the inside and outside the container path being different, but if you understand the mapping it&apos;s still helpful. maybe add a --rel option so you get a relative path which might make the mapping easier if your host side editor has CWD=workdir...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72740</commentid>
    <comment_count>3</comment_count>
    <who name="Brian Kurle">brianx.j.kurle</who>
    <bug_when>2017-04-20 17:47:39 +0000</bug_when>
    <thetext>I would be all for devtool providing and handling relative pathing as I have been bitten with devtool runqemu as a similar issue.   It appears that the crops/extsdk-container is useful for building, but not for a general developer interactive environment.  

edit-recipe, runqemu, (et al.) fail (more spectacularly so when you try to execute the latter outside the container and the workspace is now hardcoded to /workdir).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72741</commentid>
    <comment_count>4</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-04-20 19:55:40 +0000</bug_when>
    <thetext>some patches that went into 2.3 (this week) for https://bugzilla.yoctoproject.org/show_bug.cgi?id=11375 make the qemu and testimage stuff relative. That should help.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72742</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-04-20 20:31:06 +0000</bug_when>
    <thetext>I&apos;d rather not remove edit-recipe since it&apos;s useful outside of the container, however we can add find-recipe or something similar that just gives you the path. We can also make edit-recipe&apos;s behaviour less ugly when the EDITOR specified doesn&apos;t exist.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72746</commentid>
    <comment_count>6</comment_count>
    <who name="Brian Kurle">brianx.j.kurle</who>
    <bug_when>2017-04-20 23:25:14 +0000</bug_when>
    <thetext>Is the relative patch going to make it to morty?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75454</commentid>
    <comment_count>7</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-07-30 13:30:53 +0000</bug_when>
    <thetext>Moving to M3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76277</commentid>
    <comment_count>8</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-08-29 20:56:24 +0000</bug_when>
    <thetext>The devtool find-recipe patch is in master. It will not be backported, as features generally don&apos;t make it into dot releases. Will add a pointer in the docs to a wiki page where features like this can be better documented.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>