ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.22k stars 935 forks source link

Fix some bugs on Windows #1089

Closed Legend-Master closed 1 year ago

Legend-Master commented 1 year ago
Legend-Master commented 1 year ago

By the way, I'm confused about why python files don't have .py extension, and containing - in the name (can't use import)

hamishcoleman commented 1 year ago

The python files are intended to be commandline tools, which on everything other than Windows means that they dont have an extension.

The dash in their name is something that probably should change - as you say it makes things hard for python - but was done at the request of one of the other maintainers, so we should talk to them about it.

Legend-Master commented 1 year ago

The python files are intended to be commandline tools, which on everything other than Windows means that they dont have an extension.

I would argue that It's pretty common for commandline tools to have an extension (like other .sh files), it's just easier to understand what format the file is

codecov-commenter commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (39b9c6b) 19.92% compared to head (11d0c4a) 19.92%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #1089 +/- ## ======================================= Coverage 19.92% 19.92% ======================================= Files 47 47 Lines 8786 8786 ======================================= Hits 1751 1751 Misses 7035 7035 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Legend-Master commented 1 year ago

Have to say I hate the current work flow on Windows, the cmake version is much easier to work with

hamishcoleman commented 1 year ago

Can you expand on what your workflow is?

(Remember that most of the people developing this software are not using visual studio)

Legend-Master commented 1 year ago

I use vscode most of the time, but visual studio simplified a lot of the compiling and debugging configurations

I can just run debug without any configuration in visual studio before with cmake, and changing between debug and release version is just a click of button (and they're organized in their own folder)

Now I'll need to first run hack_fakeautoconf.sh (and the version became FIXME), and then configure vscode task and launch (and I need to define debug and optimization flags myself)

And it won't compile because of checking git tag for version if I don't use git (like directly download zip from github)

Release build from gcc is much bigger than msvc (edge.exe 338KB vs 203KB)

Legend-Master commented 1 year ago

To be honest, it's not a big problem, but for someone who's new to the project, it's gonna make things much harder especially if they don't have much experience on GNU ecosystem like myself

hamishcoleman commented 1 year ago

It is still good to know how others are using things. While there is only a limited amount of resources - so we cant make everything simple - if we know the pain points, some of them might come up in passing.

Thanks for your explanation.

On 21 April 2023 1:25:39 pm GMT+01:00, Tony @.***> wrote:

To be honest, it's not a big problem, but for someone who's new to the project, it's gonna make things much harder especially if they don't have much experience on GNU ecosystem like myself

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

Legend-Master commented 1 year ago

I'm not sure if it's a good idea, but I think if we can have some instructions or IDE configurations to start with, it's going to make it easier to get started

Just being curious, how you guys write/build/debug it?

My vscode config, I just change the code, and press f5 to build and debug (having some problems though, vscode gdb doesn't work with ctrl-c and printing strings are messed up (none of them happens using the cmake version)):

task.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Debug build all",
            "type": "shell",
            "command": "make",
            "args": [
                "DEBUG=-g3",
            ],
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
        },
    ],
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch edge",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/src/edge",
            "MIMode": "gdb",
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "Debug build all"
        },
    ]
}
Legend-Master commented 1 year ago

By the way, making debug build and release build in the same folder makes caching pretty messy and hard to organize, but that's something I guess can be improved in the Makefile system

hamishcoleman commented 1 year ago

I've made some updates, you should confirm that everything still does what you expect.

hamishcoleman commented 1 year ago

Hrm, github appears to have closed this for some reason - that was not my intent

Legend-Master commented 1 year ago

I'm not sure what should I expect, but all my changes are gone (and the version is still FIXME)

hamishcoleman commented 1 year ago

I figured out what I did - I pushed the wrong branch, sorry - have a look at #1103

Legend-Master commented 1 year ago

I should have named my branch something else to be honest, was not thinking about much when I did the pull request

Just recovered from the local git repo, pushed a new branch to https://github.com/Legend-Master/n2n/tree/windows-fixes