Skip to content

Conversation

@jtroy
Copy link

@jtroy jtroy commented Sep 27, 2024

This PR adds support for building for the aix/ppc64 target. The following minor changes have been made:

  • Add build tags where necessary to include aix with the other Unixes.
  • Update dependencies to versions that support building for aix/ppc64

To reproduce the build failure:

$ GOOS=aix GOARCH=ppc64 go build ./...
# github.com/hashicorp/packer-plugin-sdk/pathing
pathing/config_file.go:41:9: undefined: configDir
pathing/config_file.go:88:28: undefined: defaultConfigFile
# github.com/bgentry/speakeasy
../../../go/pkg/mod/github.com/bgentry/[email protected]/speakeasy.go:23:18: undefined: getPassword
# github.com/hashicorp/go-sockaddr
../../../go/pkg/mod/github.com/hashicorp/[email protected]/route_info.go:14:10: undefined: routeInfo
../../../go/pkg/mod/github.com/hashicorp/[email protected]/ifaddrs.go:116:13: undefined: NewRouteInfo
../../../go/pkg/mod/github.com/hashicorp/[email protected]/ifaddrs.go:276:13: undefined: NewRouteInfo

The above command returns success when run with this PR's changes and the go-cty fix.

Test results from an AIX 7.3 system, again with the go-cty fix applied:

-bash-5.2$ go version
go version go1.23.1 aix/ppc64
-bash-5.2$ go test ./...
?       github.com/hashicorp/packer-plugin-sdk/acctest  [no test files]
?       github.com/hashicorp/packer-plugin-sdk/acctest/provisioneracc   [no test files]
?       github.com/hashicorp/packer-plugin-sdk/acctest/testutils        [no test files]
ok      github.com/hashicorp/packer-plugin-sdk/adapter  0.138s
?       github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc   [no test files]
?       github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/cmd      [no test files]
?       github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/plugincheck      [no test files]
?       github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/test-data/field-conflict [no test files]
?       github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/test-data/packer-plugin-happycloud/builder/happycloud    [no test files]
?       github.com/hashicorp/packer-plugin-sdk/common   [no test files]
?       github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/test-data/tag-conflict   [no test files]
?       github.com/hashicorp/packer-plugin-sdk/didyoumean       [no test files]
?       github.com/hashicorp/packer-plugin-sdk/filelock [no test files]
?       github.com/hashicorp/packer-plugin-sdk/json     [no test files]
ok      github.com/hashicorp/packer-plugin-sdk/bootcommand      4.746s
ok      github.com/hashicorp/packer-plugin-sdk/chroot   0.353s
ok      github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/fix      0.406s
ok      github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/fs       0.331s
ok      github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/mapstructure-to-hcl2     0.536s
ok      github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/renderdocs       0.234s
ok      github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc/internal/struct-markdown  0.238s
?       github.com/hashicorp/packer-plugin-sdk/random   [no test files]
?       github.com/hashicorp/packer-plugin-sdk/tmp      [no test files]
ok      github.com/hashicorp/packer-plugin-sdk/communicator     11.654s
ok      github.com/hashicorp/packer-plugin-sdk/communicator/ssh 6.864s
ok      github.com/hashicorp/packer-plugin-sdk/communicator/sshkey      3.503s
ok      github.com/hashicorp/packer-plugin-sdk/guestexec        0.237s
ok      github.com/hashicorp/packer-plugin-sdk/hcl2helper       0.143s
ok      github.com/hashicorp/packer-plugin-sdk/multistep        0.349s
ok      github.com/hashicorp/packer-plugin-sdk/multistep/commonsteps    0.626s
ok      github.com/hashicorp/packer-plugin-sdk/net      1.172s
ok      github.com/hashicorp/packer-plugin-sdk/packer   0.195s
ok      github.com/hashicorp/packer-plugin-sdk/packer/registry/image    0.214s
ok      github.com/hashicorp/packer-plugin-sdk/packerbuilderdata        0.182s
ok      github.com/hashicorp/packer-plugin-sdk/pathing  0.099s
ok      github.com/hashicorp/packer-plugin-sdk/plugin   0.072s
ok      github.com/hashicorp/packer-plugin-sdk/retry    0.060s
ok      github.com/hashicorp/packer-plugin-sdk/rpc      0.123s
ok      github.com/hashicorp/packer-plugin-sdk/sdk-internals/communicator/none  0.055s
ok      github.com/hashicorp/packer-plugin-sdk/sdk-internals/communicator/ssh   0.116s
ok      github.com/hashicorp/packer-plugin-sdk/sdk-internals/communicator/winrm 0.114s
ok      github.com/hashicorp/packer-plugin-sdk/shell    0.054s
ok      github.com/hashicorp/packer-plugin-sdk/shell-local      0.118s
ok      github.com/hashicorp/packer-plugin-sdk/shell-local/localexec    0.093s
ok      github.com/hashicorp/packer-plugin-sdk/shutdowncommand  0.060s
ok      github.com/hashicorp/packer-plugin-sdk/template 0.120s
ok      github.com/hashicorp/packer-plugin-sdk/template/config  0.094s
ok      github.com/hashicorp/packer-plugin-sdk/template/interpolate     0.118s
ok      github.com/hashicorp/packer-plugin-sdk/template/interpolate/aws/secretsmanager  0.096s
ok      github.com/hashicorp/packer-plugin-sdk/useragent        0.094s
ok      github.com/hashicorp/packer-plugin-sdk/uuid     0.111s
ok      github.com/hashicorp/packer-plugin-sdk/version  0.094s

@jtroy jtroy requested a review from a team as a code owner September 27, 2024 18:41
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

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

Hey @jtroy,

Thanks for the PR, and apologies for leaving it open for so long.

The changes make sense, please be aware though that while this change makes it possible for Packer and plugins to be compiled for AIX, we won't start releasing those builds because of the maintenance implications that it has, as we don't have the resources to maintain yet another arch/OS combo.

That said, I'll merge this today and make it part of the next release of the SDK, this way you will be able to rely on it for your developments, hope this is good enough for you.

Thanks again for the PR @jtroy, much appreciated!

@lbajolet-hashicorp lbajolet-hashicorp merged commit ec2468d into hashicorp:main Jan 20, 2025
@jtroy
Copy link
Author

jtroy commented Jan 20, 2025

Hi, @lbajolet-hashicorp, I should've mentioned that I have no expectation of any kind of official AIX support. Sorry about that. Thanks for pulling it in!

@lbajolet-hashicorp
Copy link
Contributor

Don't worry, no need to be sorry at all, I just wanted to make sure to clarify that it's not in our priorities to support AIX :)

@lbajolet-hashicorp lbajolet-hashicorp added the enhancement New feature or request label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants