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

Don't compress debian packages #787

Merged
merged 1 commit into from
May 10, 2016

Conversation

pauldraper
Copy link
Contributor

@pauldraper pauldraper commented Apr 26, 2016

Representative example:

A Play project takes 30 seconds for dpkg-deb to build a 70MB deb with compression.
The same project takes 1 second to build a 79MB deb without compression.

Since JARs are already compressed archives, a sensible default is to not compress them again. (In fact, I'd be surprised if the small gains in client downloads weren't almost entirely overcome by the time to decompress.)

Users can use debianNativeBuildOptions to override options for dpkg-deb if they would like a different compression type, level, etc.

@muuki88 muuki88 added the debian label Apr 27, 2016
@muuki88
Copy link
Contributor

muuki88 commented Apr 27, 2016

Thanks @pauldraper for your contribution. Disabling compression sounds like a reasonable default. Also you could achieve a similar effect by using JDebPackaging.

Your code looks good. Could you implement a new test that sets the debianNativeBuildOptions := Nil and shows that it still works. Also this new setting should be added to the Debian Plugin docs

@pauldraper pauldraper force-pushed the pauldraper-deb-compress branch from ece12f0 to 43c227a Compare April 27, 2016 15:51
Also allow custom options to dpkg-deb --build
@pauldraper pauldraper force-pushed the pauldraper-deb-compress branch from 43c227a to 662dbe3 Compare April 27, 2016 18:03
@pauldraper
Copy link
Contributor Author

Tests and documentation added.

@@ -43,6 +43,7 @@ trait DebianNativePackaging extends DebianPluginLike {
* package.
*/
private[debian] def debianNativeSettings: Seq[Setting[_]] = inConfig(Debian)(Seq(
debianNativeBuildOptions += "-Znone", // packages are largely JARs, which are already compressed
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't scope this. The setting is already prefixed with debian. I just realised it after reading the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is a bit too much refactoring for you, I can adjust that after merging.

Copy link
Contributor Author

@pauldraper pauldraper May 10, 2016

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

This more a bug then a feature :( I think we clean this up in another PR. Thanks a lot for your work :)

@muuki88 muuki88 merged commit cee091c into sbt:master May 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants