henesy / go9p

Automatically exported from code.google.com/p/go9p
Other
1 stars 0 forks source link

go9p does not compile on Plan 9 #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago

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