Opened 3 years ago

Closed 21 months ago

#64271 closed defect (fixed)

Crystal lang port fails to build from source on Apple M1 based MacBook Pro running macOS Monterey v12.1

Reported by: raw-bin (Robin Randhawa) Owned by: mohd-akram (Mohamed Akram)
Priority: Normal Milestone:
Component: ports Version: 2.7.99
Keywords: arm64 monterey Cc:
Port: crystal

Description (last modified by jmroot (Joshua Root))

❯ sudo port install -s crystal
--->  Computing dependencies for crystal
--->  Fetching distfiles for crystal
--->  Verifying checksums for crystal
--->  Extracting crystal
--->  Applying patches to crystal
--->  Configuring crystal
--->  Building crystal
Error: Failed to build crystal: command execution failed
Error: See /opt/local/var/macports/logs/_opt_mports_macports-ports_lang_crystal/crystal/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port crystal failed

The incriminating portion of main.log (which itself is attached separately) shows:

:info:build make: Entering directory `/opt/local/var/macports/build/_opt_mports_macports-ports_lang_crystal/crystal/work/crystal-1.2.2'
:info:build /opt/local/bin/clang++-mp-13 -c -pipe -I/opt/local/libexec/openssl3/include -Os -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64  -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/opt/local/libexec/llvm-13/include -std=c++14 -stdlib=libc++  -fno-exceptions -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
:info:build CRYSTAL_CONFIG_BUILD_COMMIT="" CRYSTAL_CONFIG_PATH='$ORIGIN/../share/crystal/src' SOURCE_DATE_EPOCH="1636546449" CRYSTAL_CONFIG_LIBRARY_PATH=/opt/local/libexec/openssl3/lib:/opt/local/lib ./bin/crystal build --no-debug --release --link-flags="-L/opt/local/libexec/openssl3/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64"  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
:info:build ./bin/crystal: line 156: crystal: command not found
:info:build ld: warning: ignoring file _main.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
:info:build Undefined symbols for architecture arm64:
:info:build   "_main", referenced from:
:info:build      implicit entry/start for main executable
:info:build ld: symbol(s) not found for architecture arm64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build [31;1mError: [0m[1mexecution of command failed with code: 1: `cc "${@}" -o /opt/local/var/macports/build/_opt_mports_macports-ports_lang_crystal/crystal/work/.home/.cache/crystal/opt-local-var-macports-build-_opt_mports_macports-ports_lang_crystal-crystal-work-crystal-1.2.2-src-ecr-process.cr/macro_run -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64 -rdynamic -L/opt/local/var/macports/build/_opt_mports_macports-ports_lang_crystal/crystal/work/crystal-1.2.2-1/embedded/lib -lpcre -lgc -lpthread -L/opt/local/lib -levent -liconv -ldl`[0m
:info:build make: *** [.build/crystal] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_mports_macports-ports_lang_crystal/crystal/work/crystal-1.2.2'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_mports_macports-ports_lang_crystal/crystal/work/crystal-1.2.2" && /usr/bin/make -j8 -w all release=1 FLAGS=--no-debug CRYSTAL_CONFIG_LIBRARY_PATH=/opt/local/libexec/openssl3/lib:/opt/local/lib 
:info:build Exit code: 2
:error:build Failed to build crystal: command execution failed
:debug:build Error code: CHILDSTATUS 63171 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
❯ cd /opt/mports/macports-ports/
❯ git log --pretty=oneline | head -n 1
99f184be589c64d07500c88cee1afc342e03e8dc jc: update to 1.17.5

Attachments (1)

main.log (74.0 KB) - added by raw-bin (Robin Randhawa) 3 years ago.
main.log

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by raw-bin (Robin Randhawa)

Attachment: main.log added

main.log

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Description: modified (diff)
Keywords: arm64 monterey added; crystal m1 macOS Monterey removed
Owner: set to mohd-akram
Status: newassigned

comment:2 Changed 21 months ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

the current version of crystal builds on arm64 Monterey

https://build.macports.org/builders/ports-12_arm64-builder/builds/84339

and arm64 Ventura

https://build.macports.org/builders/ports-13_arm64-builder/builds/2259

% port -v installed crystal
The following ports are currently installed:
  crystal @1.7.2_0 (active) requested_variants='' platform='darwin 22' archs='arm64' date='2023-03-04T08:46:30-0800'
Note: See TracTickets for help on using tickets.