You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/01/24 23:11:28 UTC

[GitHub] ccollins476ad edited a comment on issue #260: [RFC] `$import` directive

ccollins476ad edited a comment on issue #260: [RFC] `$import` directive
URL: https://github.com/apache/mynewt-newt/pull/260#issuecomment-457392854
 
 
   Thanks @benmccrea, those are good questions.  It turns out my testing of this feature left much to be desired; I discovered a bug while coming up with a response!  I have pushed the fix.
   
   I am using different settings here than the specific ones you asked about (`OS_DEBUG_MODE`->`HAL_FLASH_VERIFY_ERASES`, `OICMGR_TRANS_SECURITY`->`HAL_FLASH_VERIFY_BUF_SZ`).  This allows a more basic target with a simpler syscfg.
   
   ## Setup 1
   
   There are three files:
   
   #### `targets/my_blinky_sim/syscfg.yml`:
   ```
   $import:
       - 'misc/importa.yml'
       - 'misc/importb.yml'
   
   syscfg.vals:
       HAL_FLASH_VERIFY_ERASES: 1
   ```
   
   #### `misc/importa.yml`:
   ```
   syscfg.vals:
       HAL_FLASH_VERIFY_BUF_SZ: 32
   ```
   
   #### `misc/importb.yml`:
   ```
   syscfg.vals:
       HAL_FLASH_VERIFY_BUF_SZ: 16
   ```
   
   Newt generated the following HAL syscfg for this target:
   ```
   [@apache-mynewt-core/hw/hal]
     HAL_FLASH_VERIFY_BUF_SZ: 16 (overridden by targets/my_blinky_sim)
     HAL_FLASH_VERIFY_ERASES: 1 (overridden by targets/my_blinky_sim)
     HAL_FLASH_VERIFY_WRITES: 0
   ```
   
   If we reverse the order of the imports (i.e., `importb` before `importa`), then the syscfg changes:
   ```
   [@apache-mynewt-core/hw/hal]
     HAL_FLASH_VERIFY_BUF_SZ: 32 (overridden by targets/my_blinky_sim)
     HAL_FLASH_VERIFY_ERASES: 1 (overridden by targets/my_blinky_sim)
     HAL_FLASH_VERIFY_WRITES: 0
   ```
   
   So, import order matters, which I think is the correct behavior.  This is something that should be documented.  Imports are processed in the specified order, then the importing file is processed.
   
   ## Setup 2
   
   Two files:
   
   #### `targets/my_blinky_sim/syscfg.yml`:
   ```
   $import:
       - 'misc/importa.yml'
   
   syscfg.vals:
       HAL_FLASH_VERIFY_ERASES: 1
   ```
   
   #### `misc/importa.yml`:
   ```
   syscfg.vals:
       HAL_FLASH_VERIFY_ERASES: 0
   ```
   
   Newt generated the following HAL syscfg for this target:
   ```
   [@apache-mynewt-core/hw/hal]
     HAL_FLASH_VERIFY_BUF_SZ: 16
     HAL_FLASH_VERIFY_ERASES: 1 (overridden by targets/my_blinky_sim)
     HAL_FLASH_VERIFY_WRITES: 0
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services