Skip to content

Conversation

@max-baz
Copy link
Contributor

@max-baz max-baz commented Mar 15, 2020

This change makes use of GOFLAGS to simplify compiling with PIE, respecting LDFLAGS and trimming local paths to support reproducible builds.

Relevant: https://lists.archlinux.org/pipermail/arch-dev-public/2020-March/029898.html

Since you are already providing a source tarball that includes vendor dependencies (👍), all dependency-related items in the email do not apply to you:

  • -mod=vendor is used by default in Go 1.14
  • -modcacherw is only needed if our build system was fetching vendor dependencies itself

Tested by applying this patch on top of 1.7.1 release archive that contains vendor folder.

max-baz added 3 commits March 15, 2020 16:27
This change makes use of GOFLAGS to simplify compiling with PIE, respecting LDFLAGS and trimming local paths to support reproducible builds.

Relevant: https://lists.archlinux.org/pipermail/arch-dev-public/2020-March/029898.html

Since you are already providing a source tarball that includes vendor dependencies (👍), all dependency-related items in the email do not apply to you:

* -mod=vendor is used by default in Go 1.14
* -modcacherw is only needed if our build system was fetching vendor dependencies itself

Tested by applying this patch on top of 1.7.1 release archive that contains vendor folder.
@max-baz
Copy link
Contributor Author

max-baz commented Mar 15, 2020

Oh it seems your travis checks for older Go versions... Let me know how you want to proceed, maybe it's time to remove older Go versions? 😜

rfjakob added a commit that referenced this pull request Apr 13, 2020
@rfjakob
Copy link
Owner

rfjakob commented Apr 18, 2020

-buildmode=pie causes problems with static builds:

# github.com/rfjakob/gocryptfs
loadinternal: cannot find runtime/cgo
# github.com/rfjakob/gocryptfs/gocryptfs-xray
loadinternal: cannot find runtime/cgo
# github.com/rfjakob/gocryptfs/contrib/statfs
loadinternal: cannot find runtime/cgo

@max-baz
Copy link
Contributor Author

max-baz commented Apr 18, 2020

Hmm I didn't see this, do you do something special to reproduce?

@rfjakob
Copy link
Owner

rfjakob commented Apr 18, 2020

$ ./build-without-openssl.bash 
# github.com/rfjakob/gocryptfs
loadinternal: cannot find runtime/cgo
# github.com/rfjakob/gocryptfs/gocryptfs-xray
loadinternal: cannot find runtime/cgo
# github.com/rfjakob/gocryptfs/contrib/statfs
loadinternal: cannot find runtime/cgo
gocryptfs v1.7.1-48-gf6b1c68 without_openssl; go-fuse v1.0.1-0.20190319092520-161a16484456; 2020-04-18 go1.13.6 linux/amd64

@rfjakob
Copy link
Owner

rfjakob commented Apr 18, 2020

Fixed via 5da5e9f . build.bash now uses both -buildmode=pie and -trimpath when possible.

@rfjakob rfjakob closed this Apr 18, 2020
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

Successfully merging this pull request may close these issues.

2 participants