Cross-build crystal compiler but without build libgc.a? (but lib/crystal/libgc.a exists in offical released tarball)

The only downside I detected with this approach is that setting up CC before crystal build

Yes, i consider set CC before crystal build is inappropriate.

If it is really for convenience, write a crystal wrapper is more easier. in fact, I have cr -> crystal locally, it is a bash script, will run crystal as need. i can do whatever transform before run actually run others.

e.g. i can use zig cc like this: (just for describe my idea)

#!/usr/bin/env sh

#  ...

if [ "$1" == "build" ]; then
   crystal build "$@"

  1. do some check to extract the target part, e.g. `x86_64-linux-musl`, we use it later.
   2. Save the CC link code of the crystal output, we use it later
   3. Replace necessary parts
   3. Join those output to compose the `zig cc` link out, then run(eval) it

 eval "zig cc -target x86_64-linux-musl ......"
fi

This method should be feasible, and, it does not affect the crystal build stage.


you only updated Linux packages (Alpine) and not the macOS/Homebrew counterparts, so now the versions are different.

I found that rake fetch:all works even without upgrading the macOS part. in fact, i am unfamiliar with the mac ecosystem, i have no idea of where the sha256 come from.

 ╰─ $ https -F '://ghcr.io/v2/homebrew/core/bdw-gc/blobs/sha256:a55727cc7d7a7dbc8f7e61aca70a94dc07dcaccbfbffc5f92fcdc77dec64eaa7' Authorization:"Bearer QQ==" Accept-Encoding:identity
HTTP/2.0 200 OK
accept-ranges: bytes
age: 0
content-disposition: 
content-length: 525669
content-type: application/octet-stream
date: Sat, 20 Jan 2024 14:11:54 GMT
etag: "0x8DA886C3B14CF6B"
last-modified: Sat, 27 Aug 2022 20:39:25 GMT
server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
via: 1.1 varnish, 1.1 varnish
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-fastly-request-id: dfa80be87bb08d2bb9d89113100d3100378daec7
x-ms-blob-type: BlockBlob
x-ms-copy-completion-time: Sat, 27 Aug 2022 20:39:25 GMT
x-ms-copy-id: 1efaa11e-e0c5-4fba-9470-0d97405bc328
x-ms-copy-progress: 525669/525669
x-ms-copy-status: success
x-ms-creation-time: Sat, 27 Aug 2022 20:39:25 GMT
x-ms-lease-state: available
x-ms-lease-status: unlocked
x-ms-request-id: 1692cc23-b01e-006b-06aa-4b6aad000000
x-ms-server-encrypted: true
x-ms-version: 2019-12-12
x-served-by: cache-iad-kiad7000111-IAD, cache-itm18829-ITM

+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+

I don’t think these are issues.

The purpose of add crystal guides:

  1. Told all Crystalist, use zig do like this is possible, this is the most important part.
  2. Solve those concern is the the user’s own responsibility.

We don’t need to handle everything for users, user can write wrapper like me for convert default cc to zig cc, or, as I suggested, the compiler directly outputs a zig cc without any side effects.

For how to manager static libraries, each user has his own ideas.