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

x/exp/mmap: missing windows/arm64 support #49106

Closed
yselkowitz opened this issue Oct 22, 2021 · 2 comments
Closed

x/exp/mmap: missing windows/arm64 support #49106

yselkowitz opened this issue Oct 22, 2021 · 2 comments
Labels
arch-arm64 FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@yselkowitz
Copy link

yselkowitz commented Oct 22, 2021

What version of Go are you using (go version)?

$ go1.17.2 version
go version go1.17.2 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go1.17.2 env
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"

What did you do?

I was trying to port https://github.com/openshift/oc to windows/arm64, and this came up as a missing indirect dependency. But as a simple test case to illustrate the issue:

$ echo abcdefg > tmp.txt
$ cat main.go 
// https://github.com/handongyexingren/learnGo/tree/main/geektutu/mmap
package main

import (
	"fmt"
	"golang.org/x/exp/mmap"
)

func main() {
	at, _ := mmap.Open("./tmp.txt")
	buff := make([]byte, 2)
	_, _ = at.ReadAt(buff, 4)
	_ = at.Close()
	fmt.Println(string(buff))
}

$ go1.17.2 mod init
go: creating new go.mod: module $PWD/test
go: to add module requirements and sums:
	go mod tidy
$ go1.17.2 mod tidy
go: finding module for package golang.org/x/exp/mmap
go: found golang.org/x/exp/mmap in golang.org/x/exp v0.0.0-20211012155715-ffe10e552389
$ go1.17.2 build .
$ GOOS=windows GOARCH=amd64 go1.17.2 build .
$ GOOS=windows GOARCH=arm64 go1.17.2 build .

What did you expect to see?

Code compiles, creating an ARM64 test.exe

What did you see instead?

# golang.org/x/exp/mmap
$HOME/go/pkg/mod/golang.org/x/exp@v0.0.0-20211012155715-ffe10e552389/mmap/mmap_windows.go:111:12: [maxBytes]byte used as value
$HOME/go/pkg/mod/golang.org/x/exp@v0.0.0-20211012155715-ffe10e552389/mmap/mmap_windows.go:111:13: undefined: maxBytes

Notes

AFAICS the fix would be to add a mmap_windows_arm64.go file matching the contents of mmap_windows_amd64.go in golang.org/x/exp/mmap.

@gopherbot gopherbot added this to the Unreleased milestone Oct 22, 2021
yselkowitz added a commit to multi-arch/oc that referenced this issue Oct 22, 2021
@seankhliao seankhliao added arch-arm64 NeedsFix The path to resolution is known, but the work has not been done. OS-Windows labels Oct 24, 2021
yselkowitz added a commit to yselkowitz/golang-exp that referenced this issue Dec 17, 2021
@gopherbot
Copy link

Change https://golang.org/cl/372835 mentions this issue: mmap: fix undefined maxBytes for windows/arm64

@gopherbot
Copy link

Change https://golang.org/cl/372834 mentions this issue: mmap: fix maxBytes undefined in arm64

@golang golang locked and limited conversation to collaborators Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
3 participants