Skip to content
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

go9p does not compile on Plan 9 #24

Closed
GoogleCodeExporter opened this issue Mar 14, 2015 · 5 comments
Closed

go9p does not compile on Plan 9 #24

GoogleCodeExporter opened this issue Mar 14, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

hello,

go9p is unsupported on Plan 9, as there is no sycall.Errno defined on Plan 9. 
as a short term solution, i changed the definition to a uint, but it makes for 
poor error messages and compatability.

is there any good way to have errors work on plan 9, where errors are strings, 
and unix systems, where errors are generally numbers that are translated to 
strings?

it is used here: https://code.google.com/p/go9p/source/browse/p/p9.go#118

i think it would be very nice if this worked out of the box on plan 9.

i'm using go version devel +d881cb1ffc14 Wed Aug 07 13:36:41 2013 +1000 
plan9/386 on 9front.

Original issue reported on code.google.com by mischief@offblast.org on 22 Aug 2013 at 4:54

@GoogleCodeExporter
Copy link
Author

I don't have Plan9 system running, so I can't make it compile on it. I would 
accept a patch that makes it compile and run. syscall.Errno could probably 
safely be replaced with uint32 in p9.go.

Original comment by lion...@gmail.com on 22 Aug 2013 at 10:24

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

unfortunately syscall.Errno can't be replaced with just a uint32, because the 
error codes defined in p9.go are of type syscall.Errno:

# code.google.com/p/go9p/p
../../../code.google.com/p/go9p/p/p9.go:490: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value
../../../code.google.com/p/go9p/p/p9.go:511: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value
../../../code.google.com/p/go9p/p/unpack.go:18: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value
../../../code.google.com/p/go9p/p/unpack.go:34: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value
../../../code.google.com/p/go9p/p/unpack.go:42: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value
../../../code.google.com/p/go9p/p/unpack.go:59: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value
../../../code.google.com/p/go9p/p/unpack.go:224: cannot use EINVAL (type 
syscall.Errno) as type uint32 in field value

on plan 9, the syscall error type is just 'error'. it might be possible to 
replace Error.Errornum with the 'error' type, since both plan 9 syscall errors 
and unix syscall.Errno satisfies the 'error' interface, but it seems that 
9p2000.u needs numeric codes, and the conversions to uint32 in respond.go 
RespondError reflect that.

i have godoc on plan 9 here for reference. 
http://9.offblast.org:6060/pkg/syscall/#pkg-variables

Original comment by mischief@offblast.org on 22 Aug 2013 at 10:59

@GoogleCodeExporter
Copy link
Author

I just pushed a patch that removes all references to syscall.Errno. Can you 
please check if it solves the Plan9 compilation problem? 

Original comment by lion...@gmail.com on 23 Aug 2013 at 12:10

@GoogleCodeExporter
Copy link
Author

yes, this now compiles on plan 9 and can serve files (at least 9front). i have 
not really tested error code generation, or serving 9p2000.u from plan 9, but i 
will file another ticket if there are additional isues.

thank you for your responsiveness!

Original comment by mischief@offblast.org on 23 Aug 2013 at 8:19

@GoogleCodeExporter
Copy link
Author

Original comment by lion...@gmail.com on 23 Aug 2013 at 12:29

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant