Skip to content

mbed_lib.json conflicts when compiling for a binary application #3209

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

Closed
motgon01 opened this issue Nov 6, 2016 · 6 comments
Closed

mbed_lib.json conflicts when compiling for a binary application #3209

motgon01 opened this issue Nov 6, 2016 · 6 comments

Comments

@motgon01
Copy link

motgon01 commented Nov 6, 2016

Description

  • Type: Bug
  • Priority: Major

mbed CLI tool copies *.json, *.a files and potentially some other stuff that is given in --source <path>


Bug

Target
K64F

Toolchain:
GCC_ARM|ARM

Toolchain version:
4.9.3

mbed-cli version:
0.9.5

meed-os sha:
56f60a0

Steps to reproduce

  1. Compile mbed-os as a static library (using --build libmbed-os)
  2. Compile mbed-client as a static library (using --build libmbed-client)
  3. Compile some foo application that has a single main.cpp (prints hello world or something) and uses --source libmbed-os and --source libmbed-client when compiling, e.g.:

mbed compile -j1 --build .build-foo -t GCC_ARM -m K64F --artifact-name foo -v --source .build-libmbed-os --source .build-libmbed-client -v

Expected behavior
foo application should cleanly compile

Actual behavior
ConfigException: Library name 'mbed-os' is not unique (defined in '.build-libmbed-os/mbed_lib.json' and '.build-libmbed-client/mbed_lib.json')

@jenia81
@screamerbg
@bridadan

@bridadan
Copy link
Contributor

bridadan commented Nov 7, 2016

@mottigondabi So to be clear, this is what your project looks like from a shared parent directory:

/mbed-os            # cloned from https://github.com/ARMmbed/mbed-os
/mbed-client        # cloned from https://github.com/ARMmbed/mbed-client
/foo                # your own project

Then you do the following steps:

  1. cd mbed-os
  2. mbed compile --library --build .libmbed-os ...
  3. cd ../mbed-client
  4. mbed compile --library --build .libmbed-client ...
  5. cd ../foo
  6. mbed compile --source ../mbed-os/.libmbed-os --source ../mbed-client/.libmbed-client --source .

And this gives you the following Exception:
ConfigException: Library name 'mbed-os' is not unique (defined in '.build-libmbed-os/mbed_lib.json' and '.build-libmbed-client/mbed_lib.json')

Is this correct?

@theotherjimmy
Copy link
Contributor

theotherjimmy commented Nov 7, 2016

I take issue with the expected behavior: you are including the mbed and its compiled form twice (as liblmbed-os and as part of limbed-client), so you should get an error like Library name 'mbed-os' is not unique

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 16, 2016

@mottigondabi Is this still an issue?

@bridadan
Copy link
Contributor

@mottigondabi bump #2, any update?

@motgon01
Copy link
Author

No. Issue is closed.

@bqam-ublox
Copy link
Contributor

This is usually due to another folder copied inside mbed os which contains a library with the same name as in mbed os due to which there is a conflict. Delete the already created library and it would build again. Its better to build it outside mbed os to avoid such issues using --build =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants