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

5.5.0 fails to build: fatal error: 'lib/sha1.h' file not found #626

Closed
nunotexbsd opened this issue Dec 2, 2022 · 6 comments
Closed

5.5.0 fails to build: fatal error: 'lib/sha1.h' file not found #626

nunotexbsd opened this issue Dec 2, 2022 · 6 comments

Comments

@nunotexbsd
Copy link

FreeBSD, go 1.19.3

github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband
gopkg.in/warnings.v0
math/big
# github.com/pjbgf/sha1cd/cgo
vendor/github.com/pjbgf/sha1cd/cgo/sha1.go:3:11: fatal error: 'lib/sha1.h' file not found
 #include <lib/sha1.h>
          ^~~~~~~~~~~~
1 error generated.
net/url
compress/flate
github.com/ProtonMail/go-crypto/ocb
github.com/emirpasic/gods/utils
github.com/go-git/go-git/v5/utils/merkletrie/noder
encoding/json
golang.org/x/sys/execabs
github.com/ProtonMail/go-crypto/openpgp/aes/keywrap
github.com/go-git/gcfg/scanner
github.com/go-git/go-git/v5/utils/merkletrie/internal/frame
# golang.org/x/sys/unix
vendor/golang.org/x/sys/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/sys/unix/syscall_unix.go:118:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
github.com/emirpasic/gods/containers
(...)
github.com/ProtonMail/go-crypto/openpgp
*** Error code 2

Any clues?

@nunotexbsd
Copy link
Author

(...)

Build fails when fetching from GO_MODULE= github.com/go-git/go-git/v5

Using classic way gomod-vendor:

GH_TUPLE=      \
               Microsoft:go-winio:v0.5.2:microsoft_go_winio/vendor/github.com/Microsoft/go-winio \
               ProtonMail:go-crypto:cf6655e29de4:protonmail_go_crypto/vendor/github.com/ProtonMail/go-crypto \
               acomagu:bufpipe:v1.0.3:acomagu_bufpipe/vendor/github.com/acomagu/bufpipe \
               anmitsu:go-shlex:38f4b401e2be:anmitsu_go_shlex/vendor/github.com/anmitsu/go-shlex \
               armon:go-socks5:e75332964ef5:armon_go_socks5/vendor/github.com/armon/go-socks5 \
               cloudflare:circl:v1.1.0:cloudflare_circl/vendor/github.com/cloudflare/circl \
               emirpasic:gods:v1.18.1:emirpasic_gods/vendor/github.com/emirpasic/gods \
               gliderlabs:ssh:v0.3.5:gliderlabs_ssh/vendor/github.com/gliderlabs/ssh \
               go-check:check:10cb98267c6c:go_check_check/vendor/gopkg.in/check.v1 \
               go-git:gcfg:v1.5.0:go_git_gcfg/vendor/github.com/go-git/gcfg \
               go-git:go-billy:v5.3.1:go_git_go_billy_v5/vendor/github.com/go-git/go-billy/v5 \
               go-git:go-git-fixtures:v4.3.1:go_git_go_git_fixtures_v4/vendor/github.com/go-git/go-git-fixtures/v4 \
               go-warnings:warnings:v0.1.2:go_warnings_warnings/vendor/gopkg.in/warnings.v0 \
               golang:crypto:v0.3.0:golang_crypto/vendor/golang.org/x/crypto \
               golang:net:v0.2.0:golang_net/vendor/golang.org/x/net \
               golang:sys:v0.2.0:golang_sys/vendor/golang.org/x/sys \
               golang:text:v0.4.0:golang_text/vendor/golang.org/x/text \
               google:go-cmp:v0.5.9:google_go_cmp/vendor/github.com/google/go-cmp \
               imdario:mergo:v0.3.13:imdario_mergo/vendor/github.com/imdario/mergo \
               jbenet:go-context:d14ea06fba99:jbenet_go_context/vendor/github.com/jbenet/go-context \
               jessevdk:go-flags:v1.5.0:jessevdk_go_flags/vendor/github.com/jessevdk/go-flags \
               kevinburke:ssh_config:v1.2.0:kevinburke_ssh_config/vendor/github.com/kevinburke/ssh_config \
               kr:pretty:v0.2.1:kr_pretty/vendor/github.com/kr/pretty \
               kr:text:v0.2.0:kr_text/vendor/github.com/kr/text \
               pjbgf:sha1cd:v0.2.0:pjbgf_sha1cd/vendor/github.com/pjbgf/sha1cd \
               sergi:go-diff:v1.1.0:sergi_go_diff/vendor/github.com/sergi/go-diff \
               skeema:knownhosts:v1.1.0:skeema_knownhosts/vendor/github.com/skeema/knownhosts \
               xanzy:ssh-agent:v0.3.2:xanzy_ssh_agent/vendor/github.com/xanzy/ssh-agent

Build is fine

It seems that go.mod was not properly updated?

Thanks

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Dec 2, 2022
 - broken on i386, issue: pjbgf/sha1cd#6
 - switch back to "gomod-vendor" method because GO_MODULES is failing,
   issue: go-git/go-git#626

ChangeLog:	https://github.com/go-git/go-git/releases/tag/v5.5.0
@sithembiso
Copy link

sithembiso commented Dec 3, 2022

@nunotexbsd I encountered this issue as well and submitted a PR for it here: pjbgf/sha1cd#9.
The issue was caused by C source files in cgo/lib being left behind. See this helps (at least until there is a permanent solution):
go.mod

replace github.com/pjbgf/sha1cd v0.2.2 => github.com/lepsta/sha1cd v0.0.0-20221203081000-d3bde149f6ed

Then run:

go mod tidy && go mod vendor

@sithembiso
Copy link

This is another solution to this: #624 (comment). It's better because it doesn't require the use of embed.

@pjbgf
Copy link
Member

pjbgf commented Dec 3, 2022

This is resolved with the latest version of sha1cd, so whilst #625 is not merged, you can temporarily fix your build by amending your go.mod with:

replace github.com/pjbgf/sha1cd => github.com/pjbgf/sha1cd v0.2.3

Thanks again @sithembiso for helping getting this resolved.

@nunotexbsd
Copy link
Author

Fixed, thanks.

alexfalkowski added a commit to alexfalkowski/konfig that referenced this issue Dec 3, 2022
alexfalkowski added a commit to alexfalkowski/konfig that referenced this issue Dec 3, 2022
alexfalkowski added a commit to alexfalkowski/konfig that referenced this issue Dec 3, 2022
* build(deps): bump github.com/go-git/go-git/v5 from 5.4.2 to 5.5.0

Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.4.2 to 5.5.0.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](go-git/go-git@v5.4.2...v5.5.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): udpate github.com/pjbgf/sha1cd v0.2.3

go-git/go-git#626

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alejandro Falkowski <alexrfalkowski@gmail.com>
@nunotexbsd
Copy link
Author

(...)

Build fails when fetching from GO_MODULE= github.com/go-git/go-git/v5

Using classic way gomod-vendor:

GH_TUPLE=      \
               Microsoft:go-winio:v0.5.2:microsoft_go_winio/vendor/github.com/Microsoft/go-winio \
               ProtonMail:go-crypto:cf6655e29de4:protonmail_go_crypto/vendor/github.com/ProtonMail/go-crypto \
               acomagu:bufpipe:v1.0.3:acomagu_bufpipe/vendor/github.com/acomagu/bufpipe \
               anmitsu:go-shlex:38f4b401e2be:anmitsu_go_shlex/vendor/github.com/anmitsu/go-shlex \
               armon:go-socks5:e75332964ef5:armon_go_socks5/vendor/github.com/armon/go-socks5 \
               cloudflare:circl:v1.1.0:cloudflare_circl/vendor/github.com/cloudflare/circl \
               emirpasic:gods:v1.18.1:emirpasic_gods/vendor/github.com/emirpasic/gods \
               gliderlabs:ssh:v0.3.5:gliderlabs_ssh/vendor/github.com/gliderlabs/ssh \
               go-check:check:10cb98267c6c:go_check_check/vendor/gopkg.in/check.v1 \
               go-git:gcfg:v1.5.0:go_git_gcfg/vendor/github.com/go-git/gcfg \
               go-git:go-billy:v5.3.1:go_git_go_billy_v5/vendor/github.com/go-git/go-billy/v5 \
               go-git:go-git-fixtures:v4.3.1:go_git_go_git_fixtures_v4/vendor/github.com/go-git/go-git-fixtures/v4 \
               go-warnings:warnings:v0.1.2:go_warnings_warnings/vendor/gopkg.in/warnings.v0 \
               golang:crypto:v0.3.0:golang_crypto/vendor/golang.org/x/crypto \
               golang:net:v0.2.0:golang_net/vendor/golang.org/x/net \
               golang:sys:v0.2.0:golang_sys/vendor/golang.org/x/sys \
               golang:text:v0.4.0:golang_text/vendor/golang.org/x/text \
               google:go-cmp:v0.5.9:google_go_cmp/vendor/github.com/google/go-cmp \
               imdario:mergo:v0.3.13:imdario_mergo/vendor/github.com/imdario/mergo \
               jbenet:go-context:d14ea06fba99:jbenet_go_context/vendor/github.com/jbenet/go-context \
               jessevdk:go-flags:v1.5.0:jessevdk_go_flags/vendor/github.com/jessevdk/go-flags \
               kevinburke:ssh_config:v1.2.0:kevinburke_ssh_config/vendor/github.com/kevinburke/ssh_config \
               kr:pretty:v0.2.1:kr_pretty/vendor/github.com/kr/pretty \
               kr:text:v0.2.0:kr_text/vendor/github.com/kr/text \
               pjbgf:sha1cd:v0.2.0:pjbgf_sha1cd/vendor/github.com/pjbgf/sha1cd \
               sergi:go-diff:v1.1.0:sergi_go_diff/vendor/github.com/sergi/go-diff \
               skeema:knownhosts:v1.1.0:skeema_knownhosts/vendor/github.com/skeema/knownhosts \
               xanzy:ssh-agent:v0.3.2:xanzy_ssh_agent/vendor/github.com/xanzy/ssh-agent

Build is fine

It seems that go.mod was not properly updated?

Thanks

Same problem on 5.5.1 when fetching from go.mod

osokin pushed a commit to osokin/freebsd-ports that referenced this issue Jun 18, 2023
 - broken on i386, issue: pjbgf/sha1cd#6
 - switch back to "gomod-vendor" method because GO_MODULES is failing,
   issue: go-git/go-git#626

ChangeLog:	https://github.com/go-git/go-git/releases/tag/v5.5.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants