-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Set up nFPM to build .deb and .rpm #1297
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
Conversation
17b8f4d
to
f213404
Compare
For the record, I have tested the deb package for arm64 on Ubuntu, bit not RPM, would be helpful if someone can do that. |
This commit simplifies the goreleaser configuration and then adds nfpm support which allows us to build .deb and .rpm for each of the ARCH we support. The deb and rpm packages adds systemd services and users, creates directories etc and should in general give the user a working environment. We should be able to remove a lot of the complicated, PEBCAK inducing documentation after this. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice!
Would you prefer to use more native packaging methods for building the RPMs to be consistent with packaging guidelines and policies used by Fedora/EPEL/RHEL? I'm a Fedora/EPEL packager and happy to help with this if you're open to using a different build process than nFPM. |
@jonathanspw, Thanks for offering, it is really appreciated, I am not familiar with RPM (nor have I used RPM based distros), and I am concerned that it would be a bit of a cliff to both maintain multiple packaging methods and learn the details (while I have heard RPM is easier/better than .deb), might become tech debt for us quite quickly. Happy to be convinced otherwise, is there any problems with the current packages that probably cant be addressed with nFPM? |
Here's just a few less-than-ideal things it's doing:
In addition, my intent is to build and maintain a repository for headscale on RPM distros (Fedora/EL*) which people can install and then natively upgrade as I push upgrades, etc. If the RPMs from CI are built in the same manner then it would allow people to seamlessly upgrade to using the repository, or upgrade from a CI RPM prior to the repository getting an update, and all work seamlessly together. It looks like we're going to be using headscale at AlmaLinux (I'm the infra lead over there) so I'll be able to help maintain this in CI indefinitely and it will be basically identical to the work I'll be doing in the repository anyway - ie mostly copy/paste. I currently do this for another project, ImHex, so here's an example of what it could look like within GH CI (again I'll take care of PRing this if you're open to it): https://github.com/WerWolv/ImHex/blob/master/.github/workflows/build.yml#L469 and the actual RPM spec file: https://github.com/WerWolv/ImHex/blob/master/dist/rpm/imhex.spec There are some extra complexities in each of these that are specific to ImHex that wouldn't be needed for headscale so it would be a bit simpler in practice here. |
I appreciate that, it sounds very good, I wonder if at this point it makes sense for us to publish RPM at all? Would it not be more beneficial to keep it in one place, which would be the main repo you provide?
So based on this I have a couple of questions/concerns: Why can we not beat nFPM into releasing RPMs that fulfils the requirement? It will be a lot harder to remove RPMs than adding them. I appreciate that nFPM is a "one tool to do them all, to mediocrity", but from our tech debt/maintenance perspective, those 90% might be good enough. On the other hand, referring to the first part, if you are doing a proper RPM, then one alternative is to not publish it from our side and rather refer to the repos. In which case, we would be grateful for that contribution! |
I'm working on the basis for the repo/RPMs now. Once I get that done I'll let you review it, how it will work, and then we can discuss further :) |
Sounds good, I will do docs and releases for |
This commit simplifies the goreleaser configuration and then adds nfpm
support which allows us to build .deb and .rpm for each of the ARCH we
support.
The deb and rpm packages adds systemd services and users, creates
directories etc and should in general give the user a working
environment. We should be able to remove a lot of the complicated,
PEBCAK inducing documentation after this.
Issue and PRs related to poor docs that could be fixed by this: