Bug 224459 - New ports: lang/crystal, the Crystal programming language & devel/shards, its package manager
Summary: New ports: lang/crystal, the Crystal programming language & devel/shards, its...
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: Li-Wen Hsu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-19 16:03 UTC by Val Packett
Modified: 2018-02-19 13:51 UTC (History)
2 users (show)

See Also:


Attachments
crystal.patch (43.88 KB, patch)
2017-12-19 16:03 UTC, Val Packett
no flags Details | Diff
crystal0241.patch (with LLVM 5, requires llvm-config fixes) (42.23 KB, patch)
2017-12-29 00:00 UTC, Val Packett
no flags Details | Diff
crystal0241.patch v2 (44.36 KB, patch)
2018-02-19 12:43 UTC, Val Packett
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Val Packett 2017-12-19 16:03:24 UTC
Created attachment 188964 [details]
crystal.patch

Please welcome… Crystal! https://crystal-lang.org

This is a bootstrapped compiler. I have provided the bootstraps for amd64 11.x and 12-CURRENT. Would be nice to host them on FreeBSD.org instead of my S3 bucket ;)

Includes FreeBSD 12 support: https://github.com/crystal-lang/crystal/pull/5199

Tested by some people here: https://github.com/crystal-lang/crystal/issues/4185#issuecomment-340221950
Comment 1 Val Packett 2017-12-29 00:00:34 UTC
Created attachment 189183 [details]
crystal0241.patch (with LLVM 5, requires llvm-config fixes)

Here's the new version. I also tweaked the patch to use shared LLVM, but that needs bug 223191
Comment 2 Mikael Urankar freebsd_committer freebsd_triage 2017-12-29 17:42:06 UTC
Does it run on arm (armv7 and aarch64)? Is it hard to bootstrap it?
Comment 3 Val Packett 2017-12-31 12:30:39 UTC
(In reply to mikael.urankar from comment #2)
Runs on ARM/AArch64 Linux, I don't think anyone tried that on FreeBSD. Shouldn't be too difficult to cross-compile, but I haven't had the time to work on that recently…
Comment 4 Li-Wen Hsu freebsd_committer freebsd_triage 2018-02-19 06:45:23 UTC
Hi, this looks good and I have two comments:

1) does the "shards" port in first crystal.patch still needed?
2) can you check the port with `portlint -acbt` and fix the error?
Comment 5 Val Packett 2018-02-19 12:43:09 UTC
Created attachment 190794 [details]
crystal0241.patch v2

(In reply to Li-Wen Hsu from comment #4)
oops, I forgot shards when updating the patch.

Here's a new version of the patch (with shards), had to rebuild bootstraps because libgc-threaded.so.1 → libgc-threaded.so.1. And the new bootstraps are smaller, because LLVM is shared.

Re: portlint:

- CHMOD — this can't be replaced with pkg-plist stuff, this is not for installed binaries, this is for the bootstrap compiler
- "IGNORE" has to appear earlier — this is conditional, appears after bsd.port.options.mk. If I move it up, portlint says conditionals are malformed o_0
- libLLVM dependency — I removed the full path, but added configurable LLVM_VERSION — portlint doesn't parse that correctly
Comment 6 Val Packett 2018-02-19 12:45:04 UTC
(In reply to Greg V from comment #5)
er, libgc-threaded.so.2
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-02-19 13:24:46 UTC
A commit references this bug:

Author: lwhsu
Date: Mon Feb 19 13:23:47 UTC 2018
New revision: 462317
URL: https://svnweb.freebsd.org/changeset/ports/462317

Log:
  Add lang/crystal, language with Ruby-like syntax and static type checking

  PR:		224459
  Submitted by:	Greg V <greg@unrelenting.technology>

Changes:
  head/lang/Makefile
  head/lang/crystal/
  head/lang/crystal/Makefile
  head/lang/crystal/distinfo
  head/lang/crystal/files/
  head/lang/crystal/files/patch-src_lib__c_x86__64-portbld-freebsd_c_dirent.cr
  head/lang/crystal/files/patch-src_lib__c_x86__64-portbld-freebsd_c_sys_stat.cr
  head/lang/crystal/files/patch-src_lib__c_x86__64-portbld-freebsd_c_sys_types.cr
  head/lang/crystal/pkg-descr
  head/lang/crystal/pkg-message
  head/lang/crystal/pkg-plist
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-02-19 13:25:50 UTC
A commit references this bug:

Author: lwhsu
Date: Mon Feb 19 13:25:28 UTC 2018
New revision: 462318
URL: https://svnweb.freebsd.org/changeset/ports/462318

Log:
  Add devel/shards, dependency manager for the Crystal programming language

  PR:		224459
  Submitted by:	Greg V <greg@unrelenting.technology>

Changes:
  head/devel/Makefile
  head/devel/shards/
  head/devel/shards/Makefile
  head/devel/shards/distinfo
  head/devel/shards/pkg-descr
Comment 9 Li-Wen Hsu freebsd_committer freebsd_triage 2018-02-19 13:32:25 UTC
Two ports added, thanks!  Few points:

- There are few minor tweaks in the Makefile, hope you don't mind
- Thanks for portlint fixes, the main problem was about bootstrap files fetching, and of course we don't need to blindly follow what portlint says.
- Is it possible to have i386 support?
- May I suggest you submit doc update to upstream to add the installation information of FreeBSD?
Comment 10 Val Packett 2018-02-19 13:40:39 UTC
(In reply to Li-Wen Hsu from comment #9)
Awesome, thanks!

> There are few minor tweaks in the Makefile, hope you don't mind

Of course that's fine. I don't even see them (without running diff) haha

> Thanks for portlint fixes, the main problem was about bootstrap files fetching, and of course we don't need to blindly follow what portlint says.

I haven't seen that one?!

> Is it possible to have i386 support?

Anything is possible, in theory :) But this was not done upstream.

If you look at the pkg-plist, i686-linux-gnu and i686-linux-musl are the only x86 directories under lib_c.

> May I suggest you submit doc update to upstream to add the installation information of FreeBSD?

Sure, I was planning to do that.
Comment 11 Li-Wen Hsu freebsd_committer freebsd_triage 2018-02-19 13:51:39 UTC
(In reply to Greg V from comment #10)
> > Thanks for portlint fixes, the main problem was about bootstrap files fetching, and of course we don't need to blindly follow what portlint says.
>
> I haven't seen that one?!

There was no bootstrap file information for 11 in distinfo.

> > Is it possible to have i386 support?
>
> Anything is possible, in theory :) But this was not done upstream.
>
> If you look at the pkg-plist, i686-linux-gnu and i686-linux-musl are the only x86 directories under lib_c.

So let's try to have them, and then aarch64, arm, and so on :-)

> > May I suggest you submit doc update to upstream to add the installation information of FreeBSD?
>
> Sure, I was planning to do that.

Awesome!