Skip to content

Comments

sysutils/chericat: bump the version#169

Open
psjm3 wants to merge 2 commits intomainfrom
chericat-update-20240724
Open

sysutils/chericat: bump the version#169
psjm3 wants to merge 2 commits intomainfrom
chericat-update-20240724

Conversation

@psjm3
Copy link

@psjm3 psjm3 commented Jul 24, 2024

Update the version to the latest (2024-07-17) commit.

Copy link
Member

@kwitaszczyk kwitaszczyk left a comment

Choose a reason for hiding this comment

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

chericat fails to compile with this change:

===>  Patching for chericat-0.0.d20240717
===>  Applying FreeBSD patches for chericat-0.0.d20240717 from /zdata/repos/cheribsd-ports/chericat-update-20240724/sysutils/chericat/files
1 out of 1 hunks failed--saving rejects to Makefile.rej
===>  FAILED Applying FreeBSD patch-Makefile
===> FAILED to apply cleanly FreeBSD patch(es)  patch-Makefile
*** Error code 1

We should remove files/patch-Makefile and apply 9081151 directly in the chericat project.

…e need to generate a new patch. Also ABI check has been renamed to MACHINE_ABI
@psjm3
Copy link
Author

psjm3 commented Oct 31, 2024

The patch is needed because the cheribsd-ports build infrastructure already includes the standard include and lib in CFLAGS and LDFLAGS, but outside of the build framework we do need to explicitly add them in the makefile.

So I have generated a new patch based on the version used here.

@kwitaszczyk
Copy link
Member

kwitaszczyk commented Oct 31, 2024

The patch is needed because the cheribsd-ports build infrastructure already includes the standard include and lib in CFLAGS and LDFLAGS, but outside of the build framework we do need to explicitly add them in the makefile.

So I have generated a new patch based on the version used here.

Yes, we should not get rid of this patch. My suggestion was to keep the change but make it directly in chericat rather than maintain this patch in CheriBSD ports. Can we move it there?

Additionally, with the patch in ports, anytime someone forks your chericat repository on CheriBSD, they would have to apply the patch themselves.

@kwitaszczyk
Copy link
Member

We've had an offline discussion that the chericat repository with the patch wouldn't build. That's because the ports build system automatically adds /usr/local directories whilst the chericat's Makefile must explicitly define them.

I would suggest two things:

  1. Reimplement the Makefile file of chericat to make use of the FreeBSD's build system and include the bsd.prog.mk file. You can find examples of it in the CheriBSD repository (e.g., usr.bin/dc) and bsd.prog.mk's variables are described in share/mk/bsd.README. Note that bsd.prog.mk does not automatically add /usr/local paths to CFLAGS/LDFLAGS. This will greatly simplify your file as you don't have to define targets for each source file.
  2. Extend the Makefile to define the PREFIX make variable that is set to /usr/local by default but can be overwritten by the ports build system. bsnmp-ucd (net-mgmt/bsnmp-ucd in ports) includes an example of that. With the PREFIX variable, you can set LIBDIR to ${PREFIX}/lib and extend CFLAGS as necessary.

@psjm3
Copy link
Author

psjm3 commented Mar 19, 2025

The makefile has been updated in CTSRD-CHERI/chericat#49

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.

2 participants