- 
                Notifications
    You must be signed in to change notification settings 
- Fork 993
net: enable native golang linux networking #4498
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
base: dev
Are you sure you want to change the base?
Conversation
bbd514e    to
    fdc75d6      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you test this?
To accept this into TinyGo, I'd like to see at least some tests. For example, you can create a new test like testdata/net.go (and add it to main_test.go for Linux only). It doesn't have to be exhaustive, but for example you can start a socket server (net.Listen) in a goroutine and try to connect to it from the same program.
| @aykevl I will add some basic tests. Since I already did some testing (I hope) it should be fairly easy to integrate this here. | 
4ec411d    to
    e1f18b2      
    Compare
  
    81fd6ff    to
    52be3d8      
    Compare
  
    | //go:linkname poll_runtime_pollServerInit internal/poll.runtime_pollServerInit | ||
| func poll_runtime_pollServerInit() { | ||
| panic("todo: runtime_pollServerInit") | ||
| // fmt.Printf("poll_runtime_pollServerInit not implemented, skipping panic\n") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you put in debugging code, please remove it before sending in a PR. It makes the diff bigger and more work to review.
Generally, take a look at the PR diff and see if there's any part of it that is not necessary and can be removed (such as the changes to .gitmodules and the signal changes that are still part of this PR).
(Also, how do you know that you can just remove this panic?)
72cea16    to
    182dd87      
    Compare
  
    e2e6576    to
    1986937      
    Compare
  
    1986937    to
    5f0f0aa      
    Compare
  
    5f0f0aa    to
    1620b10      
    Compare
  
    Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
if this does not work, do the folliwing steps: 1. remove net submodule 2. remove symlink in local ~/.cache/tinygo/goroot-<hash>/net 3. manual symlink yo local golang /usr/local/bin/src/net Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
1620b10    to
    7529187      
    Compare
  
    Signed-off-by: leongross <[email protected]>
7529187    to
    50b719f      
    Compare
  
    Signed-off-by: leongross <[email protected]>
50b719f    to
    c16ff80      
    Compare
  
    | func semacquire(sema *uint32) { | ||
| panic("todo: semacquire") | ||
| var semaBlock futex.Futex | ||
| semaBlock.Store(*sema) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are working with a copy of the data. This semaphore implementation doesn't actually work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the status of this PR?
This is a rework of the plain linux network POC #4460. This PR adds adaptive switching of network packages depending on the
GOOS.The CI fails due to unadjusted build tags for MacOs and WASm.
Successfully tested on
linux/amd64.