Closed sarahmarshy closed 7 years ago
@sarahmarshy When you want to switch a branch, tag or a hash of already deployed repository (with dependencies), please use mbed update [branch|tag|hash]
, e.g. mbed update c027
.
You will get
[mbed] Synchronizing dependency references...
[mbed] Updating reference "easy-connect" -> "https://github.com/ARMmbed/mcr20a-rf-driver/#6fb5842becaefd360f57916a587b5a0ffdc45ff0"
[mbed] Updating program "mbed-os-example-client-1" to branch c027
[mbed] Removing library "easy-connect" (changed URL). Will add from new URL.
[mbed] Adding library "easy-connect" from "https://github.com/sarahmarshy/easy-connect" at rev #87af322ef724
[mbed] Adding library "easy-connect/atmel-rf-driver" from "https://github.com/ARMmbed/atmel-rf-driver" at rev #57f22763f4d3
[mbed] Adding library "easy-connect/C027Interface" from "https://mbed.org/teams/NetworkSocketAPI/code/C027Interface" at rev #69ea34ad7fc6
[mbed] Adding library "easy-connect/C027Interface/C027_Support" from "https://developer.mbed.org/teams/NetworkSocketAPI/code/C027_Support" at rev #38b7588c624d
[mbed] Adding library "easy-connect/esp8266-driver" from "https://github.com/ARMmbed/esp8266-driver" at rev #4ed87bf7fe37
[mbed] Adding library "easy-connect/esp8266-driver/ESP8266/ATParser" from "https://github.com/ARMmbed/ATParser" at rev #269f14532b98
[mbed] Adding library "easy-connect/mcr20a-rf-driver" from "https://github.com/ARMmbed/mcr20a-rf-driver" at rev #d8810e105d7d
[mbed] Adding library "easy-connect/stm-spirit1-rf-driver" from "https://github.com/ARMmbed/stm-spirit1-rf-driver" at rev #bbde15ee85d0
[mbed] Updating library "mbed-client" to rev #52e65b46dff7
[mbed] Updating library "mbed-client/mbed-client-c" to rev #c739b8cbcc57
[mbed] Updating library "mbed-client/mbed-client-classic" to rev #b9a521dcd0fc
[mbed] Updating library "mbed-client/mbed-client-mbed-tls" to rev #7e1b6d815038
[mbed] Updating library "mbed-os" to rev #f4864dc6429e
[mbed] Updating library "pal" to rev #4e46c0ea8706
Notice how mbed CLI removed a repository and replaced it with a different one that you specified.
Also note that mbed deploy
is only used for initial importing. Generally mbed import
and mbed update
is the preferred workflow as mbed CLI knows how to handle changes of repositories (e.g. replace one repository with another but keep the same URL).
Hope this makes sense.
Also see the mbed update
guide at https://github.com/ARMmbed/mbed-cli#updating-to-an-upstream-version
Oh, awesome! Thanks. I'll close this now.
To recreate:
mbed import https://github.com/sarahmarshy/mbed-os-example-client-1
This repo contains a lib file,
easy-connect.lib
that containshttps://github.com/ARMmbed/easy-connect/#6fb5842becaefd360f57916a587b5a0ffdc45ff0
I have a branch called
c027
where I changedeasy-connect.lib
to reference my fork of easy-connecthttps://github.com/sarahmarshy/easy-connect/#87af322ef724cdec08c0f39048020315e7096e67
Now, if I run:
git checkout c027
mbed deploy -vv
I get this error:
Running with
-vv
it looks like mbed-cli uses the remote in master to fetch the commit, I.E https://github.com/ARMMbed/easy-connect and NOT the URL in the lib file.I can work around this by updating the master branch in mbed-os-example-client-1 to reference my personal fork easy-connect, and then I can checkout
c027
branch and deploy without errors.