lf: "cannot use stat.Nlink as uint64" when install lf

When I tried to install lf via env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/gokcehan/lf@latest, I got an erorr. Please refer to pic below

image

My OS: macOS 13.3. I am not sure whether the issue is OS specific.

Thank you.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Also, @rockyzhang24 can try

env CGO_ENABLED=0 go install -ldflags="-s -w" github.com/joelim-work/lf@fix-nlink-format

This is what I already tried at the beginning but got an error.

image

@ilyagr Thanks. I just tested it. The build worked well and lf can be launched by running ./lf perfectly.

@ilyagr I checked the CI pipeline, it only builds on Ubuntu and Windows, so that explains the issue was not caught earlier: https://github.com/gokcehan/lf/blob/2ab4b14e883f7d989fbe1e0a193223263bfeeed1/.github/workflows/go.yml#L11-L30

Building for all the other platforms happens in a different pipeline, which I suspect is only triggered manually whenever a new release is to be created: https://github.com/gokcehan/lf/blob/2ab4b14e883f7d989fbe1e0a193223263bfeeed1/.github/workflows/release.yml#L10-L21

It’s not a bug in Go, it’s just simply because stat.Nlink has a different type depending on the platform. For Darwin ARM 64-bit it is uint16, but on my platform Linux AMD 64-bit it is uint64.

My apologies for causing this bug, I only thought to test this locally and didn’t consider other platforms.