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

refactor: update unix build tags and add plan9 #224

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

kruskall
Copy link
Member

What does this PR do?

resolve obscure compile errors when trying to compile on different goos.
Use unix build tags and add plan9.

We can't implement uid/gid logic without breaks as plan9 uses strings while the api requires int.
Use plan9.Dup to redirect stderr.

See https://man2.aiju.de/2/dup

On plan9,

  • plan9.Dup(oldfd, newfd) == unix.Dup2(oldfd, newfd)
  • plan9.Dup(fd, -1) == unix.Dup(fd)

Why is it important?

  • !windows build tags is not true and causes misleading compile errors because it implies the file can be used in any goos other than windows while it's meant to be used for unix
  • _other has the same problem

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

Related issues

resolve obscure compile errors when trying to compile on
different goos.
Use unix build tags and add plan9.

We can't implement uid/gid logic without breaks as plan9 uses
strings while the api requires int.
Use plan9.Dup to redirect stderr.
@kruskall kruskall added the enhancement New feature or request label Aug 28, 2024
@kruskall kruskall requested a review from a team as a code owner August 28, 2024 01:35
@kruskall kruskall requested review from faec and VihasMakwana and removed request for a team August 28, 2024 01:35
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Aug 28, 2024
Copy link
Contributor

@VihasMakwana VihasMakwana left a comment

Choose a reason for hiding this comment

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

LGTM

@kruskall kruskall merged commit 8ec6b25 into elastic:main Aug 29, 2024
6 checks passed
@kruskall kruskall deleted the refactor/file-goos branch August 29, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants