Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

This library does actually not support all posix systems (please use x/sys/unix instead of syscall package) #434

Open
Toasterson opened this issue Jul 11, 2022 · 3 comments
Labels

Comments

@Toasterson
Copy link

What operating system and terminal are you using?
illumos and bash

An example that showcases the bug.
Compile github cli or any project using this library on a system not linux

What did you expect to see?
Github cli being able to compile

What did you see instead?

go build -trimpath -ldflags "-X github.com/cli/cli/v2/internal/build.Date=2022-07-11 -X github.com/cli/cli/v2/internal/build.Version=v2.13.0-19-g604adc57 " -o bin/gh ./cmd/gh
# github.com/AlecAivazis/survey/v2/terminal
../go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/terminal/runereader_posix.go:47:43: undefined: syscall.SYS_IOCTL
../go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/terminal/runereader_posix.go:47:81: undefined: ioctlReadTermios
../go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/terminal/runereader_posix.go:59:43: undefined: syscall.SYS_IOCTL
../go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/terminal/runereader_posix.go:59:81: undefined: ioctlWriteTermios
../go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/terminal/runereader_posix.go:67:43: undefined: syscall.SYS_IOCTL
../go/pkg/mod/github.com/!alec!aivazis/survey/v2@v2.3.5/terminal/runereader_posix.go:67:81: undefined: ioctlWriteTermios

Background
the syscall package does not support all posix systems properly as it has been last updated sometime in 2015. Back then only linux was decently well supported for IOCTL's and other calls. Since then all further improvements have gone into x/sys/unix and not into syscall.

@Toasterson Toasterson added the Bug label Jul 11, 2022
@mislav
Copy link
Collaborator

mislav commented Jul 11, 2022

Thank you for reporting! Agreed that this library should avoid dropping down to syscall and instead use more of the standard library to avoid cross-platform limitations. I've tried a migration here but it broke some prompts #377

@Toasterson
Copy link
Author

x/sys/unix is a drop in replacement for syscall infact it's the same package. The problem is not dropping down to the sycall layer, it is using an extremely out of date and limited version of that package.

@Toasterson
Copy link
Author

Also important for #385 #372

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

No branches or pull requests

2 participants