Bug 265478 - databases/cassandra4: Update to 4.0.8
Summary: databases/cassandra4: Update to 4.0.8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Guido Falsi
URL: https://gitbox.apache.org/repos/asf?p...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-28 11:53 UTC by Angelo Polo
Modified: 2023-05-15 21:27 UTC (History)
4 users (show)

See Also:


Attachments
Update to version 4.0.5 (40.11 KB, application/mbox)
2022-07-28 11:53 UTC, Angelo Polo
no flags Details
Update to version 4.0.8 (36.33 KB, patch)
2023-05-08 09:36 UTC, Lapo Luchini
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Angelo Polo 2022-07-28 11:53:33 UTC
Created attachment 235525 [details]
Update to version 4.0.5

Update to version 4.0.5.

Git diff attached. Additional git commands:
git rm files/patch-doc_Makefile
git rm files/patch-doc_source___templates_indexcontent.html
git rm files/patch-doc_source___util_cql.py
git add files/patch-bin_cqlsh
git add files/patch-test_conf_cassandra-murmur.yaml
git add files/patch-test_conf_cassandra-seeds.yaml
git add files/patch-test_conf_unit-test-conf_test-native-port.yaml

The updated maven repo must be manually copied to distfiles for patch testing and uploaded to LOCAL as part of the commit process. It is available at the following link:
https://drive.google.com/file/d/12sW-bAXUmEQCYxuT3viNq5nT8X5_QBJU
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2022-08-01 17:25:18 UTC
(In reply to Angelo Polo from comment #0)
Thanks very much for the patch! While adding that maven repo file is of course fine and what we did for a long time, I'm thinking if it is possible for ports using maven repo can do something like yarn:

  https://cgit.freebsd.org/ports/tree/net-mgmt/chronograf/Makefile

or go-post-fetch for GO_MODULE:

  https://cgit.freebsd.org/ports/tree/Mk/Uses/go.mk

?
Comment 2 Angelo Polo 2022-08-08 18:05:43 UTC
No longer having to compile the maven repo beforehand would be nice, though recent improvements in the Cassandra build have made this less onerous than it used to be.

I've worked to copy the technique used by chronograf, and it basically works, except the distinfo checksums of the repo don't match for any two invocations even though using a diff tool on the expanded archives shows no differences. The work in progress is here:
https://github.com/polo-language/cassandra4/tree/mvn-pre-fetch
Maybe need to modify file timestamps or something before tarring the repository (already modifying text timestamps within the files).

If anyone has any ideas... otherwise maybe we could consider downloading the repo in fetch separately so that the update to 4.0.5 isn't held up indefinitely.
Comment 3 Lapo Luchini 2023-01-15 16:01:42 UTC
I have created a GitHub pull request to address the reproducibility of the repo archive. (achieves identical sha256 on different runs)

https://github.com/polo-language/cassandra4/pull/2
Comment 4 Angelo Polo 2023-01-20 17:59:07 UTC
(In reply to Lapo Luchini from comment #3)

Thanks Lapo. I tried to tested your solution but didn't get that far because I've run into the separate problem that in a poudriere build, ant doesn't seem to be available at fetch time.

This is different from the yarn example given in comment #1 because in that case, yarn is in FETCH_DEPENDS, whereas here we've got USE_ANT. Maybe ANT can also be included in FETCH_DEPENDS. This will require investigation.
Comment 5 Lapo Luchini 2023-01-28 13:23:30 UTC
I've set up `poudriere`, and this seems to work nicely:

FETCH_DEPENDS=	${LOCALBASE}/bin/ant:devel/apache-ant

(I inspired it to BUILD_DEPENDS from Mk/bsd.java.mk)
Comment 6 Lapo Luchini 2023-01-28 16:31:45 UTC
I've done further experiments here:

https://github.com/polo-language/cassandra4/pull/3

(also, attempting upgrade to 4.1)
Comment 7 Lapo Luchini 2023-04-16 10:46:39 UTC
This branch is now (mostly) working on poudriere using pre-fetch… we agreed with Angelo Polo to upgrade to 4.0.5 (4.0.8 actually) first and then try 4.1 later.

There is still one very strange error sometimes: pre-fetch creates the tar, then immediately after the just produced files doesn't get found and the build errors out. I don't know why that happens (and especially since that happens only sometimes).

This branch could be potentially committable (or near that phase):
https://github.com/polo-language/cassandra4/pull/2

If anyone has ideas regarding the sometimes-error, feel free to chime in. :)
Comment 8 Lapo Luchini 2023-05-08 09:36:16 UTC
Created attachment 242052 [details]
Update to version 4.0.8

Patch updated to 4.0.8 and tested as working on poudriere.
Comment 9 Angelo Polo 2023-05-09 19:44:41 UTC
Lapo's update looks good to me.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-05-15 21:26:41 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=678ef46e3abc2e8d6720bbb2eb60002294975cdf

commit 678ef46e3abc2e8d6720bbb2eb60002294975cdf
Author:     Lapo Luchini <lapo@lapo.it>
AuthorDate: 2023-05-15 21:23:57 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-05-15 21:23:57 +0000

    databases/cassandra4: Update to 4.0.8

    - Add pre-fetch target to download Maven dependencies to avoid
      network access during build

    PR:             265478
    Approved by:    Angelo Polo <language.devel@gmail.com> (maintainer)

 databases/cassandra4/Makefile                      |   52 +-
 databases/cassandra4/distinfo                      |   18 +-
 databases/cassandra4/files/cassandra.in            |    9 +-
 .../cassandra4/files/maven/build-owasp.xml (new)   |   86 +
 .../cassandra4/files/maven/build-rat.xml (new)     |  105 +
 .../files/maven/build-resolver.xml (new)           |  262 +++
 .../files/maven/build.properties.default (new)     |    4 +
 databases/cassandra4/files/maven/build.xml (new)   | 2174 ++++++++++++++++++++
 databases/cassandra4/files/patch-bin_cqlsh (new)   |   11 +
 databases/cassandra4/files/patch-build.xml         |  179 +-
 .../cassandra4/files/patch-conf_cassandra.yaml     |   19 +-
 .../cassandra4/files/patch-doc_Makefile (gone)     |   23 -
 ...doc_source___templates_indexcontent.html (gone) |   17 -
 .../files/patch-doc_source___util_cql.py (gone)    |   10 -
 ...rc_java_org_apache_cassandra_config_Config.java |    4 +-
 ...e_cassandra_service_NativeTransportService.java |    4 +-
 ...org_apache_cassandra_service_StartupChecks.java |    2 +-
 ..._apache_cassandra_utils_FastByteOperations.java |   24 +-
 .../patch-test_conf_cassandra-murmur.yaml (new)    |   10 +
 .../patch-test_conf_cassandra-seeds.yaml (new)     |   10 +
 ...conf_unit-test-conf_test-native-port.yaml (new) |   10 +
 databases/cassandra4/pkg-plist                     |  114 +-
 22 files changed, 2840 insertions(+), 307 deletions(-)
Comment 11 Guido Falsi freebsd_committer freebsd_triage 2023-05-15 21:27:45 UTC
Patch committed. Thanks!