Hi,
I noticed an accidental regression in one of the patches included in
the lang/crystal port (which I am a maintainer of).
Notably, the current erroneous patch tells the crystal compiler to
inject an -L/usr/local/llvm19/lib to link with. This is incorrect in my
eyes as this port does not depend on this version of llvm, but rather
llvm22. So, in some situations, llvm19 may not be on an end-user's
system making this added linker flag bogus practically.
So, I adjust that linker path to used in the patch to llvm22,
bumping revision of the port as well.
I tested briefly with compiling a few smaller crystal programs, as well
as the interactive web playground ui provided by the crystal compiler's
"play" option. I am aware that the tests currently fail due to resource
limit issues. I'll investigate that further later down the line, but I
don't see it as important as fixing this linker regression.
I also confirmed that exfetch, the only current consumer of this
compiler compiles, runs and tests fine with this adjusted crystal
compiler patch on my end.
Thanks for your time and energy in reviewing this. I hope you all have
a wonderful Tuesday.
(FYI: in the near-ish future, I *do* plan submitting an updated crystal
port for -current as well as ports for some of the more popular crystal
ecosystem tools such as the ameba linter and the lattice lsp. However,
I want to focus on making sure the lang/crystal port is as optimal as
possible first.)
--
iz (she/her)
> I say mundane things
> so the uninteresting
> just might get noticed.
izder456 (dot) neocities (dot) org
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/crystal/Makefile,v
diff -u -p -u -p -r1.33 Makefile
--- Makefile 20 Sep 2026 00:00:45 -0000 1.33
+++ Makefile 17 Nov 2026 02:52:10 -0000
@@ -10,6 +10,7 @@ V_MOLINILLO = 0.2.2
DIST_TUPLE = github crystal-lang crystal ${V} . \
github crystal-lang shards v${V_SHARDS} shards-${V_SHARDS} \
github crystal-lang crystal-molinillo v${V_MOLINILLO} shards-${V_SHARDS}/lib/molinillo
+REVISION = 0
COMMENT = statically typed object oriented language
DISTNAME = crystal-${V}
Index: patches/patch-src_compiler_crystal_compiler_cr
===================================================================
RCS file: /cvs/ports/lang/crystal/patches/patch-src_compiler_crystal_compiler_cr,v
diff -u -p -u -p -r1.10 patch-src_compiler_crystal_compiler_cr
--- patches/patch-src_compiler_crystal_compiler_cr 20 Sep 2026 00:00:45 -0000 1.10
+++ patches/patch-src_compiler_crystal_compiler_cr 17 Nov 2026 02:52:10 -0000
@@ -1,4 +1,3 @@
-
# This patch must also be applied to the source tree on the cross-compiling
# host when building crystal.o
Index: src/compiler/crystal/compiler.cr
@@ -9,7 +8,7 @@ Index: src/compiler/crystal/compiler.cr
link_flags = use_modern_linker(link_flags)
+ if program.has_flag?("openbsd")
-+ link_flags += " -L/usr/local/llvm19/lib"
++ link_flags += " -L/usr/local/llvm22/lib"
+ end
+
{DEFAULT_LINKER, %(#{DEFAULT_LINKER} "${@}" -o #{Process.quote_posix(output_filename)} #{link_flags} #{program.lib_flags(@cross_compile)}), object_names}