From 336b1cc68f9d9ff06a0aa0701d09a5db99663041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Fri, 10 May 2024 21:54:19 +0200 Subject: [PATCH 01/14] Update to `nixpkgs-24.05` --- shell.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell.nix b/shell.nix index 1d839dcf318f..6be2b3abfcc2 100644 --- a/shell.nix +++ b/shell.nix @@ -23,9 +23,9 @@ let nixpkgs = import (builtins.fetchTarball { - name = "nixpkgs-23.05"; - url = "https://github.com/NixOS/nixpkgs/archive/23.05.tar.gz"; - sha256 = "10wn0l08j9lgqcw8177nh2ljrnxdrpri7bp0g7nvrsn9rkawvlbf"; + name = "nixpkgs-24.05"; + url = "https://github.com/NixOS/nixpkgs/archive/24.05.tar.gz"; + sha256 = "1lr1h35prqkd1mkmzriwlpvxcb34kmhc9dnr48gkm8hh089hifmx"; }) { inherit system; }; From 70d8f90343042bf406f158be729030ac72914590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Sat, 1 Jun 2024 13:38:50 +0200 Subject: [PATCH 02/14] Update LLVM 18 --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 6be2b3abfcc2..74cd6546b8b4 100644 --- a/shell.nix +++ b/shell.nix @@ -19,7 +19,7 @@ # $ nix-shell --pure --arg musl true # -{llvm ? 11, musl ? false, system ? builtins.currentSystem}: +{llvm ? 18, musl ? false, system ? builtins.currentSystem}: let nixpkgs = import (builtins.fetchTarball { From dd8d8fee1775463fd2bd90d706f4af9a7e5045c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 16:56:07 +0100 Subject: [PATCH 03/14] Use `libiconvReal` on macOS --- .github/workflows/macos.yml | 4 ++-- shell.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8ae3ac28209e..663db2f8bb2d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -44,7 +44,7 @@ jobs: run: bin/ci prepare_build - name: Test - run: bin/ci build + run: CRYSTAL_OPTS=-Duse_libiconv bin/ci build - name: Test interpreter - run: bin/ci with_build_env 'make interpreter_spec' + run: bin/ci with_build_env 'CRYSTAL_OPTS=-Duse_libiconv make interpreter_spec' diff --git a/shell.nix b/shell.nix index 9aacbed2575b..3ec40838e3b0 100644 --- a/shell.nix +++ b/shell.nix @@ -74,7 +74,7 @@ let stdLibDeps = with pkgs; [ boehmgc gmp libevent libiconv libxml2 libyaml openssl pcre2 zlib - ] ++ lib.optionals stdenv.isDarwin [ libiconv ]; + ] ++ lib.optionals stdenv.isDarwin [ libiconvReal ]; tools = [ pkgs.hostname pkgs.git llvmPackages.bintools ] ++ pkgs.lib.optional (!llvmPackages.lldb.meta.broken) llvmPackages.lldb; in From b522e374787250c46e76dc0c4fbf758ebccc4282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 17:27:32 +0100 Subject: [PATCH 04/14] Forward `CRYSTAL_OPTS` in `bin/ci` --- bin/ci | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/ci b/bin/ci index 03d8a20a19e4..0ff5d4df5b1d 100755 --- a/bin/ci +++ b/bin/ci @@ -213,6 +213,7 @@ with_build_env() { -e CRYSTAL_CACHE_DIR="/tmp/crystal" \ -e SPEC_SPLIT_DOTS \ -e USE_PCRE1 \ + -e CRYSTAL_OPTS \ "$DOCKER_TEST_IMAGE" \ "$ARCH_CMD" /bin/sh -c "'$command'" From f968d33bd0db393663be010440bae187c09180b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 19:11:08 +0100 Subject: [PATCH 05/14] fixup --- bin/ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ci b/bin/ci index 0ff5d4df5b1d..adbf33a0c5c3 100755 --- a/bin/ci +++ b/bin/ci @@ -223,7 +223,7 @@ with_build_env() { CRYSTAL_CACHE_DIR="/tmp/crystal" \ /bin/sh -c "'$command'" - on_nix_shell nix-shell --pure $CI_NIX_SHELL_ARGS --run "'TZ=$TZ $command'" + on_nix_shell nix-shell --pure $CI_NIX_SHELL_ARGS --keep CRYSTAL_OPTS --run "'TZ=$TZ $command'" on_github echo "::endgroup::" } From cc0af4d6a11f16e0f9377a35f6a6f4a0aefea6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 20:12:41 +0100 Subject: [PATCH 06/14] Revert "fixup" This reverts commit f968d33bd0db393663be010440bae187c09180b5. --- bin/ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ci b/bin/ci index adbf33a0c5c3..0ff5d4df5b1d 100755 --- a/bin/ci +++ b/bin/ci @@ -223,7 +223,7 @@ with_build_env() { CRYSTAL_CACHE_DIR="/tmp/crystal" \ /bin/sh -c "'$command'" - on_nix_shell nix-shell --pure $CI_NIX_SHELL_ARGS --keep CRYSTAL_OPTS --run "'TZ=$TZ $command'" + on_nix_shell nix-shell --pure $CI_NIX_SHELL_ARGS --run "'TZ=$TZ $command'" on_github echo "::endgroup::" } From 76d453a6a43e1180c2287e9676808fb89db84fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 20:13:19 +0100 Subject: [PATCH 07/14] Revert "Forward `CRYSTAL_OPTS` in `bin/ci`" This reverts commit b522e374787250c46e76dc0c4fbf758ebccc4282. --- bin/ci | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/ci b/bin/ci index 0ff5d4df5b1d..03d8a20a19e4 100755 --- a/bin/ci +++ b/bin/ci @@ -213,7 +213,6 @@ with_build_env() { -e CRYSTAL_CACHE_DIR="/tmp/crystal" \ -e SPEC_SPLIT_DOTS \ -e USE_PCRE1 \ - -e CRYSTAL_OPTS \ "$DOCKER_TEST_IMAGE" \ "$ARCH_CMD" /bin/sh -c "'$command'" From d2d37a311ebf6d65491667e8637ba8f4e922b02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 20:13:21 +0100 Subject: [PATCH 08/14] Revert "Use `libiconvReal` on macOS" This reverts commit dd8d8fee1775463fd2bd90d706f4af9a7e5045c7. --- .github/workflows/macos.yml | 4 ++-- shell.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 663db2f8bb2d..8ae3ac28209e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -44,7 +44,7 @@ jobs: run: bin/ci prepare_build - name: Test - run: CRYSTAL_OPTS=-Duse_libiconv bin/ci build + run: bin/ci build - name: Test interpreter - run: bin/ci with_build_env 'CRYSTAL_OPTS=-Duse_libiconv make interpreter_spec' + run: bin/ci with_build_env 'make interpreter_spec' diff --git a/shell.nix b/shell.nix index 3ec40838e3b0..9aacbed2575b 100644 --- a/shell.nix +++ b/shell.nix @@ -74,7 +74,7 @@ let stdLibDeps = with pkgs; [ boehmgc gmp libevent libiconv libxml2 libyaml openssl pcre2 zlib - ] ++ lib.optionals stdenv.isDarwin [ libiconvReal ]; + ] ++ lib.optionals stdenv.isDarwin [ libiconv ]; tools = [ pkgs.hostname pkgs.git llvmPackages.bintools ] ++ pkgs.lib.optional (!llvmPackages.lldb.meta.broken) llvmPackages.lldb; in From 132a6e76cd96866c507a866e4948555a654c30b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 20:13:52 +0100 Subject: [PATCH 09/14] Fix string encoding specs for darwin --- spec/std/string_spec.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/std/string_spec.cr b/spec/std/string_spec.cr index 6d7487ded0e2..7b93233e2f30 100644 --- a/spec/std/string_spec.cr +++ b/spec/std/string_spec.cr @@ -2830,7 +2830,7 @@ describe "String" do bytes.to_a.should eq([72, 0, 101, 0, 108, 0, 108, 0, 111, 0]) end - {% unless flag?(:musl) || flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) %} + {% unless flag?(:musl) || flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) || (flag?(:darwin) && !flag?(:use_libiconv)) %} it "flushes the shift state (#11992)" do "\u{00CA}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x66]) "\u{00CA}\u{0304}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x62]) @@ -2839,7 +2839,7 @@ describe "String" do # FreeBSD iconv encoder expects ISO/IEC 10646 compatibility code points, # see https://www.ccli.gov.hk/doc/e_hkscs_2008.pdf for details. - {% if flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) %} + {% if flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) || (flag?(:darwin) && !flag?(:use_libiconv)) %} it "flushes the shift state (#11992)" do "\u{F329}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x66]) "\u{F325}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x62]) @@ -2883,7 +2883,7 @@ describe "String" do String.new(bytes, "UTF-16LE").should eq("Hello") end - {% unless flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) %} + {% unless flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) || (flag?(:darwin) && !flag?(:use_libiconv)) %} it "decodes with shift state" do String.new(Bytes[0x88, 0x66], "BIG5-HKSCS").should eq("\u{00CA}") String.new(Bytes[0x88, 0x62], "BIG5-HKSCS").should eq("\u{00CA}\u{0304}") From 130928b03df608e7bb832fcc8091cea8eacbee68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 21:53:38 +0100 Subject: [PATCH 10/14] Revert "Fix string encoding specs for darwin" This reverts commit 132a6e76cd96866c507a866e4948555a654c30b1. --- spec/std/string_spec.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/std/string_spec.cr b/spec/std/string_spec.cr index 7b93233e2f30..6d7487ded0e2 100644 --- a/spec/std/string_spec.cr +++ b/spec/std/string_spec.cr @@ -2830,7 +2830,7 @@ describe "String" do bytes.to_a.should eq([72, 0, 101, 0, 108, 0, 108, 0, 111, 0]) end - {% unless flag?(:musl) || flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) || (flag?(:darwin) && !flag?(:use_libiconv)) %} + {% unless flag?(:musl) || flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) %} it "flushes the shift state (#11992)" do "\u{00CA}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x66]) "\u{00CA}\u{0304}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x62]) @@ -2839,7 +2839,7 @@ describe "String" do # FreeBSD iconv encoder expects ISO/IEC 10646 compatibility code points, # see https://www.ccli.gov.hk/doc/e_hkscs_2008.pdf for details. - {% if flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) || (flag?(:darwin) && !flag?(:use_libiconv)) %} + {% if flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) %} it "flushes the shift state (#11992)" do "\u{F329}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x66]) "\u{F325}".encode("BIG5-HKSCS").should eq(Bytes[0x88, 0x62]) @@ -2883,7 +2883,7 @@ describe "String" do String.new(bytes, "UTF-16LE").should eq("Hello") end - {% unless flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) || (flag?(:darwin) && !flag?(:use_libiconv)) %} + {% unless flag?(:solaris) || flag?(:freebsd) || flag?(:dragonfly) || flag?(:netbsd) %} it "decodes with shift state" do String.new(Bytes[0x88, 0x66], "BIG5-HKSCS").should eq("\u{00CA}") String.new(Bytes[0x88, 0x62], "BIG5-HKSCS").should eq("\u{00CA}\u{0304}") From d6d6f88f44253e2a8b9a09d8d7211dac1c309a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 17:27:32 +0100 Subject: [PATCH 11/14] Forward `CRYSTAL_OPTS` in `bin/ci` --- bin/ci | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ci b/bin/ci index 03d8a20a19e4..adbf33a0c5c3 100755 --- a/bin/ci +++ b/bin/ci @@ -213,6 +213,7 @@ with_build_env() { -e CRYSTAL_CACHE_DIR="/tmp/crystal" \ -e SPEC_SPLIT_DOTS \ -e USE_PCRE1 \ + -e CRYSTAL_OPTS \ "$DOCKER_TEST_IMAGE" \ "$ARCH_CMD" /bin/sh -c "'$command'" @@ -222,7 +223,7 @@ with_build_env() { CRYSTAL_CACHE_DIR="/tmp/crystal" \ /bin/sh -c "'$command'" - on_nix_shell nix-shell --pure $CI_NIX_SHELL_ARGS --run "'TZ=$TZ $command'" + on_nix_shell nix-shell --pure $CI_NIX_SHELL_ARGS --keep CRYSTAL_OPTS --run "'TZ=$TZ $command'" on_github echo "::endgroup::" } From 260d286d66decd958027dae53ea791b934b1bf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 21:54:07 +0100 Subject: [PATCH 12/14] fail-fast: false --- .github/workflows/macos.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8ae3ac28209e..1f1836c12764 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,12 +17,14 @@ jobs: runs-on: ${{ matrix.runs-on }} name: ${{ matrix.arch }} strategy: + fail-fast: false matrix: include: - runs-on: macos-13 arch: x86_64-darwin - runs-on: macos-14 arch: aarch64-darwin + steps: - name: Download Crystal source uses: actions/checkout@v4 From d6883cbc6aa73ff2eb411133cb0ac8681cb16103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 4 Nov 2024 21:55:06 +0100 Subject: [PATCH 13/14] CRYSTAL_OPTS=-Dwithout_encoding --- .github/workflows/macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1f1836c12764..6fbccc21a238 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,6 +11,7 @@ concurrency: env: SPEC_SPLIT_DOTS: 160 CI_NIX_SHELL: true + CRYSTAL_OPTS: -Dwithout_encoding jobs: darwin-test: From eecf1b62c8c478ad577f6f3daebc3ab37ff12191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 5 Nov 2024 11:31:17 +0100 Subject: [PATCH 14/14] `-Dwithout_iconv` --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6fbccc21a238..91ac40a5ba42 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,7 +11,7 @@ concurrency: env: SPEC_SPLIT_DOTS: 160 CI_NIX_SHELL: true - CRYSTAL_OPTS: -Dwithout_encoding + CRYSTAL_OPTS: -Dwithout_iconv jobs: darwin-test: