packages icon indicating copy to clipboard operation
packages copied to clipboard

nmap: bump to 7.94 release + PCRE2

Open Ansuel opened this issue 1 year ago • 28 comments

Maintainer: @nunojpg

Bump nmap to 7.94 release and drop upstreamed patch. Also backport patch for PCRE2.

Signed-off-by: Christian Marangi [email protected]


@BKPepe


Depends on https://github.com/openwrt/packages/pull/22722

Ansuel avatar Sep 27 '23 15:09 Ansuel

(test fails due to funny patch repository that have mixed line ending and other kind of stuff... a refresh doesn't seems to fix these warning)

Ansuel avatar Sep 27 '23 16:09 Ansuel

Yea, the patch is huge, I can not even review it on GItHub site, because:

126,500 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

haha. 😆

BKPepe avatar Sep 27 '23 16:09 BKPepe

Yep it's big... the only change i did to the original was comment a file delete (again line ending problem) but that is not used in compiling this package so it's just an additional zombie file in the build_dir.

Ansuel avatar Sep 27 '23 16:09 Ansuel

how was this patch generated. git-format-patch or github.com download?

neheb avatar Sep 27 '23 17:09 neheb

format-patch but I also verified that github .patch produce the same exact patch

Ansuel avatar Sep 27 '23 17:09 Ansuel

I assume the fix here is to use some combination of

-a
--text

    Treat all files as text.
--ignore-cr-at-eol

    Ignore carriage-return at the end of line when doing a comparison.
--ignore-space-at-eol

    Ignore changes in whitespace at EOL.
-b
--ignore-space-change

    Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.
-w
--ignore-all-space

    Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.

when generating. or maybe git's autocrlf is taking effect here.

neheb avatar Sep 27 '23 18:09 neheb

@neheb problem is that those are option to apply the patch not to generate one... not really in the mood to tweak how we apply patch and fix this

Ansuel avatar Sep 27 '23 18:09 Ansuel

one way to avoid this is to add a Build/Prepare and download the patch there instead of having it in a patch directory.

neheb avatar Sep 27 '23 18:09 neheb

one way to avoid this is to add a Build/Prepare and download the patch there instead of having it in a patch directory.

it's really just a big workaround to make the test happy... Is it worth it?

Ansuel avatar Sep 27 '23 18:09 Ansuel

Sure. It'll be gone next version anyway.

neheb avatar Sep 27 '23 18:09 neheb

So you want to bundle in packages git a 4MB blob? You know it will stay forever in git history?

nunojpg avatar Sep 27 '23 18:09 nunojpg

on that note, arch linux PKGBUILD files typically have routines to download and apply patches. See https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libimobiledevice/PKGBUILD#L17C1-L17C132 as an example. Maybe such a thing should be implemented here.

neheb avatar Sep 27 '23 18:09 neheb

Didn't notice it was a 4mb patch :/ well then... we have to wait for a new release... OR @BKPepe we can consider moving to using git source instead of release and target that commit... It's really a taste of choice. But I think the idea is to make everything possible to drop pcre right?

Ansuel avatar Sep 28 '23 14:09 Ansuel

we are not that "in hurry", what about waiting for next release?

1715173329 avatar Sep 29 '23 02:09 1715173329

I think we should split your PR into two ones.

  1. bump to 7.94 - no objections in this PR as I see, so it can be merged as it is.
  2. PCRE2 - okay, adding a large patch is no go. Thus only, what I am thinking is that we can change it to use the latest commit in the master branch. Even though, I don't like using commits in the master branch, because once you forget to update it, then you will be using it also in the stable branches, which means basically no support for upstream developers. However, in the meantime, we can let the OpenWrt community know and ask them for help to test nmap with PCRE2.

BKPepe avatar Oct 22 '23 21:10 BKPepe

@BKPepe should we target latest commit or only till the pcre2 merge?

Ansuel avatar Oct 22 '23 21:10 Ansuel

I would suggest only till pcre2 merge.

BKPepe avatar Oct 22 '23 22:10 BKPepe

@BKPepe well nmap is a very bad beast to tackle...

  • bump to 7.94 is not trivial... nmap-full fails to compile as they bumped lua requirement to lua 5.4 (and we have only lua and lua5.3...) (I can try to add support for lua5.4 but the shared library patch is not trivial)
  • we can introduce a patch that reverts to lua 5.3 but such patch is almost 1mb of size (with the revert 7.94 nmap-full seems to compile correctly) (patch require some part to be dropped so it's not totally 1:1)
  • first test with using commit for pcre2 are not so happy with using commit but it's late and I need to investigate it further

Anyway the lua problem is something we would have encountered anyway on bumping the package to a new nmap release that supported pcre2 by default...

Ansuel avatar Oct 23 '23 01:10 Ansuel

@BKPepe good news!

lau5.4 is a thing... with that in and using the commit that introduce pcre2 nmap compile correctly!

Ansuel avatar Oct 25 '23 03:10 Ansuel

@BKPepe this is ready... the formalities check fails because of lua5.4 not correctly detected as a good tag.

Ansuel avatar Oct 26 '23 22:10 Ansuel

Shouldn't you take Lua 5.4 into a separate PR?

nunojpg avatar Oct 26 '23 22:10 nunojpg

@nunojpg yep i can if required. Just lazy. @BKPepe any hint?

Ansuel avatar Oct 27 '23 19:10 Ansuel

I split the lua part of this pr to a separate pr

Ansuel avatar Nov 21 '23 14:11 Ansuel

Great! :) I will look at it hopefully this week.

BKPepe avatar Nov 22 '23 09:11 BKPepe

Changes:

1st FP:

  • removed leftovers from resolving merge conflict in the 1st commit (the 1st commit have <<HEAD, etc., the 2nd commit removed it), now it is as it should be
  • added nmap update to version 7.95, released a few days ago 2nd FP:
  • rebased on top of the master branch

BKPepe avatar Apr 27 '24 10:04 BKPepe

@BKPepe i think we can just drop the intermediate commit?

Ansuel avatar Apr 27 '24 11:04 Ansuel

We can keep it. Its up to you. :) I dont see why it should not be there.

I will refresh the patch shortly

BKPepe avatar Apr 27 '24 11:04 BKPepe

@BKPepe eh it does keep track of when pcre2 support was introduced... lets keep it.

Ansuel avatar Apr 27 '24 11:04 Ansuel

It seems 7.95 have something wrong... will repro it locally.

Ansuel avatar Apr 28 '24 09:04 Ansuel

@BKPepe fixed :D Patch submitted upstream so it will eventually be dropped...

Ansuel avatar Apr 28 '24 10:04 Ansuel