Skip to content

Support AIX in mlock package#187

Open
pgimalac wants to merge 1 commit into
hashicorp:mainfrom
pgimalac:pgimalac/aix-mlock
Open

Support AIX in mlock package#187
pgimalac wants to merge 1 commit into
hashicorp:mainfrom
pgimalac:pgimalac/aix-mlock

Conversation

@pgimalac

@pgimalac pgimalac commented Jul 6, 2026

Copy link
Copy Markdown

👋 Hello, this PR adds aix to the list of build tags in mlock/mlock_unix.go, and updates the fallback file mlock/mlock_unavail.go to use the negated list of build tags from mlock/mlock_unix.go.

Currently, aix is missing from both files, so the package fails to compile on AIX.
Those changes fix it, and using the negated list as a fallback prevents issues for new operating systems supported by Go.

PCI review checklist

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

  • If applicable, I've worked with GRC to document the impact of any changes to security controls.

    Examples of changes to controls include access controls, encryption, logging, etc.

  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.

    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

mlock_unix.go: add aix to supported platforms (mlockall(2) and MCL_CURRENT/
MCL_FUTURE are available on AIX, and golang.org/x/sys/unix exports Mlockall
for aix/ppc64). Also add the modern //go:build tag alongside the legacy
// +build comment.

mlock_unavail.go: switch from enumerating unsupported platforms to negating
supported ones, so new platforms (like aix) are covered automatically once
added to mlock_unix.go rather than requiring a separate change here.
@pgimalac pgimalac requested a review from a team as a code owner July 6, 2026 13:58
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request Jul 7, 2026
### What does this PR do?

Adds `//go:build !aix` to `cmd/secret-generic-connector/backend/hashicorp/vault_test.go`.

### Motivation

Caught by cross-linting with `GOOS=aix GOARCH=ppc64` (see #53214). The test file imports `github.com/hashicorp/vault/http`, which transitively depends on `github.com/hashicorp/go-secure-stdlib/mlock`. That package is missing an implementation for AIX (clearly forgotten in build tags list), so it doesn't compile. 

### Describe how you validated your changes

`GOOS=aix GOARCH=ppc64 dda inv linter.go --targets=./cmd/secret-generic-connector/...`

### Additional notes
Opened hashicorp/go-secure-stdlib#187 to fix the compilation issue upstream

Co-authored-by: pierre.gimalac <pierre.gimalac@datadoghq.com>
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.

1 participant