Bug 262581 - lang/crystal: Update to 1.4.0
Summary: lang/crystal: Update to 1.4.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Fernando Apesteguía
URL: https://crystal-lang.org/2022/04/06/1...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-16 02:00 UTC by slowdive
Modified: 2022-04-20 14:24 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (val)


Attachments
diff outputs for Makefile, distinfo, pkg-plist (14.54 KB, patch)
2022-03-16 02:00 UTC, slowdive
no flags Details | Diff
crystal-update-to-1.3.2.patch (15.59 KB, patch)
2022-03-17 16:12 UTC, slowdive
no flags Details | Diff
extra-patch-src_openssl_lib__crypto-1.4.0.cr (1.96 KB, patch)
2022-04-09 21:31 UTC, slowdive
no flags Details | Diff
extra-patch-src_openssl_lib__ssl-1.4.0.cr (1.55 KB, patch)
2022-04-09 21:31 UTC, slowdive
no flags Details | Diff
Update-to-1.4.0.patch (25.34 KB, patch)
2022-04-09 23:26 UTC, slowdive
no flags Details | Diff
lang-crystal-Readd-aarch64-llvm10.patch (1.38 KB, patch)
2022-04-20 00:09 UTC, slowdive
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description slowdive 2022-03-16 02:00:35 UTC
Created attachment 232478 [details]
diff outputs for Makefile, distinfo, pkg-plist

Diffs includes outputs from:

```
diff -ruN crystal/Makefile crystal-1.3.2/Makefile
diff -ruN crystal/distinfo crystal-1.3.2/distinfo
diff -ruN crystal/pkg-plist crystal-1.3.2/pkg-plist
```
Comment 1 Fernando Apesteguía freebsd_committer freebsd_triage 2022-03-17 09:04:43 UTC
^Triage: If there is a changelog or release notes URL available for this version, please add it to the URL field.

Also, shouldn't these two:

+etc/bash_completion.d/_crystal.bash
+share/zsh/site-functions/_crystal

depend on BASH and ZSH options respectively?
Comment 2 slowdive 2022-03-17 15:56:03 UTC
(In reply to Fernando Apesteguía from comment #1)

Wi
Comment 3 Fernando Apesteguía freebsd_committer freebsd_triage 2022-03-17 16:01:55 UTC
(In reply to slowdive from comment #2)
??
Comment 4 slowdive 2022-03-17 16:12:21 UTC
Created attachment 232520 [details]
crystal-update-to-1.3.2.patch
Comment 5 slowdive 2022-03-17 16:14:23 UTC
(In reply to Fernando Apesteguía from comment #1)

Yes, I forgot to revert zsh/bash files, fixed with `crystal-update-to-1.3.2.patch `
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2022-04-01 11:52:58 UTC
Does this build for you?

It does not patch for me. It looks like some of the patches in files/ need to be updated.
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2022-04-07 08:34:28 UTC
$ make patch

===>  License APACHE20 accepted by the user
===>   crystal-1.3.2 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by crystal-1.3.2 for building
===>  Extracting for crystal-1.3.2
=> SHA256 Checksum OK for crystal/crystal-1.1.1-freebsd12-amd64-llvm10.
=> SHA256 Checksum OK for crystal/crystal-lang-crystal-1.3.2_GH0.tar.gz.
/bin/mkdir -p /data/fernape_data/FreeBSD-repos/ports/lang/crystal/work/crystal-1.3.2/.build
cp -f /data/fernape_data/FreeBSD-repos/ports/distfiles/crystal/crystal-1.1.1-freebsd12-amd64-llvm10 /data/fernape_data/FreeBSD-repos/ports/lang/crystal/work/crystal-1.3.2/.build/crystal
/bin/chmod +x /data/fernape_data/FreeBSD-repos/ports/lang/crystal/work/crystal-1.3.2/.build/crystal
/bin/ln -s x86_64-freebsd /data/fernape_data/FreeBSD-repos/ports/lang/crystal/work/crystal-1.3.2/src/lib_c/aarch64-portbld-freebsd
/bin/ln -s x86_64-freebsd /data/fernape_data/FreeBSD-repos/ports/lang/crystal/work/crystal-1.3.2/src/lib_c/aarch64-freebsd
===>  Patching for crystal-1.3.2
===>  Applying extra patch /data/fernape_data/FreeBSD-repos/ports/lang/crystal/files/extra-patch-src_openssl_lib__crypto.cr
1 out of 1 hunks failed--saving rejects to src/openssl/lib_crypto.cr.rej
===>  FAILED Applying extra patch /data/fernape_data/FreeBSD-repos/ports/lang/crystal/files/extra-patch-src_openssl_lib__crypto.cr
*** Error code 1

Stop.
make[1]: stopped in /data/fernape_data/FreeBSD-repos/ports/lang/crystal
*** Error code 1

Stop.
make: stopped in /data/fernape_data/FreeBSD-repos/ports/lang/crystal
Comment 8 slowdive 2022-04-08 01:49:06 UTC
(In reply to Fernando Apesteguía from comment #6)

I remember that every test from the book passed, and then spec and local tests. But I do not remember running `patch`, about to do this right now.
Comment 9 slowdive 2022-04-08 02:42:18 UTC
(In reply to Fernando Apesteguía from comment #7)

No issues with `make patch`

```
root@nomad:/usr/ports/lang/crystal # make patch
===>  License APACHE20 accepted by the user
===>   crystal-1.3.2 depends on file: /usr/local/sbin/pkg - found
=> crystal-1.1.1-freebsd12-amd64-llvm10 doesn't seem to exist in /usr/ports/distfiles/crystal.
=> Attempting to fetch https://dl.unrelenting.technology/crystal/crystal-1.1.1-freebsd12-amd64-llvm10
crystal-1.1.1-freebsd12-amd64-llvm10                    11 MB 6988 kBps    01s
=> crystal-lang-crystal-1.3.2_GH0.tar.gz doesn't seem to exist in /usr/ports/distfiles/crystal.
=> Attempting to fetch https://codeload.github.com/crystal-lang/crystal/tar.gz/1.3.2?dummy=/crystal-lang-crystal-1.3.2_GH0.tar.gz
fetch: https://codeload.github.com/crystal-lang/crystal/tar.gz/1.3.2?dummy=/crystal-lang-crystal-1.3.2_GH0.tar.gz: size unknown
fetch: https://codeload.github.com/crystal-lang/crystal/tar.gz/1.3.2?dummy=/crystal-lang-crystal-1.3.2_GH0.tar.gz: size of remote file is not known
crystal-lang-crystal-1.3.2_GH0.tar.gz                 2768 kB 3134 kBps    01s
===> Fetching all distfiles required by crystal-1.3.2 for building
===>  Extracting for crystal-1.3.2
=> SHA256 Checksum OK for crystal/crystal-1.1.1-freebsd12-amd64-llvm10.
=> SHA256 Checksum OK for crystal/crystal-lang-crystal-1.3.2_GH0.tar.gz.
/bin/mkdir -p /usr/ports/lang/crystal/work/crystal-1.3.2/.build
cp -f /usr/ports/distfiles/crystal/crystal-1.1.1-freebsd12-amd64-llvm10 /usr/ports/lang/crystal/work/crystal-1.3.2/.build/crystal
/bin/chmod +x /usr/ports/lang/crystal/work/crystal-1.3.2/.build/crystal
/bin/ln -s x86_64-freebsd /usr/ports/lang/crystal/work/crystal-1.3.2/src/lib_c/aarch64-portbld-freebsd
/bin/ln -s x86_64-freebsd /usr/ports/lang/crystal/work/crystal-1.3.2/src/lib_c/aarch64-freebsd
===>  Patching for crystal-1.3.2
root@nomad:/usr/ports/lang/crystal #
```

But extra patch is not in my output either, going to look into this.
Comment 10 Fernando Apesteguía freebsd_committer freebsd_triage 2022-04-08 08:20:49 UTC
(In reply to slowdive from comment #9)
Those extra patches are applied conditionally (https://docs.freebsd.org/en/books/porters-handbook/slow-porting/#slow-patch). From the Makefile:

# crystal needs pkgconfig to determine SSL variants but these are not
# present in FreeBSD base. We splice in the correct info based on
# FreeBSD version and hope it doesn't change during minor releases.
# See post-patch for the substitutions of these patches.
.if ${SSL_DEFAULT} == "base"
EXTRA_PATCHES=  ${PATCHDIR}/extra-patch-src_openssl_lib__crypto.cr \
                ${PATCHDIR}/extra-patch-src_openssl_lib__ssl.cr
.endif

Do you have a different SSL_DEFAULT?
Comment 11 slowdive 2022-04-09 01:38:08 UTC
(In reply to Fernando Apesteguía from comment #10)

I had `openssl` so it didn't trigger an error. Switched to `base` and seeing the same, working on it:

```
root@nomad:/usr/ports/lang/crystal # make patch
===>  License APACHE20 accepted by the user
===>   crystal-1.3.2 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by crystal-1.3.2 for building
===>  Extracting for crystal-1.3.2
=> SHA256 Checksum OK for crystal/crystal-1.1.1-freebsd12-amd64-llvm10.
=> SHA256 Checksum OK for crystal/crystal-lang-crystal-1.3.2_GH0.tar.gz.
/bin/mkdir -p /usr/ports/lang/crystal/work/crystal-1.3.2/.build
cp -f /usr/ports/distfiles/crystal/crystal-1.1.1-freebsd12-amd64-llvm10 /usr/ports/lang/crystal/work/crystal-1.3.2/.build/crystal
/bin/chmod +x /usr/ports/lang/crystal/work/crystal-1.3.2/.build/crystal
/bin/ln -s x86_64-freebsd /usr/ports/lang/crystal/work/crystal-1.3.2/src/lib_c/aarch64-portbld-freebsd
/bin/ln -s x86_64-freebsd /usr/ports/lang/crystal/work/crystal-1.3.2/src/lib_c/aarch64-freebsd
===>  Patching for crystal-1.3.2
===>  Applying extra patch /usr/ports/lang/crystal/files/extra-patch-src_openssl_lib__crypto.cr
1 out of 1 hunks failed--saving rejects to src/openssl/lib_crypto.cr.rej
===>  FAILED Applying extra patch /usr/ports/lang/crystal/files/extra-patch-src_openssl_lib__crypto.cr
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/crystal
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/crystal
root@nomad:/usr/ports/lang/crystal #
```

And with no defaults no error as well.
Comment 12 slowdive 2022-04-09 21:27:03 UTC
Updated patch files, going to rebase to `1.4` and test it out.
Comment 13 slowdive 2022-04-09 21:31:08 UTC
Created attachment 233109 [details]
extra-patch-src_openssl_lib__crypto-1.4.0.cr
Comment 14 slowdive 2022-04-09 21:31:46 UTC
Created attachment 233110 [details]
extra-patch-src_openssl_lib__ssl-1.4.0.cr
Comment 15 slowdive 2022-04-09 21:52:18 UTC
Now I am getting:

```
In src/openssl/lib_crypto.cr:4:26

 4 | OPENSSL_VERSION = {{ ssl_version }}
                          ^----------
Error: undefined macro variable 'ssl_version'
```
Comment 16 slowdive 2022-04-09 22:06:55 UTC
Oh I grabbed orig vars
Comment 17 slowdive 2022-04-09 23:26:14 UTC
Created attachment 233111 [details]
Update-to-1.4.0.patch
Comment 18 Fernando Apesteguía freebsd_committer freebsd_triage 2022-04-12 09:44:14 UTC
Committed,

Thanks!
Comment 19 commit-hook freebsd_committer freebsd_triage 2022-04-12 09:44:46 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8cd785de155f660685d9d64ba9c9dc9ae53066c1

commit 8cd785de155f660685d9d64ba9c9dc9ae53066c1
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2022-04-11 16:42:14 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-04-12 09:41:32 +0000

    lang/crystal: Update to 1.4.0

    ChangeLog: https://crystal-lang.org/2022/04/06/1.4.0-released.html

    PR:     262581
    Reported by:    slowdive@me.com
    Approved by:    greg@unrelenting.technology (maintainer, timeout > 2 weeks)

 lang/crystal/Makefile                              |   7 +-
 lang/crystal/distinfo                              |   8 +-
 .../files/extra-patch-src_openssl_lib__crypto.cr   |  39 ++++--
 .../files/extra-patch-src_openssl_lib__ssl.cr      |  28 +++--
 lang/crystal/pkg-plist                             | 135 +++++++++++++++++++--
 5 files changed, 182 insertions(+), 35 deletions(-)
Comment 20 Val Packett 2022-04-19 22:35:54 UTC
Please readd the aarch64 bootstrap checksum lines that were deleted here. That's these lines:

SHA256 (crystal/crystal-1.1.1-freebsd12-aarch64-llvm10) = 51433c9cff796da1423e2a6d77c87891cd7ba4cee37ef25322b2e801aba2b53b
SIZE (crystal/crystal-1.1.1-freebsd12-aarch64-llvm10) = 11093864
Comment 21 slowdive 2022-04-20 00:09:26 UTC
Created attachment 233348 [details]
lang-crystal-Readd-aarch64-llvm10.patch
Comment 22 commit-hook freebsd_committer freebsd_triage 2022-04-20 14:24:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=71ec7cdb3d51f1a8c908488e1eae856d4fa45dbb

commit 71ec7cdb3d51f1a8c908488e1eae856d4fa45dbb
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2022-04-20 06:43:13 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-04-20 14:21:29 +0000

    lang/crystal: Readd aarch64 boostrap checksum

    Removed by mistake in last update

    PR:     262581
    Reported by:    greg@unrelenting.technology (maintainer)
    Fixes:  8cd785de155f660685d9d64ba9c9dc9ae53066c1

 lang/crystal/distinfo | 2 ++
 1 file changed, 2 insertions(+)
Comment 23 Fernando Apesteguía freebsd_committer freebsd_triage 2022-04-20 14:24:33 UTC
Done.

Thanks!