Skip to content

Fix execsession build on BSD platforms#81

Merged
shwetamurali merged 5 commits into
mainfrom
shweta/fix_build
Jul 15, 2026
Merged

Fix execsession build on BSD platforms#81
shwetamurali merged 5 commits into
mainfrom
shweta/fix_build

Conversation

@shwetamurali

@shwetamurali shwetamurali commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Description

ParentPID was only implemented for darwin, linux, and windows, but lock_unix.go (//go:build !windows) also pulls the package into freebsd/netbsd/openbsd builds, leaving ParentPID undefined and breaking the build there.

Adds ancestry_bsd.go for freebsd || netbsd || openbsd. It resolves the current process's parent via os.Getppid(), which is enough for the common ancestry check (IsAncestor tests each pid before recursing, so only the direct parent needs resolving). Deeper ancestry chains fail closed rather than being trusted. Verified go build passes on all six platforms.

Example Output

PR Checklist

  • Run npx changie new or install changie to prepare a new changelog entry for the next set of release notes.
  • Ensure any command changes are sensitive to these global flags:
    • --json — Force machine readable output to stdout. Does not apply to stderr.
    • --markdown — Force markdown output to stdout. Does not apply to stderr.
    • --dry-run — Don't make any actual writes or other mutations. Describe what would have changed to stderr.
    • --quiet — Don't render output to stdout.
  • Get the logging interface from the context and add debug logging for interesting conditions and nonfatal situations.
  • Run make gen/screenshot if the root command output changes.
  • Add the Autocomplete field to positional arguments and flags to assist shell autocomplete.

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@shwetamurali shwetamurali changed the title degrade callers gracefully Fix execsession build on BSD platforms Jul 14, 2026
@shwetamurali
shwetamurali marked this pull request as ready for review July 14, 2026 20:18

@brandonc brandonc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

love to see it

@shwetamurali
shwetamurali merged commit e045cf4 into main Jul 15, 2026
2 checks passed
@shwetamurali
shwetamurali deleted the shweta/fix_build branch July 15, 2026 16:22
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