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

Add build constraint to allow compiling without cgo #604

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Keep golang version aligned with latest yocto release
FROM golang:1.17.13-bullseye as builder
FROM golang:1.22.2-bullseye as builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the version aligned to yocto, see comment above.

Coincidentally, we are discussing this in the upcoming client team meeting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep in mind that go1.17 has been out of support for almost 2 years. Is it not possible to use the most recent version of Go when compiling Yocto?

Copy link
Contributor

@lluiscampos lluiscampos Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yocto maintains the toolchain, porting security fixes (same as for example Debian or other OSs do for the same time period that they support the OS).

Fixing the version here does have any impact in the final yocto build nor in the deb packages build.

Fixing the version here is only a way for us (me) to early catch when updates will break in today latest yocto LTS. Then we can decide to accept the breakage and patch the code there or reject the update for the time being. It is a difficult balance - to give you a small picture: we still support dunfell LTS which uses golang 1.14 and it is really hard and time consuming delivering our software there.

RUN mkdir -p /go/src/github.com/mendersoftware/mender-artifact
WORKDIR /go/src/github.com/mendersoftware/mender-artifact
ADD ./ .
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.binaries
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Keep golang version aligned with latest yocto release
FROM golang:1.17.13-bullseye as builder
FROM golang:1.22.2-bullseye as builder
RUN apt-get update && \
apt-get install -y \
gcc gcc-mingw-w64 gcc-multilib \
Expand Down
4 changes: 2 additions & 2 deletions artifact/signer_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux
// +build linux
//go:build linux && cgo
// +build linux,cgo

package artifact

Expand Down
4 changes: 2 additions & 2 deletions artifact/signer_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !linux
// +build !linux
//go:build !linux || !cgo
// +build !linux !cgo

package artifact

Expand Down