Skip to content

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Jun 29, 2021

These packages are transitive dependencies in cilium-cli, but currently they
fails to build on non-unix platforms (e.g. windows) due to their use of
golang.org/x/sys/unix.

However, we want still to be able to build it for some these platforms,
see e.g. cilium/cilium-cli#231. Fix the build
by moving all unix-specific functionality (i.e. the Uname call) to
separate files, protected by build tags.

Also marking for backports to 1.10 since we vendor a stable cilium/cilium release into cilium-cli (currently v1.9.8, but switching to v1.10 with cilium/cilium-cli#358 once all necessary fixes have been backported).

@tklauser tklauser added release-note/misc This PR makes changes that have no direct user impact. needs-backport/1.10 labels Jun 29, 2021
@tklauser tklauser requested a review from a team as a code owner June 29, 2021 07:46
@tklauser tklauser changed the title version: split GetKernelVersion into separate file version, metrics: allow to build on non-unix platforms Jun 29, 2021
@tklauser tklauser force-pushed the version-windows-build branch from c8de18b to b58cbf7 Compare June 29, 2021 07:54
@tklauser tklauser requested a review from a team as a code owner June 29, 2021 07:54
@tklauser tklauser requested a review from errordeveloper June 29, 2021 07:54
@tklauser tklauser closed this Jun 29, 2021
@tklauser tklauser reopened this Jun 29, 2021
@tklauser tklauser force-pushed the version-windows-build branch from b58cbf7 to 7fd6c22 Compare June 30, 2021 14:25
@tklauser
Copy link
Member Author

test-me-please

@tklauser tklauser force-pushed the version-windows-build branch from 7fd6c22 to d3f6f44 Compare July 1, 2021 14:29
@tklauser
Copy link
Member Author

tklauser commented Jul 1, 2021

Rebased to pick up updated kind version to fix conformance test GH action failures.

@tklauser
Copy link
Member Author

tklauser commented Jul 1, 2021

test-me-please

@tklauser tklauser force-pushed the version-windows-build branch from d3f6f44 to e0f4d36 Compare July 2, 2021 09:31
@tklauser
Copy link
Member Author

tklauser commented Jul 2, 2021

Rebased to pick up more conformance test fixes from master.

@tklauser
Copy link
Member Author

tklauser commented Jul 2, 2021

test-me-please

@tklauser
Copy link
Member Author

tklauser commented Jul 2, 2021

Copy link
Contributor

@errordeveloper errordeveloper left a comment

Choose a reason for hiding this comment

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

Thanks for doing this, Tobias!

I found that it's hard to prevent these sort of changes from breaking (had to fix some macOS builds a few times). Did you think of adding some kind of check that runs builds for different OSes, even if it's just a subset of packages for now?

@tklauser
Copy link
Member Author

tklauser commented Jul 8, 2021

Did you think of adding some kind of check that runs builds for different OSes, even if it's just a subset of packages for now?

Yeah, that's a good point. Though it will probably a bit of a challenge to determine the correct subset of packages we want to build on other platforms and I imagine it to change over time as well.

For now I'd go with anything imported by cilium/cilium-cli as well as any package in cilium/cilium which have darwin or windows build tags/file names. @errordeveloper any other packages that come to mind or that you remember having issues with on macOS in the past?

@errordeveloper
Copy link
Contributor

For now I'd go with anything imported by cilium/cilium-cli as well as any package in cilium/cilium which have darwin or windows build tags/file names.

Sounds good!

@errordeveloper any other packages that come to mind or that you remember having issues with on macOS in the past?

Personally, I think everything should be buildable, and it's ought to be possible to run pure unit tests, but that's not something we will be can realistically achieve very soon... How about the operator, I was able to work on it natively on macOS in the past, and in theory it should remain free of Linux-isms, right?

@tklauser
Copy link
Member Author

tklauser commented Jul 9, 2021

For now I'd go with anything imported by cilium/cilium-cli as well as any package in cilium/cilium which have darwin or windows build tags/file names.

Sounds good!

@errordeveloper any other packages that come to mind or that you remember having issues with on macOS in the past?

Personally, I think everything should be buildable, and it's ought to be possible to run pure unit tests, but that's not something we will be can realistically achieve very soon... How about the operator, I was able to work on it natively on macOS in the past, and in theory it should remain free of Linux-isms, right?

Created #16843 to track which packages we want to be able to build on non-Linux platforms.

@tklauser tklauser force-pushed the version-windows-build branch from 8e31906 to 6606842 Compare July 12, 2021 08:45
@tklauser
Copy link
Member Author

Rebased to pick up CI 3.0 fixes.

@tklauser
Copy link
Member Author

test-me-please

@tklauser
Copy link
Member Author

tklauser commented Jul 13, 2021

test-gke

timed out waiting for CI images: https://jenkins.cilium.io/job/Cilium-PR-K8s-GKE/6006

tklauser added 2 commits July 14, 2021 09:33
This package is a transitive dependency in cilium-cli, but currently it
fails to build on non-unix platforms (e.g. windows) due to its use of
golang.org/x/sys/unix.

However, we want still to be able to build it for some these platforms,
see e.g. cilium/cilium-cli#231. Fix the build
by moving all unix-specific functionality (i.e. the Uname call) to a
separate file, protected by build tags.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
This package is a transitive dependency in cilium-cli, but currently it
fails to build on non-unix platforms (e.g. windows) due to its use of
golang.org/x/sys/unix.

However, we want still to be able to build it for some these platforms,
see e.g. cilium/cilium-cli#231. Fix the build
by moving all unix-specific functionality (i.e. the use of unix.Errno)
to a separate file, protected by build tags.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser force-pushed the version-windows-build branch from 69f62d2 to 230e619 Compare July 14, 2021 07:33
@tklauser
Copy link
Member Author

test-me-please

@tklauser tklauser added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 14, 2021
@nebril nebril merged commit 1da68d8 into cilium:master Jul 15, 2021
@tklauser tklauser deleted the version-windows-build branch July 15, 2021 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants