New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
west update checks out incorrectly #298
Comments
Yeah, this is pretty serious, as it prevents correct behavior for all the nRF compilation libraries, who seem to rely solely on west for installation. |
Fixed in 0.6.2; please use it instead of 0.6.1. Versions 0.6.0 and earlier are not affected. |
I'm in the middle of a large rebase so I can't really
So this bug doesn't affect anyone who only ever goes "forth" on all the master branches and never "back or sideways". Can you confirm? Thanks! |
Yes, that is my expectation. The details on this since I know you will read them at least 😄 are:
All of this can be put together to see that if you only go "forwards" in time in your manifest repository, the
The fix, of course, is to update |
Must it be? Here's what I have right now in my local
If |
I should add that one workaround to avoid this bug on v0.6.1 is to use |
Ah, yes, I think your analysis is right and my "expectation" was wrong. I was making a (faulty) assumption the manifest revision would always be up to date with the remote master branch (or more generally I guess you mean something along the lines of: #. fetch upstream In that case, yes, fetch optimization kicks in, but in 0.6.1 manifest-rev incorrectly stays at d56f2dd3510e, reproducing the bug. Ugh, sorry. As mentioned in my other comment, the easiest way to skip the bug entirely on 0.6.1 is by using I've verified your example works correctly on 0.6.1 with that command. I.e., d572f3df751359126ed324601ebc252402fe3a7e is checked out afterwards if I write that into the project revision in west.yml with manifest-rev pointing d56f2dd3510e, then run I've also verified it's working correctly on 0.6.2 with or without TL;DR: the bug manifests itself in more cases than I originally thought, but the fix as described is good, and you can avoid it entirely on 0.6.1 using |
Just updated, and the response is that the old files need to be overwritten since west is using detached HEAD branch. What is the best solution? C:\NordicS\ncs\nrf>west -V
West version: v0.6.2
C:\NordicS\ncs\nrf>west update
=== updating fw-nrfconnect-zephyr (zephyr):
error: Your local changes to the following files would be overwritten by checkout:
arch/common/gen_isr_tables.py
arch/x86/gen_mmu_x86.py
arch/xtensa/core/xtensa_intgen.py
boards/x86/common/scripts/build_grub.sh
ext/hal/nxp/mcux/scripts/import_mcux_sdk.py
scripts/ci/get_modified_boards.py
scripts/ci/get_modified_tests.py
scripts/ci/run_ci.sh
scripts/coccicheck
scripts/dts/devicetree.py
scripts/dts/extract_dts_includes.py
scripts/dts/gen_defines.py
scripts/dts/testdtlib.py
scripts/dts/testedtlib.py
scripts/filter-known-issues.py
scripts/footprint/size_report
scripts/gen_cfb_font_header.py
scripts/gen_kobject_list.py
scripts/gen_priv_stacks.py
scripts/kconfig/guiconfig.py
scripts/kconfig/kconfig.py
scripts/kconfig/menuconfig.py
scripts/sanitycheck
scripts/zephyr_module.py
Please commit your changes or stash them before you switch branches.
Aborting
=== updating nffs (modules\fs\nffs):
--- nffs: checked out bc62a2fa9d98ddb5d633c932ea199bc68e10f194 as detached HEAD
=== updating segger (modules\debug\segger):
--- segger: checked out 6fcf61606d6012d2c44129edc033f59331e268bc as detached HEAD
=== updating fw-nrfconnect-mcuboot (mcuboot):
error: Your local changes to the following files would be overwritten by checkout:
boot/mynewt/src/main.c
scripts/imgtool/main.py
Please commit your changes or stash them before you switch branches.
Aborting
=== updating fw-nrfconnect-mcumgr (modules\lib\mcumgr):
--- fw-nrfconnect-mcumgr: checked out c8f675a5fa7f62106b9d913844bd5ed6e16ae69e as detached HEAD
=== updating fw-nrfconnect-tinycbor (modules\lib\tinycbor):
--- fw-nrfconnect-tinycbor: checked out 543ecb7c8662580ef803d59ceda7bd3b8a84a11b as detached HEAD
=== updating nrfxlib (nrfxlib):
--- nrfxlib: checked out efcbc258d7c869457e5af59f100fe9a7eeb19b62 as detached HEAD
=== updating cmock (test\cmock):
--- cmock: checked out c243b9a7a7b3c471023193992b46cf1bd1910450 as detached HEAD
=== updating unity (test\cmock\vendor\unity):
--- unity: checked out 031f3bbe45f8adf504ca3d13e6f093869920b091 as detached HEAD
=== updating mbedtls (mbedtls):
error: Your local changes to the following files would be overwritten by checkout:
scripts/abi_check.py
scripts/bump_version.sh
scripts/config.pl
scripts/generate_errors.pl
scripts/generate_query_config.pl
scripts/generate_visualc_files.pl
tests/compat-in-docker.sh
tests/compat.sh
tests/git-scripts/pre-push.sh
tests/make-in-docker.sh
tests/scripts/all-in-docker.sh
tests/scripts/all.sh
tests/scripts/basic-build-test.sh
tests/scripts/basic-in-docker.sh
tests/scripts/check-files.py
tests/scripts/check-generated-files.sh
tests/scripts/check-names.sh
tests/scripts/check-python-files.sh
tests/scripts/curves.pl
tests/scripts/docker_env.sh
tests/scripts/generate_test_code.py
tests/scripts/list-enum-consts.pl
tests/scripts/list-identifiers.sh
tests/scripts/list-macros.sh
tests/scripts/list-symbols.sh
tests/scripts/mbedtls_test.py
tests/scripts/run-test-suites.pl
tests/scripts/test_generate_test_code.py
tests/ssl-opt-in-docker.sh
tests/ssl-opt.sh
Please commit your changes or stash them before you switch branches.
Aborting
ERROR: update failed for projects: fw-nrfconnect-zephyr, fw-nrfconnect-mcuboot, mbedtls
C:\NordicS\ncs\nrf>git branch
* (HEAD detached at v1.0.0)
master
I also tried with |
This is just a generic git error you get when trying to run git checkout with a dirty working tree; nothing west specific to see here as far as I can tell.
See the command output lower down:
|
Since there is nothing of interest to stash, the best solution is to overwrite. Just do: cd /pathto/ncs/nrf
git checkout -f master
git pull
west update |
OS: Windows
Version: 0.6.1
If you go back-and-forth between two tags (lets say "v1.0.0" and "master"), "west update" seems to cache the former west.yaml files, so that you get a mismatch between the nrf repo, and the surrounding git repo deps.
Here's an example:
haal@haal MINGW64 /c/SDK/ncs/nrf (master)
$ west update
=== updating zephyr (zephyr):
--- zephyr: checked out 7e64ac737daead12d2dbdda5daec04188243a81c as detached HEAD
that commit is the "v1.14.99-ncs2-branch", corresponding to nrf tag "v1.0.0".
However; west.yaml shows this revision for fw-nrfconnect-zephyr:
bd8fd7f8982a2a2b03d65e415b8de17b94fa5a9a
The text was updated successfully, but these errors were encountered: