I’m using a library that makes frequent use of patching (replacing text in source code) for dependencies. I feel this is bad form, because, for example, that dependency may now conflict irreconcilably with another dependency of mine.

Am I right in thinking patching code is bad form?

  • BB_C@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    2 hours ago

    This would depend on the language/ecosystem. It’s worse for C and C++ than for example Rust because of packaging policies and ease of distributability.

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 hours ago

    If your patching an external library, please try to do what you can in the moment to formulate the patch in such a way that the upstream can accept it.

  • CombatWombat@feddit.online
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 hours ago

    Patching is a reasonable temporary solution while you are actively working to get the patch merged upstream. If you’re not doing that, a better solution is to fork. If you’re not doing that either, then you should be updating your resume.

  • ryokimball@infosec.pub
    link
    fedilink
    arrow-up
    0
    ·
    4 hours ago

    Is this for a personal project or something to be distributed?

    If this is a distributed project where reproducibility is important, modifying external dependencies will quickly and greatly complicate things. I think a preferred method would be forking if not doing a pull request, assuming those dependencies are open source. This way you can independently develop on the dependency and source it separately instead of relying on patches