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

Add AIX platform capability to rpm builds #821

Closed
2 tasks done
Dylan-M opened this issue May 10, 2024 · 8 comments
Closed
2 tasks done

Add AIX platform capability to rpm builds #821

Dylan-M opened this issue May 10, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@Dylan-M
Copy link

Dylan-M commented May 10, 2024

Is your feature request related to a problem? Please describe.

I need to support AIX, and currently I can only do this by using tar packages. Goreleaser supports building AIX binaries, so it would be nice to be able to make their RPM files using nfpm/goreleaser

Describe the solution you'd like

Add AIX as a supported platform for nfpm's rpm packager.

Describe alternatives you've considered

None, we use goreleaser exclusively, so nfpm is a perfect fit.

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

I did try this very simple nfpm configuration as a test:

# nfpm example configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: "aix-somefile"
arch: "ppc64"
platform: "aix"
version: "1.0.0"
maintainer: "Fake Guy"
contents:
  - src: someFile
    dst: /usr/lib/someFile
    type: config|noreplace
    file_info:
      mode: 0644
      owner: root
      group: root

However, this was the result:

-bash-5.1# rpm -U /tmp/aix-somefile-1.0.0-1.ppc64.rpm 
        package aix-somefile-1.0.0-1.ppc64 is intended for a different architecture
        package aix-somefile-1.0.0-1.ppc64 is intended for a different operating system

The os error makes sense, but the arch error doesn't.

@Dylan-M
Copy link
Author

Dylan-M commented May 10, 2024

Documentation from IBM that may be useful:
https://developer.ibm.com/articles/au-aix-build-open-source-rpm-packages/

@djgilcrease
Copy link
Contributor

You may need to map the ppc64 to something else for the RPM similar to https://github.com/goreleaser/nfpm/blob/main/rpm/rpm.go#L57 when it is AIX

According to https://developer.ibm.com/articles/configure-yum-on-aix/ it could be ppc, ppc-6.1, ppc-7.1, or ppc-7.2

I would try setting the info.RPM.Arch as ppc and see if that works

@djgilcrease
Copy link
Contributor

Same is true for the OS error

https://www.unix.com/aix/266963-tip-problem-rpm-different-operating-system.html

Looks like it needs to be aix#.#

@Dylan-M
Copy link
Author

Dylan-M commented May 23, 2024

You may need to map the ppc64 to something else for the RPM similar to https://github.com/goreleaser/nfpm/blob/main/rpm/rpm.go#L57 when it is AIX

According to https://developer.ibm.com/articles/configure-yum-on-aix/ it could be ppc, ppc-6.1, ppc-7.1, or ppc-7.2

I would try setting the info.RPM.Arch as ppc and see if that works

I'm not sure that will help. It is building PPC for Linux just fine. It seems to just be ignoring it for AIX period. It isn't that they fail to work, it is that they just don't get generated at all.

@Dylan-M
Copy link
Author

Dylan-M commented May 23, 2024

I forgot to come back to this, but the rpm it generates is empty. I guess that is more accurate than it doesn't get generated at all.

@djgilcrease
Copy link
Contributor

when I used

# nfpm example configuration file
#
# check https://nfpm.goreleaser.com/configuration for detailed usage
#
name: "aix-somefile"
arch: "ppc64"
platform: "aix6.1"
version: "1.0.0"
maintainer: "Fake Guy"
rpm:
  arch: ppc
contents:
  - src: someFile
    dst: /usr/lib/someFile
    type: config|noreplace
    file_info:
      mode: 0644
      owner: root
      group: root

and had someFile populated with the string boo the resulting rpm was 1.4k in size. When I populated someFile with 10MB of random data the resulting RPM was 11MB in size, so the RPM is not empty. I do not have access to an IBM AIX system to test, but it did build the RPM

@Dylan-M
Copy link
Author

Dylan-M commented May 23, 2024

Okay, I'll go over my config again (I only included a stripped down version here as an example, our production config is very large covering many OSes), as it sounds like I may have screwed something else up somewhere.

Then I'll try your other suggestions. Thank you.

Assuming your other suggestions work, it would just be a simple PR to add the mapping to nfpm it looks like. I'm happy to make that.

@Dylan-M
Copy link
Author

Dylan-M commented May 27, 2024

So, a mapping in the code you linked wont work, because it only applies to AIX (Linux builds are correctly ppc for 32bit and ppc64 for 64 bit).

That said, overriding them manually like you did in your example, worked perfectly as far as I can tell.

However, this doesn't work for goreleaser itself, because it isn't aware of the platform and rpm/arch fields. We can address those in goreleaser/goreleaser#4853

@Dylan-M Dylan-M closed this as completed May 27, 2024
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

No branches or pull requests

3 participants