Page MenuHomeFreeBSD

lang/janet: Update to 1.42.0
ClosedPublic

Authored by dave_freedave.net on Thu, Sep 3, 3:07 PM.
Tags
None
Referenced Files
F171047310: D59342.diff
Tue, Sep 8, 9:35 AM
F171024077: D59342.id185829.diff
Tue, Sep 8, 6:22 AM
F171018067: D59342.id185704.diff
Tue, Sep 8, 5:30 AM
F170986167: D59342.diff
Tue, Sep 8, 12:49 AM
F170926186: D59342.diff
Mon, Sep 7, 3:53 PM
Unknown Object (File)
Sun, Sep 6, 7:29 PM
Unknown Object (File)
Sun, Sep 6, 12:20 PM
Unknown Object (File)
Sun, Sep 6, 10:35 AM
Subscribers
None

Details

Summary

I noticed on Janet zulip that they added filewatch via kqueue(2) to janet when creating this version.

I thought (but was wrong) that we had inotify(2) on all supported FreeBSD versions but that wont be true until next year. Anyway you get better file watch support for all the reasons given here.

But that requires patching here instead of upstream. sigh.

Test Plan

Manually run testport with -i and check that for stable/14 it does not have inotify_init1 symbol and that it does have it for stable/15:

poudriere testport -j FreeBSD14 -p local -i lang/janet
nm /wrkdirs/usr/ports/lang/janet/work/janet-1.42.0/_build/libjanet.so | grep inotify_init1
poudriere testport -j FreeBSD14 -p local -i lang/janet
nm /wrkdirs/usr/ports/lang/janet/work/janet-1.42.0/_build/libjanet.so | grep inotify_init1
                 U inotify_init1

logs for stable/14:

logs for stable/15:

And of course make test passes for both.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dave_freedave.net created this revision.
dave_freedave.net edited the test plan for this revision. (Show Details)

have to use bsd.port.pre.mk and bsd.port.post.mk or it doesn't have INOTIFY_PORT set.

have to use bsd.port.pre.mk and bsd.port.post.mk or it doesn't have INOTIFY_PORT set.

Yeah, variables in bsd.port.mk works OOTB because they're present on the initial evaluation pass. The USES macros are included programmatically, so something from b.p.m needs a chance to run first. In general, if a variable comes from a USES macro, you need bsd.port.pre.mk (or, interestingly, bsd.port.options.mk) before reading it.

lang/janet/Makefile
24

Stylistically, when a target exists in both branches of a conditional, we generally prefer to have a single target with the conditional on the inside:

post-patch:
.if
.else
.endif

rather than:

.if
post-patch:
.else
post-patch:
.endif
lang/janet/files/patch-src_core_filewatch.c
16

This is a pretty cool approach. Just wanted to get that on the record.

fixed Makefile as suggested to have one target post-patch with .if/.else/.endif in the target body.

I can't believe I spent my life with makefiles that didn't have all this... so I still instinctively do things the hard way 😦

dave_freedave.net added inline comments.
lang/janet/files/patch-src_core_filewatch.c
16

This is a pretty cool approach. Just wanted to get that on the record.

This is almost identical, just with % variables, to what I proposed for upstream. I was just a few months too early but it seems like Janet will take this when 14.4 hits EOL.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Sep 8, 12:54 AM
This revision was automatically updated to reflect the committed changes.