Bug 268485

Summary: sysutils/topgrade: Update to 10.2.4
Product: Ports & Packages Reporter: freebsd
Component: Individual Port(s)Assignee: Nuno Teixeira <eduardo>
Status: Closed FIXED    
Severity: Affects Many People CC: eduardo
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/topgrade-rs/topgrade/compare/v10.0.1...v10.2.4
Attachments:
Description Flags
patch.diff
none
patch manpage creation none

Description freebsd 2022-12-20 12:24:48 UTC
Created attachment 238942 [details]
patch.diff

Update Topgrade-RS to 10.2.4

Patch file attached as patch.diff
Comment 1 Nuno Teixeira freebsd_committer freebsd_triage 2022-12-21 10:49:16 UTC
Hello,

According to https://github.com/topgrade-rs/topgrade/commit/f6ec6c76dbbe46681dfd0231682152094b76215c , manpage can be generated and installed.

Removal of # sys-info-0.9.1 crate fix: https://github.com/FillZpp/sys-info-rs/issues/80 , is it fixed upstream?
Comment 2 freebsd 2022-12-22 09:41:31 UTC
(In reply to Nuno Teixeira from comment #1)
Hi Nuno,

regarding the manpage:

Thank you very much for this hint. I didn't got this before.
I really thought they are gone ;-).

What is the best way to get the manpage generated with the Port Makefile ?

Would that OK ?:

post-install:
                ${PORTNAME} --gen-manpage > /usr/local/man/man8/topgrade.8


Regarding the sys-info-rs issue on amd64 i have to test.
The port patch was done on freebsd aarch64 machine.

Thanks in advice.

Best
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2022-12-22 09:59:59 UTC
(In reply to freebsd from comment #2)

For go ports, e.g., sysutils/kopia:
---
post-build:
        ${GO_WRKDIR_BIN}/${PORTNAME} --log-dir="" --help-man > ${WRKSRC}/${PORTNAME}.1

post-install:
        ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${PREFIX}/share/man/man1
---

We need to check what best option for rust/cargo ports because there is no GO_WRKDIR_BIN equivalent for rust.

Could you try:
---
post-install:
        ${PORTNAME} --gen-manpage > ${WRKSRC}/${PORTNAME}.8
        ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${PREFIX}/share/man/man8
---

I can't remember where rust binaries are built before they go to stage (usr/local/bin).

Tomorrow I will have time to test it.

Related to sys-info-rs fix, it is for 32 bit archs. Thats why I've asked if it is fixed upstream.

Cheers
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2022-12-22 11:23:39 UTC
(In reply to Nuno Teixeira from comment #3)
(...)

---
post-install:
        ${STAGEDIR}${PREFIX}/bin/${PORTNAME} --gen-manpage > ${WRKSRC}/${PORTNAME}.8
        ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${PREFIX}/share/man/man8
---

Should work for sure and respecting the use of ${INSTALL_MAN}.
Comment 5 freebsd 2022-12-22 11:23:52 UTC
Created attachment 238972 [details]
patch manpage creation
Comment 6 freebsd 2022-12-22 11:24:36 UTC
(In reply to Nuno Teixeira from comment #4)

Added the patch2.diff for generate and install manpage (tested)
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2022-12-22 11:49:18 UTC
- sys-info 32 bit arch crate fix removed since upstream stop using it

- CARGO_CONFIGURE= no, why should it be set to no? It builds fine with default "yes". Any particular reason?
Comment 8 freebsd 2022-12-22 12:38:52 UTC
(In reply to Nuno Teixeira from comment #7)(In reply to Nuno Teixeira from comment #7)

With "CARGO_CONFIGURE= yes" the make process failed always with:

===>  Configuring for topgrade-10.2.4
<stdin>:1:10: fatal error: 'sys/syscall.h' file not found
#include <sys/syscall.h>
         ^~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/topgrade
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/topgrade

Not sure how to fix that.

And for building the app, the cargo configure seems not to be required.
Comment 9 Nuno Teixeira freebsd_committer freebsd_triage 2022-12-22 17:49:32 UTC
(In reply to freebsd from comment #8)

---
===>   topgrade-10.2.4 depends on package: rust>=1.66.0 - found
===>  Configuring for topgrade-10.2.4
===>   Cargo config:
[source.cargo]
directory = '/wrkdirs/usr/ports/sysutils/topgrade/work/topgrade-10.2.4/cargo-crates'
[source.crates-io]
replace-with = 'cargo'
===>   Updating Cargo.lock
===========================================================================
=======================<phase: build          >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=nobody UID=65534 GID=65534
===>  Building for topgrade-10.2.4
   Compiling libc v0.2.138
   Compiling proc-macro2 v1.0.47
(...)
---

Tested on poudriere 140amd64 (1400074), 131amd64, 123{amd64,i386} and local 140amd64 (1400074) with default CARGO_CONFIGURE.
Let's commit that way and see what build servers report, I suspect a local misconfig.
Also there's no ports using it set to 'no' at ports.
---
`rgrep CARGO_CONFIGURE Work/freebsd/ports/main/`
Work/freebsd/ports/main/Mk/Uses/cargo.mk:CARGO_CONFIGURE?=      yes
Work/freebsd/ports/main/Mk/Uses/cargo.mk:.  if ${CARGO_CONFIGURE:tl} == "yes"
Work/freebsd/ports/main/net-im/py-matrix-synapse/Makefile:CARGO_CONFIGURE=      yes
---

Also manpage moved to "1.   FreeBSD General Commands Manual" section as manpage sugests.
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-12-22 17:51:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2f3dd0de30fcef7264ffbbe99fff84da824dc626

commit 2f3dd0de30fcef7264ffbbe99fff84da824dc626
Author:     FreeBSD <freebsd@scd-systems.net>
AuthorDate: 2022-12-22 17:30:47 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2022-12-22 17:49:24 +0000

    sysutils/topgrade: Update to 10.2.4

    - remove sys-info crate 32 bit arch fix since upstream not using it
      anymore
    - move manpage to section 1 as it sugests

    ChangeLog:
    https://github.com/topgrade-rs/topgrade/compare/v10.0.1...v10.2.4

    PR:             268485

 sysutils/topgrade/Makefile        |  19 +-
 sysutils/topgrade/Makefile.crates | 184 ++++++++++---------
 sysutils/topgrade/distinfo        | 370 +++++++++++++++++++++-----------------
 3 files changed, 317 insertions(+), 256 deletions(-)
Comment 11 Nuno Teixeira freebsd_committer freebsd_triage 2022-12-22 17:53:17 UTC
Committed, thanks!