-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dependency on golang.org/x/sys
#270
Comments
The example still has the dependency on golang.org/x/sys. Updates #270
The example still has the dependency on golang.org/x/sys. Updates #270
@david50407 Please try |
My partner (@platypusguy) and I are working on a large and complex Go project that is being amended to access JVM library functions. It runs on Linux, Unix, MacOS, and Windows. It would be very helpful if we only had to deal with a single generic purego API set (Dlopen, Dlclose, etc.). Is a single purego API set one of the goals of this issue? |
This is a different topic from this issue. The answer is we don't plan to do that, since Windows doesn't have dl* functions. |
For the explanation why see #107 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@david50407 ping |
Sorry for the late. I've tried the version you metioned. Once I add purego as dependency of golang toolchain 1.22.5 and build the toolchain. So I think if we want to embed purego into the toolchain, we have to remove the dependency in go.mod directly. edit: I think that's why MS load libraries by calling |
What kind of commands did you execute? I'd like to know the details.
|
Here's the steps I took:
For the |
Hmm, I understood that you have modified the Go toolchain by yourself and the toolchain has some tricky things to resolve dependencies. Thank you for elaborating! I'll modify the example not to use golang.org/x/sys tonight, preserving the current behavior or adding comments to explain that usually NewLazySystemDLL is preferrable. |
@hajimehoshi thank you so much! |
I'm confused. It looks like the error you are getting isn't related to not being able to import the sys package but that you have differing versions. I'd like to know why std/crypto imports an outdated version of golang.org/x/sys and why you can't just update its version to match purego's? |
@TotallyGamerJet the version of https://github.com/golang/go/blob/release-branch.go1.22/src/go.mod#L11 |
You're already using your own forked version of Go seems like things could easily break for other reasons. Update and run the test suite. I'm sure it would find most issues if there was one |
@TotallyGamerJet upgrading x/sys may cause issues. Althought I can run the test suite to find out the issues and fix them, but it is not a reasonable work while purego is not using Updating just for the sake of updating doesn't make sense, right? |
Even though this is not an ideal solution, I'm fine to remove the dependency on golang.org/x/sys from this repository including the example. @TotallyGamerJet what do you think? |
I don't like removing it from the examples but I goes it's fine |
I don't prefer this solution either. However, I understand that, in very special cases like modifying the Go toolchain with Pure Go, an extra dependency in go.mod could be a problem. As a bonus, removing all the dependencies from go.mod might be good for marketing. We can assert that Pure Go is zero-dependency. For example, Wazero says so. Technically it is possible to say the core part is zero-dependency even with some dependencies in go.mod, and actually the current Pure Go is. So, this is just a 'marketing' thing. |
The example still has the dependency on golang.org/x/sys. Updates ebitengine#270
Operating System
What feature would you like to be added?
Remove dependency on
golang.org/x/sys
. Aim to be zero dependencies.Why is this needed?
For now, the only dependency is
golang.org/x/sys
.If we can remove the dependency, we can embed purego into more situation like Golang toolchain.
Currently I'm working on a go fork and try to introduce our own C lib into Go toolchain, if purego can have zero dependencies, we can import the C lib without CGO (instead, use purego for sure). But in the toolchain, dependency chain has limitation that
golang.org/x/sys
is not allowed to be here. :(The text was updated successfully, but these errors were encountered: