Bug 9988

Summary: Suggested clarification of the STAGING_DIR_* glossary entries
Product: [Documentation] Reference Reporter: ulfalizer
Component: handbookAssignee: Scott Rifenbark <srifenbark>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, poky.doc.watcher, poky.watcher, ross.burton, sgw, srifenbark
Version: 2.2   
Target Milestone: 2.2 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: 22 Sept 2016: RESOLVED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description ulfalizer 2016-07-20 14:52:50 UTC
Hello,

The first sentence of the STAGING_DIR_HOST entry in the glossary doesn't make any sense to me:

  "Specifies the path to the primary sysroot directory for which the target
  is being built."

I suspect it was meant to say something like this:

  "Specifies the path to the primary sysroot directory for the target for
  which the recipe is being built."


I think replacing the first paragraph of the STAGING_DIR_HOST entry with this would make it even clearer thougb:

  Specifies the path to the sysroot directory for the system the component is
  built to run on (the system that <i>hosts</i> the component). This is the
  sysroot that the recipe's [do_populate_sysroot] task will copy files into.
  Depending on the type of recipe and the build target, STAGING_DIR_HOST can
  have the following values:


The references to to STAGING_DIR, MACHINE, and MULTIMACH_HOST_SYS in the dotted list that follows that paragraph ought to be linkified too.


The entry for STAGING_DIR_NATIVE might be clearer like this:

  Specifies the path to the sysroot directory used when building components
  that run on the build host itself.


The entry for STAGING_DIR_TARGET might be clearer if the first paragraph ("specifies the path ... path is the STAGING_DIR_HOST.") is removed and the ending of the second paragraph replaced with the following:

  ... STAGING_DIR_HOST points to the sysroot used for the "HOST" system, while
  STAGING_DIR_TARGET points to the sysroot used for the "TARGET" system. For
  recipes where STAGING_DIR_TARGET makes no sense, it is set to match
  STAGING_DIR_HOST.
Comment 1 Scott Rifenbark 2016-07-21 19:10:08 UTC
Ulf, 

For STAGING_DIR_HOST see http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-STAGING_DIR_HOST.  BTW, there is no documentation for the the MULTIMACH_HOST_SYS variable so I can't linkify it.  Maybe we need to have that variable added to the glossary?

For STAGING_DIR_NATIVE see http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-STAGING_DIR_NATIVE

For STAGING_DIR_TARGET see http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-STAGING_DIR_TARGET.  I need an opening sentence for consistency that is in the same form as the other variables.  So, I created on based on that stuff you wanted me to use in the end.  If what I put there is not technically accurate, let me know.

Thanks, 
Scott
Comment 2 ulfalizer 2016-07-21 20:10:36 UTC
For STAGING_DIR_TARGET, I think the following opening sentence should work:

  Specifies the path to the sysroot used for the system for which the
  component generates code. For components that do not generate code
  (i.e. the vast majority), STAGING_DIR_TARGET is set to match
  STAGING_DIR_HOST.

Maybe this sentence could be removed as well, since it becomes redundant: "For recipes where STAGING_DIR_TARGET makes no sense, it is set to match STAGING_DIR_HOST."


Looks like only MULTIMACH_TARGET_SYS is defined at the moment, and the definition seems a bit subtle and difficult to understand. Here's my attempt to clarify both MULTIMACH_TARGET_SYS and MULTIMACH_HOST_SYS. Hopefully I've understood them correctly.

  MULTIMACH_TARGET_SYS (rewriting): In situations that involve a "HOST"
  system and a "TARGET" system (see STAGING_DIR_TARGET), this variable
  uniquely identifies the package architecture (PACKAGE_ARCH) together
  with the "TARGET" system. This allows output for different target
  machines to be put into different subdirectories of the same output
  directory.

  The default value of this variable is

    ${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}

  Some classes (e.g. cross-canadian.bbclass) modify this value.

  See the STAMP variable for an example. MULTIMACH_HOST_SYS is the
  corresponding variable for the host system.


  MULTIMACH_HOST_SYS: Serves the same purpose as MULTIMACH_TARGET_SYS,
  but for the "HOST" system.

  The default value of this variable is

    ${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}

Would definitely be nice if someone more knowledgeable could look those
over.
Comment 3 ulfalizer 2016-07-21 20:36:26 UTC
Here's a second version of the MULTIMACH_HOST/TARGET_SYS glossary entries. I think this might be closer to the truth (and a bit shorter too):

  MULTIMACH_TARGET_SYS (rewriting): Uniquely identifies the type of the target
  machine that packages are being built for. This variable allows output for
  different types of target machines to be put into different subdirectories of
  the same output directory.

  The default value of this variable is

    ${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}

  Some classes (e.g. cross-canadian.bbclass) modify this value.

  See the STAMP variable for an example. MULTIMACH_HOST_SYS is the
  corresponding variable for the host machine in situations that involve a
  "HOST" and a "TARGET" system (see STAGING_DIR_TARGET).



  MULTIMACH_HOST_SYS: Serves the same purpose as MULTIMACH_TARGET_SYS, but for
  the "HOST" system, in situations that involve a "HOST" and a "TARGET" system
  (see STAGING_DIR_TARGET).

  The default value of this variable is

    ${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}
Comment 4 ulfalizer 2016-07-21 20:52:36 UTC
One last nit with a few s/machine/system/ for consistency (and because it might be less confusing):

  MULTIMACH_TARGET_SYS (rewriting): Uniquely identifies the type of the target
  system that packages are being built for. This variable allows output for
  different types of target machines to be put into different subdirectories of
  the same output directory.

  The default value of this variable is

    ${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}

  Some classes (e.g. cross-canadian.bbclass) modify this value.

  See the STAMP variable for an example. MULTIMACH_HOST_SYS is the
  corresponding variable for the host system in situations that involve a
  "HOST" and a "TARGET" system (see STAGING_DIR_TARGET).



  MULTIMACH_HOST_SYS: Serves the same purpose as MULTIMACH_TARGET_SYS, but for
  the "HOST" system, in situations that involve a "HOST" and a "TARGET" system
  (see STAGING_DIR_TARGET).

  The default value of this variable is

    ${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}
Comment 5 ulfalizer 2016-07-21 20:54:07 UTC
Bleh... missed one "machine". This really should be the final one. :P

  MULTIMACH_TARGET_SYS (rewriting): Uniquely identifies the type of the target
  system that packages are being built for. This variable allows output for
  different types of target systems to be put into different subdirectories of
  the same output directory.

  The default value of this variable is

    ${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}

  Some classes (e.g. cross-canadian.bbclass) modify this value.

  See the STAMP variable for an example. MULTIMACH_HOST_SYS is the
  corresponding variable for the host system in situations that involve a
  "HOST" and a "TARGET" system (see STAGING_DIR_TARGET).



  MULTIMACH_HOST_SYS: Serves the same purpose as MULTIMACH_TARGET_SYS, but for
  the "HOST" system, in situations that involve a "HOST" and a "TARGET" system
  (see STAGING_DIR_TARGET).

  The default value of this variable is

    ${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}
Comment 6 ulfalizer 2016-07-21 21:19:49 UTC
Paul Eggleton looked over the updated/added glossary entries in #yocto on Freenode and said they looked fine, so probably safe to add.
Comment 8 ulfalizer 2016-07-21 22:18:55 UTC
Few nits:

 - MULTIMACH_HOST_SYS could be linkified in the STAGING_DIR_HOST glossary entry now.

 - "which is the majority)" has a spurious ")".

 - The variables in the default values for MULTIMACH_HOST_SYS and MULTIMACH_TARGET_SYS could be linkified.

Cheers,
Ulf
Comment 9 Scott Rifenbark 2016-07-22 00:36:58 UTC
Ulf, 

I linked the first one mentioned - http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-STAGING_DIR_HOST

Regarding linking variables in the literal examples... I might have done that a bit, but I try to avoid it.  The linking gets overdone.

Thanks, 
Scott
Comment 10 ulfalizer 2016-07-22 09:53:18 UTC
I'm fine with just linking the first one.

Still an extra ')' in the entry for STAGING_DIR_TARGET:

  For components that do not generate code, which is the majority), ...
Comment 11 Scott Rifenbark 2016-07-22 15:06:11 UTC
Oops... blew right by that one.  I have removed it.

Thanks.

http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-STAGING_DIR_TARGET
Comment 12 ulfalizer 2016-07-22 16:12:24 UTC
Looks fine to me now. Thanks!

I also noticed an unrelated thing. There's a repeated 'and' here:

  Thus, the binaries run on the "HOST" system and and generate
  binaries for the "TARGET" system.

Cheers,
Ulf
Comment 13 Scott Rifenbark 2016-07-22 16:59:07 UTC
Sorry ... fixed.  Nice catch.

Scott
Comment 14 Ross Burton 2016-09-19 12:50:46 UTC
Looks like everyone is happy, closing.
Comment 15 Scott Rifenbark 2016-09-22 17:27:31 UTC
Setting the doc flag to "done".

Scott