question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

out-of-installation use of west

See original GitHub issue

User feedback noted that it’s not possible by default to use west commands outside of the installation (i.e. not in a subdirectory of the directory containing .west).

Options:

  1. One way to do this is to allow the user to specify the default west installation in a system- or user-level west configuration file. Their locations are described in this comment: https://github.com/zephyrproject-rtos/west/blob/master/src/west/config.py#L27
  2. We may also be able to use the WEST_DIR environment variable to cover this case, so build, flash, etc. work normally even if things like the build directory are outside of the installation.
  3. Another alternative if WEST_DIR is missing and west is invoked from outside an installation is to fall back on searching inside ZEPHYR_BASE, should that be defined.

Some notes for context:

  • you can already build with something like west build -s /tmp/app-source -d /tmp/build and flash with west flash -d /tmp/build even if /tmp/app-source and /tmp/build are outside of the west installation. Just west itself has to be run from inside the installation to find the build and flash commands themselves.
  • the use of a west installation, which is found by looking for a .west directory, is a deliberate design decision which allows users to keep parallel installations, cd around between them, and have them ‘just work’, without requiring environment variables which are cumbersome for some, and error-prone in general (since they can point to the wrong place).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
tejlmandcommented, Feb 7, 2019

CMake is already capable of calling out to west if west is present, examples:

    86  if(WEST)
    87    # Verify that the west version found can be used for flashing, e.g. is not the bootstrapper.
    88    execute_process(COMMAND ${WEST} flash -h
    89                    RESULT_VARIABLE return_code
    90                    OUTPUT_QUIET
    91                    ERROR_QUIET

and in PR/13067

 execute_process(
    COMMAND
    west list --format={abspath}\;
    OUTPUT_VARIABLE
    west_project_list
  )

so if west exposes those settings through a call, eg. west config --get <TOOLCHAIN> then CMake can use that info. Environment varibles and command line arguments can take precedence over west config --get, so it stays consistent with what has been discussed earlier and agreed, see https://github.com/zephyrproject-rtos/west/issues/175#issuecomment-459687134 and https://github.com/zephyrproject-rtos/west/issues/175#issuecomment-460299808

Also environment settings can be used if people don’t want to use west

1reaction
mbolivarcommented, Feb 4, 2019
  • If the option:
    [zephyr]
    zephyr_base = /path/to/zephyr
    
    is set, then use that path

On second thought, I think we need to drop this one. The problem is that the bootstrapper needs to find west, and it doesn’t have access to the config module.

Once we have a unified multi-repo tool in what gets shipped via pypi, rather than just the bootstrapper, we can add that. For now I want to just support ZEPHYR_BASE as a fallback. That should be enough to support backwards compatibility with existing use cases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Strategies to Reduce Jobsite Framing Waste - Weyerhaeuser
Excess or unused wood accounts for up to 40% of jobsite waste, according to estimates from the NAHB. Too many builders, contractors and ......
Read more >
Code of Decatur Township
The enactment and application of this ordinance, coupled with the publication ... RUBBISH — Solid waste not considered to be highly flammable or...
Read more >
Borough Zoning Rules On Cannabis Establishments, 'Granny ...
Borough Zoning Chair Doug Nelson began by saying, “'Cannabis' shall mean marijuana as defined in section 21a-240 of the Connecticut General ...
Read more >
Project Management Consultation - EV Connect
Value-engineered solutions from experts that meet your needs from site assessment to your first EV charging session. We Take the Complexity Out of...
Read more >
Hinckley introduces OutboardCare & Standardizes Hunt ...
... the experience to take the complexity out of installation and the ... The new outboard platforms use digital throttle control and auto ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found