-
Notifications
You must be signed in to change notification settings - Fork 178
mbed-cli can clone mbed-os.lib more than once #472
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
Comments
BTW - the workaround is to not put an mbed-os.lib in my library's repo. Instead, I do a git clone of the repo and then do an "mbed add mbed-os" inside it whenever I want to work on it. Or, I do an mbed import of an app that uses my library and then cd into the clone mbed-cli made of library and do a "git checkout develop" and work on the directory from there. Both are kind of clunky solutions. |
This is pretty much what we do (usually the latter) and it seems to generally work, if being a bit clunky. If you have thoughts on alternative ways of doing this, I think we'd definitely be interested in hearing them! |
@bridadan - I have an approach in the pull request associated with this issue, and I also suggest a more generic approach that may be possible. Please let me know what you think. |
Apart |
IMO, that's a very good question and is something I allude to in #474 (comment). This is a problem that will surface in time, and is common across many platforms (golang's 'vendoring' quagmire, autotools, etc.). |
I'm still struggling with this. The problem I face is that the current implementation seems to make it very cumbersome to develop and test a library. My directory structure is similar to this:
What I want to do is be able to simultaneously develop So, what I do now is very very cumbersome. I check out my-library in two different directories: one under example_program and one in its own directory. I do all my-library development in the directory under example_program. Once I'm satisfied, I then create a patch and apply it to the my-library that is in its own directory so I can run Perhaps I'm missing some easier way to run the TESTS of my-library when my-library is checked out under example_program. If you know the magic incantations to do that, you'd solve the core problem that caused me to file this issue. Any thoughts? |
we are actually facing this issue with a library (lets call it Note: we cannot remove the dependencies in [Mirrored to Jira] |
@betzw - I proposed a possible approach in my comment at #474 (comment). The problem here is very similar to the 'vendoring' problem the golang folks have yet to solve gracefully: you're going to run into this problem in any system that automatically fetches dependencies, especially when it fetches them recursively. |
I'm facing a similar issue. My approach is to add an Inside of the However, when using |
How about you make a "canonical" test app (as a peer repo to your lib), which includes both your lib and mbed-os as libraries? |
It doesn't look like there's a good solution to this yet? I have been doing the workaround where I have a different repository for testing the library I am working on but it would be much better if I have had the same odd behavior where it puts a copy of mbed-os inside the library directory when added. I also have the odd behavior if bot library has dependencies spektrum and nmea, and if they are used elsewhere it is not smart enough to realize that and clones it again. |
Thank you for raising this issue. Please note we have updated our policies and |
As a creator of an mbed library that people can add to their projects, I want to be able to build and test my library against mbed-os. To do so, I put an mbed-os.lib file in my top level directory so that mbed-cli will clone mbed-os when I do an "mbed import" of my library.
However, the presence of the mbed-os.lib file in my library wreaks havoc on projects that import my library. The reason is that mbed-cli seems to recurse through directories looking for *.lib files. So, the presence of mbed-os.lib in my library will end up with mbed-os being cloned twice by an app that uses my library: once for the app's own mbed-os.lib and again for my libraries mbed-os.lib.
I'm not sure how to fix this. I'm looking at using the solution outlined in http://stackoverflow.com/questions/229186/os-walk-without-digging-into-directories-below. I've coded this up but haven't tested it yet. If I can get this to work, and the mbed-cli maintainers agree this is a valid request, I will do a pull request.
The text was updated successfully, but these errors were encountered: