Code Monkey home page Code Monkey logo

Comments (9)

seladb avatar seladb commented on June 10, 2024 1

PcapPlusPlus is often used by inexperienced developers and one of the things I always cared about is making it as easy to use as possible. I'm a strong believer in ease of use because that's what I expect when getting into a new library or project.

So even if it makes our lives (maintainers) a bit harder, it's worth the ease of use for the library's users.

If I didn't care about that I'd make it a submodule in the first place, that's the option that makes the most sense from a library maintainer point-of-view.

from pcapplusplus.

tigercosmos avatar tigercosmos commented on June 10, 2024 1

@seladb sure, revised the issue content.

from pcapplusplus.

seladb avatar seladb commented on June 10, 2024

@tigercosmos I don't think we should use git submodule. Unfortunately submodules are not very convenient because the user needs to remember to fetch them (a simple git clone won't fetch them by default).
I think we can keep what we do now, just sync the git commit against our fork instead of the upstream repo

from pcapplusplus.

tigercosmos avatar tigercosmos commented on June 10, 2024

@seladb I think we can just write in the document to use git clone --recurse-submodules?

I think we can keep what we do now, just sync the git commit against our fork instead of the upstream repo

Do you mean to copy the code from the forked repo? I think it doesn't make the maintaining sync issue easier.

from pcapplusplus.

seladb avatar seladb commented on June 10, 2024

@seladb I think we can just write in the document to use git clone --recurse-submodules?

I think we can keep what we do now, just sync the git commit against our fork instead of the upstream repo

Do you mean to copy the code from the forked repo? I think it doesn't make the maintaining sync issue easier.

yes... that's the reason I copied the code in the first place. Enforcing doing git clone --recurse-submodules is pretty annoying. Please notice we do that for all 3rd party libs. Since it's a forked repo that we don't change a lot, it shouldn't be very hard to maintain our copied code the same as the fork...

from pcapplusplus.

tigercosmos avatar tigercosmos commented on June 10, 2024

I disagree with duplicating the code. If we opt to increment the version in the forked repository, it would result in copying all the code into PCPP. This approach seems inefficient. Instead, why not simply increment the commit in the git submodule?

Kindly permit me to invite @clementperon and @egecetin to share their opinions on this matter as well.

from pcapplusplus.

egecetin avatar egecetin commented on June 10, 2024

To be honest submodule is not a problem for experienced developers they can easily figure out when they even configuring project with CMake and get path does not exist or similar error. But for most inexperienced people it is quite hard to figure out they missed the submodule init (Why does the git clone default do not fetch submodules, they are part of code, so I think also which is a bit annoying). If the concern is only troubles caused by missing the submodule initialization maybe we can add a warning line to CMake to remind people to call git submodule update --init --recursive (since they already cloned this command is better) if the path/file does not exist?

And a side note, source code zip downloads from GitHub also do not contain submodules

from pcapplusplus.

tigercosmos avatar tigercosmos commented on June 10, 2024

@seladb how about this way, we don't copy the forked code into PCPP nor use the git submodule.

When the user runs cmake for the first time in PCPP, cmake will fetch and get the code of LightPcapNg from the forked repo.

For example:

include(ExternalProject)

# Define the external project
ExternalProject_Add(
    MyProjectExternal    # Arbitrary name for the project
    PREFIX ${CMAKE_BINARY_DIR}/MyProject    # Directory where the project will be downloaded and built
    GIT_REPOSITORY https://github.com/username/repo.git    # URL of the Git repository
    GIT_TAG master    # Branch, tag, or commit hash to checkout
    UPDATE_DISCONNECTED 1    # Don't update the project during the build
    # You can also specify other options such as CONFIGURE_COMMAND, BUILD_COMMAND, INSTALL_COMMAND, etc.
)

# Add dependencies of your main project to the external project
add_dependencies(MyMainProject MyProjectExternal)

from pcapplusplus.

seladb avatar seladb commented on June 10, 2024

ExternalProject_Add

Hmm I'm open to this idea! Can you please create a POC of this to see how it works?

from pcapplusplus.

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.