Skip to content

how to go from bootstrap (1.5.1) to 1.15.1 #15633

Closed
@dch

Description

@dch

Bug Report

This is about building latest crystal on FreeBSD, in
the ports & binary pkg system. I'm one of the ports
committers, making this work for all users of FreeBSD.

  • FreeBSD builds everything from sources "because"
  • ✅ thus we need to bootstrap from LLVM14 -> Crystal 1.5.1
  • ✅ then we can build successfully LLVM16 -> Crystal 1.10.1
  • ✅ then we can build successfully LLVM20 -> Crystal 1.15.1

But skipping the intermediary Crystal 1.10.1 fails, i.e.
🤯 trying to go directly from bootstrap -> LLVM20 -> Crystal 1.15.1 fails:

===>  Building for crystal-1.15.1
Using /usr/local/bin/llvm-config19 [version=19.1.7]
CRYSTAL_CONFIG_BUILD_COMMIT="84f389ac5424" CRYSTAL_CONFIG_PATH=lib:/usr/local/lib/crystal SOURCE_DATE_EPOCH="1738627200"  CRYSTAL_CONFIG_LIBRARY_PATH='$ORIGIN/../lib/crystal' ./bin/crystal build --progress --stats --threads 16 --release --no-debug -D strict_multi_assign -D preview_overload_order --link-flags="  -fstack-protector-strong "  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib -D use_pcre2
Using compiled compiler at .build/crystal
Parse:                             00:00:00.000026540 (   1.08MB)
Semantic (top level):              00:00:00.457428870 ( 186.13MB)
Semantic (new):                    00:00:00.002755877 ( 186.13MB)
Semantic (type declarations):      00:00:00.054514598 ( 194.13MB)
Semantic (abstract def check):     00:00:00.018375190 ( 218.13MB)
Semantic (restrictions augmenter): 00:00:00.020660960 ( 218.13MB)
Showing last frame. Use --error-trace for full trace.

There was a problem expanding macro 'macro_35976034720'

Code in src/gc/boehm.cr:428:3

 428 | {% if flag?(:preview_mt) %}
       ^
Called macro defined in src/gc/boehm.cr:428:3

 428 | {% if flag?(:preview_mt) %}

Which expanded to:

 > 2 | # support for legacy gc releases
 > 3 | def self.set_stackbottom(stack_bottom : Void*)
 > 4 |   LibGC.stackbottom = stack_bottom
               ^----------
Error: undefined fun 'stackbottom=' for LibGC

From my perspective its better to only need 1 bootstrap step rather than 2.

Is the above bug fixable?

Or should I go the less satisfying but workable multi-stage bootstrap via Crystal 1.10.1?

thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugA bug in the code. Does not apply to documentation, specs, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions