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

feat: add support for Arch Linux packages #543

Merged
merged 32 commits into from Oct 15, 2022
Merged

feat: add support for Arch Linux packages #543

merged 32 commits into from Oct 15, 2022

Conversation

Elara6331
Copy link
Contributor

@Elara6331 Elara6331 commented Sep 11, 2022

This PR adds support for Arch Linux packages.

Like the previous PR (#141), this one generates .PKGINFO, .INSTALL, and .MTREE files.

Unlike that PR, this one compresses the package with a pure-Go Zstandard implementation, which conforms with the new standard for Arch packages.

I have successfully been able to install packages generated by this code, so it works, but there are no tests, so I am leaving it as a draft until I add tests and more comments to it.

Closes #133
Closes #546

@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 11, 2022
@caarlos0
Copy link
Member

amazing @Arsen6331! Let me know if you need any help!

@Elara6331 Elara6331 marked this pull request as ready for review September 12, 2022 02:30
@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #543 (31ab006) into main (1a66c73) will increase coverage by 0.68%.
The diff coverage is 73.37%.

@@            Coverage Diff             @@
##             main     #543      +/-   ##
==========================================
+ Coverage   69.31%   70.00%   +0.68%     
==========================================
  Files          20       21       +1     
  Lines        2581     3087     +506     
==========================================
+ Hits         1789     2161     +372     
- Misses        614      706      +92     
- Partials      178      220      +42     
Impacted Files Coverage Δ
apk/apk.go 72.12% <0.00%> (-0.42%) ⬇️
deb/deb.go 71.16% <0.00%> (-0.27%) ⬇️
internal/cmd/package.go 0.00% <0.00%> (ø)
internal/cmd/root.go 0.00% <ø> (ø)
nfpm.go 86.56% <ø> (ø)
rpm/rpm.go 68.88% <0.00%> (-0.52%) ⬇️
arch/arch.go 74.40% <74.40%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Elara6331
Copy link
Contributor Author

I've added the tests and comments, and fixed what the linter suggested.

@caarlos0 caarlos0 added the enhancement New feature or request label Sep 12, 2022
@caarlos0
Copy link
Member

Thanks, @Arsen6331 🚀

could you make the changes to the docs as well? they live in the www folder.

@Elara6331
Copy link
Contributor Author

could you make the changes to the docs as well? they live in the www folder.

Sure

@Elara6331
Copy link
Contributor Author

I've changed the docs

arch/arch.go Outdated Show resolved Hide resolved
Copy link
Contributor

@djgilcrease djgilcrease left a comment

Choose a reason for hiding this comment

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

@Elara6331
Copy link
Contributor Author

Implement signed packages wiki.archlinux.org/title/DeveloperWiki:Package_signing Appears to create a .sig file to live outside the package?

Yeah, it requires a separate file and I don't know how to implement that with the current API.

@Elara6331
Copy link
Contributor Author

Done

Copy link
Contributor

@djgilcrease djgilcrease left a comment

Choose a reason for hiding this comment

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

LGTM

@Elara6331
Copy link
Contributor Author

I could also try to make a PR against https://github.com/goreleaser/goreleaser that integrates these changes and can be merged once they make it into a release.

Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

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

on a first look it looks good to me! will see if I find some arch contributor to help review it as well!

thanks again for the work on this! ❤️

apk/apk.go Outdated Show resolved Hide resolved
@caarlos0
Copy link
Member

I could also try to make a PR against https://github.com/goreleaser/goreleaser that integrates these changes and can be merged once they make it into a release.

if you feel like it, go for it! If not, I can do it as well, no issues :)

@Elara6331
Copy link
Contributor Author

I went through a bunch of PKGBUILDs on the AUR to see if I missed anything and implemented all of it.

@caarlos0
Copy link
Member

I'll review this again today and see that we have it merge soon! 🙏 Sorry for the delay, had a crazy couple of weeks :P

@Elara6331
Copy link
Contributor Author

I'll review this again today and see that we have it merge soon! pray Sorry for the delay, had a crazy couple of weeks :P

No problem. Merge it whenever it's convenient for you, there's no rush.

@caarlos0 caarlos0 merged commit a18661b into goreleaser:main Oct 15, 2022
@github-actions github-actions bot added this to the v2.20.0 milestone Oct 15, 2022
caarlos0 pushed a commit to goreleaser/goreleaser that referenced this pull request Oct 15, 2022
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

This PR upgrades nFPM to v0.20.0, and integrates the new
`ConventionalExtension` method to use the correct extension for the
packaging format that is being used.

<!-- Why is this change being made? -->

Currently, goreleaser uses the name of the format to determine the
extension. This has worked fine, but with the introduction of Archlinux
packages, goreleaser has to handle packages with extensions that don't
match the name of the format, since Archlinux uses `.pkg.tar.zst` as the
extension.

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

goreleaser/nfpm#546
goreleaser/nfpm#543
@Elara6331 Elara6331 deleted the add-archlinux-pkgs branch October 16, 2022 09:12
@azat
Copy link

azat commented Oct 16, 2022

Apparently right now archlinux packager does not support type=config for directories:

nfpm package --target .. --config clickhouse-server.yaml --packager archlinux
using archlinux packager...
read root/etc/clickhouse-server: is a directory

@caarlos0
Copy link
Member

Apparently right now archlinux packager does not support type=config for directories:

nfpm package --target .. --config clickhouse-server.yaml --packager archlinux
using archlinux packager...
read root/etc/clickhouse-server: is a directory

can you open an issue/PR?

azat added a commit to azat/ClickHouse that referenced this pull request Oct 18, 2022
Since nfpm v2.20.0 it can build packages for archlinux [1].

  [1]: goreleaser/nfpm#543

Something like this:

    $ mkdir -p /src/packages/root
    $ cmake -DCMAKE_INSTALL_PREFIX=/usr /src
    $ DESTDIR=/src/packages/root ninja install
    $ cd /src/packages
    $ ./build --archlinux

    $ root@s3:/src/packages# ./build --archlinux
    Current version is 22.10.1.1
    Building archlinux package for clickhouse-client.yaml
    using archlinux packager...
    created package: /src/clickhouse-client-22.10.1.1-1-x86_64.pkg.tar.zst
    ...

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
@azat
Copy link

azat commented Oct 23, 2022

can you open an issue/PR?

#564

caarlos0 added a commit to goreleaser/goreleaser that referenced this pull request Nov 2, 2022
<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

This PR implements the Archlinux packages that were added in nfpm
v2.20.0, as well as tests and documentation for them.

<!-- Why is this change being made? -->

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

goreleaser/nfpm#133
goreleaser/nfpm#543
Fixes #3469

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@tonobo tonobo mentioned this pull request Mar 1, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle packaging formats with non-distinct file extensions Support for Arch Linux packages?
4 participants