Code Monkey home page Code Monkey logo

Comments (4)

joto avatar joto commented on August 30, 2024

I never really liked the boost way of parsing command line options, so I am willing to consider a switch. I looked at other libraries but never found a great one. From a quick look at cxxopts I am seeing these problems:

  1. There is a reasonably new release 3.0.0 that apparently has some incompatible changes to version 2. Debian stable has still the version 2, Homebrew has version 3. So the code will have to work with version 2 and version 3. Ubuntu only got the library with 22.04, so no support for older Ubuntu versions. That's not good. The only option might be to vendor the lib in which I am not too happy about.
  2. Osmium needs support for subcommands which I think it doesn't have.

In any case: There are a lot of command line options in osmium. Replacing all this code is a major task and there are not nearly enough tests to cover all of them and make sure everything still works. So there will be a lot of checking needed to make sure everything is okay.

from osmium-tool.

nilsnolde avatar nilsnolde commented on August 30, 2024

Some good points, thanks @joto . Subcommands could be doable I think, but it's not really an API, it can be coerced to behave like supporting subcommands. The sheer amount of (sub-)commands and the effort involved in testing is a bit frightening, you're right. My issue was maybe a bit of a fast shot after failing to compile on CentOS 7. Didn't try, maybe boost 1.53 would've worked (!?).

As for vendoring, IMHO it's still much nicer to vendor a header-only lib than requiring a pretty heavy compiled lib (boost). May I ask what you don't like about it in this case? I can see a problem if osmium-tool was used as a lib and cxxopts would be a public dependency, then it'd clash in package managers. But in this case I'm mostly seeing the benefit of controlling a dependency from within the project.

from osmium-tool.

joto avatar joto commented on August 30, 2024

Vendoring is only the last option if there is no other way. Even simple header-only libraries change and need updates and I don't want to maintain that. That's what distributions and package maintainers are for. Debian, btw, doesn't allow vendored in stuff, but will use what's available in the distribution. So vendoring in stuff, while maybe making it simpler for end users compiling the software themselves, makes it harder for package maintainers.

I'd love to get rid of boost as a dependency, but program options are not the only use (also libosmium needs boost for some things), so that's a different issue again.

from osmium-tool.

nilsnolde avatar nilsnolde commented on August 30, 2024

Even simple header-only libraries change and need updates

In fact, I interpret it the other way around 😅 For header-only libraries (esp those only needed at compile time) I much prefer vendoring them, because I don't want to keep up with code changes in the various package manager's releases and control the needed release myself. E.g. Fedora/Arch have quite quick cycles of updating libraries and they're often very close to the latest release. For Valhalla and (compiled) Boost that was such a PITA that I ended up porting all compiled libs to header-only alternatives and vendoring header-only boost (which would be enough for libosmium as well I assume?). But sure, that comes with some overhead, header-only boost is unfortunately only (sorta) reliably available with platform-agnostic (but fail-prone) managers like conan. I tried the header-only boost super-repo, that pulled in > 2 GB of repos haha. That problem might not plague (lib)osmium though, it's just anecdotal. Valhalla is often compiled from source, osmium-tool is targeting package managers more than we are, so I understand that support for that is much more important and if some ancient distro can't have it, it's just part of the OSS "contract".

I never was a package maintainer for any Linux distro and there might be good reasons for it. I can't think of a reason why it shouldn't be "allowed" to vendor compile-time-only libraries which are not publicly exposed to the system.. EDIT: yeah, I guess it's easily a problem for the -dev packages.. I see why it's still a problem.. If Debian doesn't allow that, it would of course be another ax to the idea of cxxopts.

from osmium-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.