9

There are already some questions about dependency managers here, but it seems to me that they are mostly about build systems, while I am looking for something targeted purely at making dependency tracking and resolution simpler (and I'm not necessarily interested in learning a new build system).

So, typically we have a project and some common code with another project. This common code is organized as a library, so when I want to get the latest code version for a project, I should also go get all the libraries from the source control. To do this, I need a list of dependencies. Then, to build the project I can reuse this list too.

I've looked at Maven and Ivy, but I'm not sure if they would be appropriate for C++, as they look quite heavily java-targeted (even though there might be plugins for C++, I haven't found people recommending them).

I see it as a GUI tool producing some standardized dependency list which can then be parsed by different scripts etc. It would be nice if it could integrate with source control (tag, get a tagged version with dependencies etc), but that's optional.

Would you have any suggestions? Maybe I'm just missing something, and usually it's done some other way with no need for such a tool? Thanks.

8
  • @7vies: I don't know any tool, the company I work for ended up rolling its own system (which now does so much it went far beyond the initial goal), I am really interested in existing free approaches, if only to perhaps glean ideas :) Jan 4, 2011 at 16:27
  • @Matthieu: that's an option, but I would prefer to customize an existing tool for our needs
    – Roman L
    Jan 4, 2011 at 16:30
  • You can use Maven with duns.github.com/maven-nar-plugin (C, C++, .so etc.). Based on that you can create dependency information which give you the list of component/module/lib which a module depends on for the build. If the components have been deployed independently by others you can use an other pluing (maven-versions-plugin mojo.codehaus.org/versions-maven-plugin/examples/…) to see if a newer version of module etc. exists. So you can update your dependencies.
    – khmarbaise
    Jan 4, 2011 at 17:13
  • @khmarbaise: I know about those plugins, but I'd like to have an opinion of someone who really used those things. I also heard bad things about Maven, and there are people stating that it is evil, so I have doubts
    – Roman L
    Jan 4, 2011 at 17:29
  • @7vies: reading on your question I was wondering, do you wish to automatically depend on the newest version or do you want to be able to specify a specific version or a binary-compatibility version ? Jan 4, 2011 at 19:14

2 Answers 2

2
+50

You can use Maven in relationship with C++ in two ways. First you can use it for dependency management of components between each other. Second you can use Maven-nar-plugin for creating shared libraries and unit tests in relationship with boost library (my experience). In the end you can create RPM's (maven-rpm-plugin) out of it to have adequate installation medium. Furthermore i have created the installation for CI environment via Maven (RPM's for Hudson, Nexus installation in RPM's).

3
  • for me it's windows/MSVC, so it's somehow different. I'd like to know how successfully Maven's dependency management worked for you, have you noticed any limitations or felt that you need some other tool?
    – Roman L
    Jan 4, 2011 at 20:04
  • If you only care about Windows, what about using msbuild? I imagine that Visual Studio has some support for such features. PLus if you happen to have the latest Visual Studio 2010, you might find this presentation interesting:blogs.msdn.com/b/vcblog/archive/2011/01/06/… Jan 13, 2011 at 12:35
  • I am interested in managing dependencies of multiple C++ repositories with maven. Where can I find a tutorial ?
    – dilig0
    Sep 18, 2013 at 12:51
1

I'm not sure if you would see an version control system (VCS) as build tool but Mercurial and Git support sub-repositories. In your case a sub-repository would be your dependencies:

Use your VCS to archive the build results -- needed anyway for maintenance -- and refer to the libs and header files in your build environment.

If you are looking for a reference take a look at https://android.googlesource.com/platform/manifest.

4
  • 1
    This is a very simplified model of dependencies, there are always limitations which I'm pretty sure will cause problems as svn:externals do
    – Roman L
    Jan 4, 2011 at 18:16
  • I've experience with Debian's (the well known Linux distribution) and their build environment. It's very Debian and Linux centric and you have to follow lot of rules, e.g. you have to use the package management system including self maintained repositories. If you follow all that you get a great development and deployment environment -- version dependencies,conflicts,replacements,alternatives at development and deployment time. I never saw anything comparable but it's very Debian and Linux specific. You have constrains everywhere. You have to choose something where you can get control over it. Jan 4, 2011 at 18:37
  • in this case the package management system is the dependency manager. And of course it is not based on sub-repositories and not in-built into some VCS...
    – Roman L
    Jan 4, 2011 at 19:02
  • @7vies: Yes, the package management tools do the job. The developers have to use them as part of the production process but on the other hand you get all these neat features -- otherwise you have to implement them yourself. Choose a tool where you feel comfortable to make extensions e.g. by a existing plug-in system. You will find anytime something that need your modifications or extensions. Nothing is perfect because everybody have it's own challenges -- different products, different 3rd party libraries and tools, different development philosophy! Jan 4, 2011 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.