Skip to content

Remove apache-ivy support for Pack200 compression, to fix FTBFS#15980

Open
ddstreet wants to merge 4 commits intomicrosoft:tomls/base/mainfrom
ddstreet:apache-ivy
Open

Remove apache-ivy support for Pack200 compression, to fix FTBFS#15980
ddstreet wants to merge 4 commits intomicrosoft:tomls/base/mainfrom
ddstreet:apache-ivy

Conversation

@ddstreet
Copy link
Contributor

This package FTBFS because java dropped Pack200 support. This backports a patch to make Pack200 support optional, as well as disabling that optional Pack200 support, so the package builds.

Note this package's upstream source tarball contains files in Windows (CRLF) format, which prevents git patches from cleanly applying; so this PR does more work than should be required simply to add two patch files.

@ddstreet
Copy link
Contributor Author

@reubeno please let me know if there's a better way I could do this with the tooling...it seems like a bit of a special case package that comes to us already doing stuff the wrong way (i.e. patch handling)

[[components.apache-ivy.overlays]]
description = "Add upstream patch file tag to make Pack200 support optional."
type = "spec-insert-tag"
tag = "Source4"
Copy link
Member

Choose a reason for hiding this comment

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

I see that the upstream spec already does some patching via SourceXXX files instead of PatchXXX files... but it also does use %autosetup.

Did you look into whether the new patches you're introducing could be applied as normal PatchXXX files? Or is the issue that they need to be applied after the others that are already being applied oddly?

(We do have a patch-add overlay, but I'm assuming you didn't go for it because the oddities you mention in the preexisting spec.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried patch-add first, but the problem is it'll then get applied by %autosetup, and the patch that git format-patch creates from the upstream source doesn't apply because of the source tarball's CRLF line endings; it fails with errors like:

checking file asciidoc/release-notes.adoc
Hunk #1 FAILED at 55 (different line endings).
1 out of 1 hunk FAILED
checking file ivy.xml
Hunk #1 FAILED at 32 (different line endings).
Hunk #2 FAILED at 46 (different line endings).
Hunk #3 FAILED at 55 (different line endings).
Hunk #4 FAILED at 67 (different line endings).

I did some brief tests to see if I could unix2dos the patch file but that didn't help, and this is such a rare situation (I've never seen this problem before) I didn't want to spend too much time trying to finesse the patch file into just the right line endings in the right places to apply. I assume the upstream packager came to the same conclusion.

@reubeno
Copy link
Member

reubeno commented Feb 25, 2026

@reubeno please let me know if there's a better way I could do this with the tooling...it seems like a bit of a special case package that comes to us already doing stuff the wrong way (i.e. patch handling)

Agreed -- it looks like the upstream spec was already complicated. About the only thing that comes to mind is that it might be easier to read/understand the .toml file if we formatted it like this one but I think that's a matter of taste and style. I'd defer to you on that.

One note -- spec-insert-tag was added while I was on vacation. It's a highly specialized tag that we generally may not want to use. We should review this some. spec-add-tag was the one intended for general usage, and it fails if it tries to add a tag that already exists. I think the new one was added due to issues with %if conditionals and other special cases.

I think the only other considerations I'd take from here (but not change this PR for) are:

  • It might be useful to have a source-add overlay (like the patch-add one) but the trickiness would be on how to figure out which auto-generated NNN (for SourceNNN) was used -- and that might make it not so useful.

@ddstreetmicrosoft
Copy link
Contributor

rebase on main, i'll address comments next

…onal

Package FTBFS with newer java because it no longer provides Pack200.
Patch context changes required in asciidoc/release-notes.adoc section.

This is intentionally added as a Source: instead of Patch: because
this package's source tarball contains files in Windows (CRLF) format,
which git patches won't cleanly apply to.

Backported-from: apache/ant-ivy@d772841
The previous patch reworked the code to make Pack200 optional, and
assumed the Pack200 support would come from
apache-commons-compress. However, our build of apache-commons-compress
specifically removes all support for Pack200. So we need to remove the
java file that attempts to use it.
The upstream tarball unfortunately has its source files in Windows
(CRLF) format, which breaks patching. The spec file already does
dos2unix conversion on one source file it was patching, this expands
that to patch all the source files we will patch with the previously
added patch.
Since this package doesn't work with standard-defined Patch: that are
applied with %autosetup, we need to add lines to manually apply the
patch files we previously added.
@ddstreet
Copy link
Contributor Author

@reubeno please let me know if there's a better way I could do this with the tooling...it seems like a bit of a special case package that comes to us already doing stuff the wrong way (i.e. patch handling)

Agreed -- it looks like the upstream spec was already complicated. About the only thing that comes to mind is that it might be easier to read/understand the .toml file if we formatted it like this one but I think that's a matter of taste and style. I'd defer to you on that.

ack, updated

One note -- spec-insert-tag was added while I was on vacation. It's a highly specialized tag that we generally may not want to use. We should review this some. spec-add-tag was the one intended for general usage, and it fails if it tries to add a tag that already exists. I think the new one was added due to issues with %if conditionals and other special cases.

ack, changed over to use spec-add-tag

I think the only other considerations I'd take from here (but not change this PR for) are:

  • It might be useful to have a source-add overlay (like the patch-add one) but the trickiness would be on how to figure out which auto-generated NNN (for SourceNNN) was used -- and that might make it not so useful.

yeah i think this would be a useful addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants