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

Fixes issue #789 where brpJavaRepack was negated #932

Merged
merged 7 commits into from
Jan 25, 2017

Conversation

YuvalItzchakov
Copy link
Contributor

@YuvalItzchakov YuvalItzchakov commented Jan 18, 2017

Fixes #789 where the value of rpmBrpJavaRepackJars was required to be set to false in order for repacking not to occur.

I've done three things:

  1. Created a shorter pre script which utilizes sed in a single liner, since there are versions which don't support multi line macros (when running the test I kept getting errors about macro having an empty body, see this for more). I also changed the macro prefix from %define to %global, as that's the recommended approach by Fedora.

  2. Negated the default flag from false to true. My assumption was people might not want to disable repackaging out of the box, but feel free to tell me otherwise

  3. Added a test to validate that the removal of brpRepack works when the flag is set to false.

@YuvalItzchakov YuvalItzchakov changed the title Fixed issue #789 where brpJavaRepack was negated (set to 'false' inst… Fixed issue #789 where brpJavaRepack was negated Jan 18, 2017
@YuvalItzchakov YuvalItzchakov changed the title Fixed issue #789 where brpJavaRepack was negated Fixes issue #789 where brpJavaRepack was negated Jan 18, 2017
@muuki88 muuki88 added the rpm label Jan 18, 2017
Copy link
Contributor

@muuki88 muuki88 left a comment

Choose a reason for hiding this comment

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

Thanks for the well documented and testet PR. I have a few questions so I put this on request changes. I'm open to any solution, just want to get a better understanding.

@@ -121,7 +121,7 @@ object RpmPlugin extends AutoPlugin {
(rpmProvides, rpmRequirements, rpmPrerequisites, rpmObsoletes, rpmConflicts) apply RpmDependencies,
maintainerScripts in Rpm := {
val scripts = (maintainerScripts in Rpm).value
if (rpmBrpJavaRepackJars.value) {
if (!rpmBrpJavaRepackJars.value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. This is the actual bug fix. Thanks :)

@@ -81,7 +81,7 @@ object RpmPlugin extends AutoPlugin {
rpmConflicts := Seq.empty,
rpmSetarch := None,
rpmChangelogFile := None,
rpmBrpJavaRepackJars := false,
rpmBrpJavaRepackJars := true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Together with the fix this doesn't change the default behaviour, right?

I'm not building rpm's on a daily basis, so I'm not sure what impact this has. When we introduced
this it was because rpm:packageBin took a long time to extract and repack all the jar files, which
is IMHO wasted time. I would prefer false as a default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@muuki88 Right, I negated the default because this is basically the behavior people had without actually knowing it so far. The time impact is pretty major if you're doing daily builds. I was waiting for one of you guys to set the tone on this, i'll revert the default to false.

%{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
%{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{nil}
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
Copy link
Contributor

Choose a reason for hiding this comment

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

I found this bug entry. Did you try the line

%define __jar_repack 0

?

Copy link
Contributor Author

@YuvalItzchakov YuvalItzchakov Jan 19, 2017

Choose a reason for hiding this comment

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

Going to try it now, I saw:

%define __jar_repack %nil

Yesterday. Will try.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works :)

2. Changed the default of repack from true to false, which means repack will not run by default.
@@ -81,7 +81,7 @@ object RpmPlugin extends AutoPlugin {
rpmConflicts := Seq.empty,
rpmSetarch := None,
rpmChangelogFile := None,
rpmBrpJavaRepackJars := true,
rpmBrpJavaRepackJars := false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The documentation regarding jar repackaging is now going to be outdated (and generally it's pointing to a blog post that no longer exists). Where is the documentation maintained?

@muuki88 muuki88 merged commit e793228 into sbt:master Jan 25, 2017
@muuki88
Copy link
Contributor

muuki88 commented Jan 25, 2017

Sorry for the delay @YuvalItzchakov I'm still getting used the new review tools by Github :)
I missed your comments.

Changes look pretty good! Thanks for the effort :)

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.

brp-java-repack-jars still running despite setting rpmBrpJavaRepackJars to false
2 participants