ARMmbed / mbed-cli

Arm Mbed Command Line Interface
https://os.mbed.com
Apache License 2.0
333 stars 176 forks source link

mbed update does not delete obsolete dependencies. #150

Closed LiyouZhou closed 8 years ago

LiyouZhou commented 8 years ago

The story was:

mbed-os use to contain a .lib file called mbed-client-mbedtls So I have a copy of the library in a folder called mbed-client-mbedtls

Now mbed-os changed the dependency to be called mbed-client-mbed-tls which mbed update helpfully downloaded for me in the folder mbed-client-mbed-tls

Now I have two copy of the same code and compilation expectedly failed.

I run git status but it it says mbed-os repo is clean. Hence it was difficult to realise what was going on.

Ideally we want either:

  1. mbed update to delete the repos that are no longer needed, or
  2. ignore the obsolete libs in compilation
sg- commented 8 years ago

I have the same problem.

mbed.py update --clean
or 
mbed.py update --clean --force

doesnt delete the a directory of source when the .lib file has moved locations in the tree. Had to manually delete.

screamerbg commented 8 years ago

Can you help me reproduce? Need detailed steps what to import and update

@sg- @LiyouZhou

sg- commented 8 years ago

There is an update to mbed-os so here is what i did

git clone https://github.com/ARMmbed/mbed-blinky-morpheus/tree/85f092f3673fd44d53e39ded5eb12919e5bf3618
cd mbed-blinky-morpheus/mbed-os
mbed.py update (didnt remove old folders so try again with --clean)
mbed.py update --clean

Should fail with an error like:

Link: ..
../.build/LPC1768/GCC_ARM/mbed-os/uvisor-mbed-lib/source/unsupported.o: In function `uvisor_init':
/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/uvisor-mbed-lib/source/unsupported.c:27: multiple definition of `uvisor_init'
../.build/LPC1768/GCC_ARM/mbed-os/core/uvisor-mbed-lib/source/unsupported.o:/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/core/uvisor-mbed-lib/source/unsupported.c:27: first defined here
../.build/LPC1768/GCC_ARM/mbed-os/uvisor-mbed-lib/source/disabled.o: In function `uvisor_disabled_get_vector(unsigned long)':
/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/uvisor-mbed-lib/source/disabled.cpp:21: multiple definition of `uvisor_disabled_set_vector(unsigned long, unsigned long)'
../.build/LPC1768/GCC_ARM/mbed-os/core/uvisor-mbed-lib/source/disabled.o:/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/core/uvisor-mbed-lib/source/disabled.cpp:21: first defined here
../.build/LPC1768/GCC_ARM/mbed-os/uvisor-mbed-lib/source/disabled.o: In function `uvisor_disabled_get_vector(unsigned long)':
/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/uvisor-mbed-lib/source/disabled.cpp:26: multiple definition of `uvisor_disabled_get_vector(unsigned long)'
../.build/LPC1768/GCC_ARM/mbed-os/core/uvisor-mbed-lib/source/disabled.o:/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/core/uvisor-mbed-lib/source/disabled.cpp:26: first defined here
collect2: error: ld returned 1 exit status
[ERROR] ../.build/LPC1768/GCC_ARM/mbed-os/uvisor-mbed-lib/source/unsupported.o: In function `uvisor_init':
/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/uvisor-mbed-lib/source/unsupported.c:27: multiple definition of `uvisor_init'
../.build/LPC1768/GCC_ARM/mbed-os/core/uvisor-mbed-lib/source/unsupported.o:/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/core/uvisor-mbed-lib/source/unsupported.c:27: first defined here
../.build/LPC1768/GCC_ARM/mbed-os/uvisor-mbed-lib/source/disabled.o: In function `uvisor_disabled_get_vector(unsigned long)':
/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/uvisor-mbed-lib/source/disabled.cpp:21: multiple definition of `uvisor_disabled_set_vector(unsigned long, unsigned long)'
../.build/LPC1768/GCC_ARM/mbed-os/core/uvisor-mbed-lib/source/disabled.o:/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/core/uvisor-mbed-lib/source/disabled.cpp:21: first defined here
../.build/LPC1768/GCC_ARM/mbed-os/uvisor-mbed-lib/source/disabled.o: In function `uvisor_disabled_get_vector(unsigned long)':
/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/uvisor-mbed-lib/source/disabled.cpp:26: multiple definition of `uvisor_disabled_get_vector(unsigned long)'
../.build/LPC1768/GCC_ARM/mbed-os/core/uvisor-mbed-lib/source/disabled.o:/Users/samgro01/Development/tmp/blinky/mbed-os/../mbed-os/core/uvisor-mbed-lib/source/disabled.cpp:26: first defined here
collect2: error: ld returned 1 exit status
sg- commented 8 years ago

This appears to be a problem due to the repos removed being .hg. I cloned an older version of the mbed-os repo and the used git pull and it updated to the correct reference but also didn't delete my core directory 👎

Not sure if we've done done some magic in the repo or if this is a git thing...

screamerbg commented 8 years ago

Unable to reproduce the issue with the latest mbed CLI from PR #147. Can you please try with it?

First I imported from the URL you provided.

[E108173-MAC:~/Work/temp]$ mbed import https://github.com/ARMmbed/mbed-blinky-morpheus/#85f092f3673fd44d53e39ded5eb12919e5bf3618
[mbed] Importing program "mbed-blinky-morpheus" from "https://github.com/ARMmbed/mbed-blinky-morpheus/" at rev #85f092f3673fd44d53e39ded5eb12919e5bf3618
[mbed] Adding library "mbed-os" from "https://github.com/ARMmbed/mbed-os/" at rev #99098d035a41bac21ceee7ecc2dfe4489db3f50e
[mbed] Adding library "mbed-os/core/configuration-store" from "https://github.com/ARMmbed/configuration-store/" at rev #3e5d635ba44915b45fd575905296e587a5f0d18e
[mbed] Adding library "mbed-os/core/flash-abstraction" from "https://github.com/simonqhughes/flash-abstraction/" at rev #e525215b68f39c0a7016e26364b295880a2595d6
[mbed] Adding library "mbed-os/core/mbedtls" from "https://developer.mbed.org/teams/sandbox/code/mbedtls/" at rev #bef26f687287
[mbed] Adding library "mbed-os/core/uvisor-mbed-lib" from "https://github.com/ARMmbed/uvisor-mbed-lib/" at rev #9b0756ac4889a26b999383ab82691d05d98f9496
[mbed] Adding library "mbed-os/frameworks/greentea-client" from "https://github.com/bridadan/greentea-client/" at rev #398d96e25630
[mbed] Adding library "mbed-os/frameworks/unity" from "https://github.com/ARMmbed/unity/" at rev #7483099b9df15305b09168e95781e1178372f254
[mbed] Adding library "mbed-os/net/atmel-rf-driver" from "https://github.com/ARMmbed/atmel-rf-driver/" at rev #6c13f90859761df04188730aba9a9953b25179a6
[mbed] Adding library "mbed-os/net/coap-service" from "https://github.com/ARMmbed/coap-service/" at rev #eae41d1df943af415af8f8cd61abc7bd915ddc6c
[mbed] Adding library "mbed-os/net/mbed-client-c" from "https://github.com/ARMmbed/mbed-client-c/" at rev #fe178dfdf9d10cd514b2c5f82a6e6eac81ca5261
[mbed] Adding library "mbed-os/net/mbed-client-classic" from "https://github.com/ARMmbed/mbed-client-classic/" at rev #3406e3b31c05ac9e566d69c63ba7343cf6235eed
[mbed] Adding library "mbed-os/net/mbed-client-mbed-tls" from "https://github.com/ARMmbed/mbed-client-mbed-tls/" at rev #8c436e5d110947e18a81be9500de81cf6869b927
[mbed] Adding library "mbed-os/net/mbed-client-randlib" from "https://github.com/ARMmbed/mbed-client-randlib/" at rev #80f5c491dd4d7c8e30b94eb575cdb402e9a17e83
[mbed] Adding library "mbed-os/net/mbed-client" from "https://github.com/ARMmbed/mbed-client/" at rev #ba4f474cdfafae9a87fafab32b2b22b8102e1a5c
[mbed] Adding library "mbed-os/net/mbed-mesh-api" from "https://github.com/ARMmbed/mbed-mesh-api/" at rev #4e23448eb01367ddaac015b2e40a5434ec8884d4
[mbed] Adding library "mbed-os/net/mbed-trace" from "https://github.com/ARMmbed/mbed-trace/" at rev #07ce2714915d5ca7cf07ccd2928d8658d07815b4
[mbed] Adding library "mbed-os/net/nanostack-hal-mbed-cmsis-rtos" from "https://github.com/ARMmbed/nanostack-hal-mbed-cmsis-rtos/" at rev #ec78d46cb31bacae765a478beca8769ada17a01a
[mbed] Adding library "mbed-os/net/nanostack-libservice" from "https://github.com/ARMmbed/nanostack-libservice/" at rev #da6491edff09db8187624468ed03ea72f7107075
[mbed] Adding library "mbed-os/net/sal-stack-nanostack-eventloop" from "https://github.com/ARMmbed/sal-stack-nanostack-eventloop/" at rev #c163be9183b09d7513532c50f2bc9ac52d3e580c
[mbed] Adding library "mbed-os/net/sal-stack-nanostack-private" from "https://github.com/ARMmbed/sal-stack-nanostack-private/" at rev #f8ce589ca32978b54734f54daa781e5637668eb7
[mbed WARNING] The mbed build tools in this program require Python modules that are not installed.
[mbed WARNING] This might prevent you from compiling your code or exporting to IDEs and other toolchains.
[mbed WARNING] The missing Python modules are: pyelftools, pyserial, Jinja2, IntelHex, mbed-ls, project-generator, junit-xml, requests
[mbed WARNING] You can install all missing modules by opening a command prompt in "/Users/mihsto01/Temp/mbed-blinky-morpheus/mbed-os" and running "pip install -r requirements.txt"
---

Then I updated to master (clean)

[E108173-MAC:~/Work/temp/mbed-blinky-morpheus]$ mbed update master --clean
[mbed] Synchronizing dependency references...
\[mbed] Updating program "mbed-blinky-morpheus" to branch master
[mbed] Updating library "mbed-os" to rev #4cf7a3faf5b1321743a647af9a16d89702489188
[mbed] Removing library "mbed-os/core/configuration-store" (obsolete)
[mbed] Removing library "mbed-os/core/flash-abstraction" (obsolete)
[mbed] Removing library "mbed-os/core/mbedtls" (obsolete)
[mbed] Removing library "mbed-os/core/uvisor-mbed-lib" (obsolete)
[mbed] Adding library "mbed-os/mbed" from "https://github.com/mbedmicro/mbed/" at rev #d2fd820e13d9b8321b64f57e0cfd44a3d3edde8f
[mbed] Adding library "mbed-os/mbedtls" from "https://developer.mbed.org/teams/sandbox/code/mbedtls/" at rev #bef26f687287
[mbed] Adding library "mbed-os/uvisor-mbed-lib" from "https://github.com/ARMmbed/uvisor-mbed-lib/" at rev #9b0756ac4889a26b999383ab82691d05d98f9496
[mbed] Updating library "mbed-os/frameworks/greentea-client" to rev #398d96e25630
[mbed] Updating library "mbed-os/frameworks/unity" to rev #7483099b9df15305b09168e95781e1178372f254
[mbed] Updating library "mbed-os/net/atmel-rf-driver" to rev #6c13f90859761df04188730aba9a9953b25179a6
[mbed] Updating library "mbed-os/net/coap-service" to rev #eae41d1df943af415af8f8cd61abc7bd915ddc6c
[mbed] Updating library "mbed-os/net/mbed-client-c" to rev #fe178dfdf9d10cd514b2c5f82a6e6eac81ca5261
[mbed] Updating library "mbed-os/net/mbed-client-classic" to rev #3406e3b31c05ac9e566d69c63ba7343cf6235eed
[mbed] Updating library "mbed-os/net/mbed-client-mbed-tls" to rev #8c436e5d110947e18a81be9500de81cf6869b927
[mbed] Updating library "mbed-os/net/mbed-client-randlib" to rev #80f5c491dd4d7c8e30b94eb575cdb402e9a17e83
[mbed] Updating library "mbed-os/net/mbed-client" to rev #ba4f474cdfafae9a87fafab32b2b22b8102e1a5c
[mbed] Updating library "mbed-os/net/mbed-mesh-api" to rev #4e23448eb01367ddaac015b2e40a5434ec8884d4
[mbed] Updating library "mbed-os/net/mbed-trace" to rev #07ce2714915d5ca7cf07ccd2928d8658d07815b4
[mbed] Updating library "mbed-os/net/nanostack-hal-mbed-cmsis-rtos" to rev #ec78d46cb31bacae765a478beca8769ada17a01a
[mbed] Updating library "mbed-os/net/nanostack-libservice" to rev #da6491edff09db8187624468ed03ea72f7107075
[mbed] Updating library "mbed-os/net/sal-stack-nanostack-eventloop" to rev #c163be9183b09d7513532c50f2bc9ac52d3e580c
[mbed] Updating library "mbed-os/net/sal-stack-nanostack-private" to rev #f8ce589ca32978b54734f54daa781e5637668eb7
[mbed WARNING] The mbed build tools in this program require Python modules that are not installed.
[mbed WARNING] This might prevent you from compiling your code or exporting to IDEs and other toolchains.
[mbed WARNING] The missing Python modules are: pyelftools, pyserial, Jinja2, IntelHex, mbed-ls, project-generator, junit-xml, requests
[mbed WARNING] You can install all missing modules by opening a command prompt in "/Users/mihsto01/Temp/mbed-blinky-morpheus/mbed-os" and running "pip install -r requirements.txt"

Then compiled fine after I had isolated ELFFile which prevented me from compiling (https://github.com/ARMmbed/mbed-os/pull/160).

[E108173-MAC:~/Work/temp/mbed-blinky-morpheus]$ mbed compile -t GCC_ARM -m K64F
Building project mbed-blinky-morpheus (K64F, GCC_ARM)
Compile: test_env.cpp
Compile: mbed-utest-shim.cpp
Compile: default_handlers.cpp
Compile: main.cpp
[SNIP]
Compile: libDHCPv6_server.c
Compile: net_6lowpan_parameter_api.c
Compile: dhcp_service_api.c
Compile: net_ipv6.c
Compile: net_mle.c
Compile: net_short_address_extension.c
Compile: libDHCPv6.c
Compile: net_rpl.c
Compile: protocol_ipv6.c
Compile: unsupported.c
Compile: disabled.cpp
Compile: ipv6_routing_table.c
Compile: net.c
Compile: socket_api.c
Link: mbed-blinky-morpheus
Elf2Bin: mbed-blinky-morpheus
Memory sections sizes:
Image: ./.build/K64F/GCC_ARM/mbed-blinky-morpheus.bin
screamerbg commented 8 years ago

Fixed in the latest PR #174