-
-
Notifications
You must be signed in to change notification settings - Fork 940
ci: Add Makefile and debian directory
#22381
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
base: master
Are you sure you want to change the base?
Conversation
debian/control
Outdated
| @@ -0,0 +1,24 @@ | |||
| Source: ruffle-nightly | |||
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.
Can you put all these files (including the Makefile) in ruffle/desktop/packages/linux/debian? If this produces more than one package (or has a potential to), it should be placed in a subdirectory there, e.g. ruffle/desktop/packages/linux/debian/ruffle, similarly to AUR
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.
This debian directory has a 3.0 (native) format, which has to be in root directory of source code. Maybe we should use the more complicated 3.0 (quilt) format?
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.
(Disclaimer: I'm not very proficient in debian packaging)
I think we have to talk through the general approach of building the package. I see two approaches: (1) build based on the repository, and (2) build from an external source.
Currently, we have a bit of a mix of both, but I would personally prefer the (2) approach. That's how we did AUR and Flatpak, and it just makes it easier for everyone, because packaging is not tightly coupled with the repo, and there's a hierarchy: the repo (upstream) decides how it should be built, and the package (downstream) builds it the way it should. This also fits with the general approach to packaging software, where the downstream is a separate repo.
So I would really prefer this approach, and IIUC it currently works a bit like that? Based on what you said about the tags and tarballs. But on the other side it doesn't, because it requires to be in a specific directory. Could you elaborate on the flow? Like a step by step instruction on how to produce a package with this PR? I think the (2) approach I described should be easily doable in ruffle/desktop/packages/linux/debian—the packaging code would just download the source (the tarball) and do the build as it wishes.
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.
Debian packaging tools won't download source code; apt source does (it requires a source repository).
AFAIK:
3.0 (native) tries to build from where the debian directory is, and build the source as-is. It also build a source tarball outside the source directory (with local changes). Revisioning is not allowed.
3.0 (quilt) requires a properly named source tarball to be placed along with the source directory, and will verify the source tree with the tarball (any local file changes should be in separated patches rather than the source tree). Revisioning is required. A .dsc file and .debian.tar.xz (containing the whole debian directory with control, changelog, rules, patches, etc.) is created during build (for properly extract the source with dpkg-source -x)
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.
Hmmm, based on what I read about the difference between (native) and (quilt), (quilt) would fit better for Ruffle, as it's not a Debian-native application. We're building a Debian package as a downstream, and coupling Ruffle with Debian that tightly could be problematic IMO.
But the main question is: what do we do with this debian packaging config? Do you want Ruffle to be published in Debian repos? Is it meant to be available for users to build? Do you want us to provide .deb packages for each release?
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.
I'm not sure about this (I'm not a debian maintainer)... Maybe it's a good start to have debian scripts in repository.
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.
I'm asking because I don't see how we could use those scripts in the first place. I see issues with every application, but it would be useful to focus on the one we're planning to use, because we need to somehow address those issues before we can merge.
The main issue I see is that Ruffle does not have stable releases (and it's not gonna happen soon, the community doesn't want that), and is inherently incompatible with how Debian releases software and their stabilization process. Dependencies in Debian repos are old compared to what Ruffle uses, and we have no way of supporting older releases. It means that Debian users (using the latest Debian release) would have to use a ~8 months old Ruffle release without any patch in between the release date and today. Something is broken in Ruffle on Debian? You have to wait a year before you can enjoy the fix. (And that is without the guarantee that something else doesn't get broken by the way.)
debian/changelog
Outdated
| @@ -0,0 +1,5 @@ | |||
| ruffle-nightly (20251201) UNRELEASED; urgency=medium | |||
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.
The changelog should start empty, and it should be updated by the .github/scripts/release.py script.
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.
Without this I can't test the whole thing.
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.
It seems that changelogs are generated upon creating releases (where they're never been written into repository files before creation of the corresponding tag). Maybe we should write a log somewhere in repository everytime a pull request is merged?
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.
I think it's fine to leave an empty changelog, we'll only be packaging releases, no?
debian/control
Outdated
| @@ -0,0 +1,24 @@ | |||
| Source: ruffle-nightly | |||
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.
How do you get the source package? Why does it have "nightly" in name, but this package doesn't?
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.
I'd reconsider this later...
Makefile
Outdated
| version: | ||
| @echo $(VERSION) | ||
| @sed -i '1s/([0-9]\{8\})/($(VERSION))/' debian/changelog |
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.
This should not be needed after the changelog starts being properly updated.
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.
Yep
Makefile
Outdated
| VERSION := $(shell echo $(notdir $(CURDIR)) | tr -cd '0-9') | ||
| ifeq ($(VERSION),) | ||
| VERSION := $(shell date +%Y%m%d) | ||
| endif |
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.
This should not be needed after the changelog starts being properly updated. (Not to mention it doesn't work properly.)
debian/changelog
Outdated
| @@ -0,0 +1,5 @@ | |||
| ruffle-nightly (20251201) UNRELEASED; urgency=medium | |||
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.
Can't we use the version we have in Cargo.toml? Why does it say ruffle-nightly?
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.
I initially get this from tags (which are nightly). Will change to that in Cargo.toml later.
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.
Using approach (1) (building using the repo), this should automatically read the version from Cargo.toml, or using approach (2) (building from an external source), the version can be updated in the release script.
|
|
||
| all: ruffle_desktop | ||
|
|
||
| clean: |
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.
Shouldn't it also clean the ignored files in /debian?
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.
Will add this later
| Rules-Requires-Root: no | ||
| Build-Depends: | ||
| debhelper-compat (= 13), | ||
| rustc (>= 1.86), |
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.
This will definitely desync. Maybe setting up a CI would somehow address it
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.
Some dependencies may require a random rust toolchain version (rather than 1.85 for edition2024, etc.), I changed it to 1.86 because it complains about it. There may be a way to detect the minimum required toolchain version (hoping it won't be newer than that in sid...)
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.
Usually, Ruffle waits several days after a new Rust version is released and then starts using it. So we generally keep up with repos such as Fedora, Arch, but I'm not sure how this works in sid.
Based on my previous interest in packaging Ruffle, we are just incompatible with most distributions, and packaging Ruffle doesn't make sense, because you would be using versions from several months ago, because dependencies cannot keep up. The only two distributions where packaging Ruffle would be doable was Fedora and Arch.
From what I see, there's rustc 1.90.0 on sid, which means the newest Ruffle version working there would be ~1 month old as of today. I think this is acceptable, but looking at the latest stable, it would be ~8 months, for the oldest stable it would be ~5 years. IMO this is unacceptable considering the current development model of Ruffle, as it would produce packages which are basically unsupported at launch. Not to mention we don't have a way of backporting bugfixes, because we don't have stable releases.
But that's also the reason we have the Flatpak app, it should work on every distro and we don't have to worry about dependencies too much.
debian/control
Outdated
| @@ -0,0 +1,24 @@ | |||
| Source: ruffle-nightly | |||
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.
We'll need to have a CI set up so that this package is being built automatically. Otherwise it will decay, and merging it doesn't make sense, because we won't be supporting it properly.
It doesn't have to produce release artifacts yet, but it should be built at least once per day to make sure it doesn't start failing.
| cargo build --release --package=$@ | ||
| install -m755 target/release/$@ ./$@ | ||
|
|
||
| install: ruffle_desktop |
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.
I think you missed some stuff. We have a desktop file, metainfo, and an icon which should be installed too, along the binary.
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.
I'll add them later.
|
A general question: how this package is going to be used? Is it meant to be something we can attach as a release artifact? Do users have to build it themselves? Have you thought about just submitting this package to debian repositories instead? |
The current one is for building from source tarballs downloaded from tags (it updates changelog from extracted directory name with date, has "nightly" in source name, and is in |
Makefile and debian directoryMakefile and debian directory
|
Patch refactored, now:
Status:
|
9b13cb7 to
91e206c
Compare
Makefileallows quick build/installation usingmake/sudo make install.debiandirectory adds basic support for building debian package usingMakefile(targetversionupdatesdebian/changeloganddebcallsdpkg-buildpackage -us -uc).Build dependencies can be installd by:
Impl. #12633 .