Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crystal: new port #1611

Merged
merged 1 commit into from Apr 20, 2018
Merged

crystal: new port #1611

merged 1 commit into from Apr 20, 2018

Conversation

mohd-akram
Copy link
Member

Description

Add the Crystal language. Could not test in tracing mode as it stalls forever for some reason.

Tested on

macOS 10.13.4 17E199
Xcode 9.3 9E145

Verification

Have you

  • followed our Commit Message Guidelines?
  • checked that there aren't other open pull requests for the same change?
  • checked your Portfile with port lint?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

@macportsbot
Copy link

Travis Build #1977 Errored.

Lint results
--->  Verifying Portfile for crystal
--->  0 errors and 0 warnings found.

Port crystal-dep fail on xcode8.3. Log

@macportsbot
Copy link

Travis Build #1986 Errored.

Lint results
--->  Verifying Portfile for crystal
--->  0 errors and 0 warnings found.

Port crystal success on xcode8.3. Log
Port crystal fail on xcode7.3. Log

@pmetzger
Copy link
Member

LGTM, but as the Portfile is relatively complicated I'd like a second opinion on it if possible.

@macportsbot
Copy link

Travis Build #1991 Errored.

Lint results
--->  Verifying Portfile for crystal
--->  0 errors and 0 warnings found.

Port crystal success on xcode8.3. Log

@kencu
Copy link
Contributor

kencu commented Apr 20, 2018

Agree, this is a bit complicated. Some build tricks noted. I know nothing about crystal or how to test the installation.

Fails on 10.11 (and all earlier, no doubt) with

dyld: _dyld_bind_fully_image_containing_address() error
dyld: Symbol not found: _clock_gettime

@mohd-akram
Copy link
Member Author

@kencu Seems that the bootstrap Crystal binary was built for 10.12 and above, even though the code takes care to avoid that. I've confirmed this with otool -l. I'll see if I can raise an issue with them about that. There are indeed some build tricks (lol) which I guess I should explain:

  • All the patches are to allow static linking Crystal-produced binaries. One of them is a backport from master and two will hopefully be merged into Crystal.

  • The post-patch replacements are because Crystal hardcodes -L linking directories and because MacPorts' iconv has a lib prefix before its functions (libiconv_open instead of iconv_open). Apparently OpenBSD is the same so I'm just using its file.

  • Overriding CC is to force Crystal to look in $prefix/lib (because of the aforementioned hardcode). Tried to use a build flag (--link-flags), but it didn't work.

I've added Crystal's builtin tests which pass (changing PATH is required for a specific test to pass).

@kencu
Copy link
Contributor

kencu commented Apr 20, 2018

nearly 13000 examples built during the tests, with zero errors, so I guess you have it sorted out 😀

all the destrooting looks as it should look.

can you put a pre-fetch block in to stop compilation on 10.11 and less? Something like this should do it:

if {${os.platform} eq "darwin" && ${os.major} <= 15} {
    pre-fetch {
        ui_error "${name} ${version} requires macOS 10.12 or greater at present."
        return -code error "incompatible OS X version"
    }
}

After that, should be good to go, I think.

@mohd-akram
Copy link
Member Author

Yeah, there are quite a few tests! I've added the code to the Portfile.

@kencu kencu merged commit 570cc15 into macports:master Apr 20, 2018
@kencu
Copy link
Contributor

kencu commented Apr 21, 2018

With ports like that, pretty much time you asked for commit rights, no?

@mohd-akram mohd-akram deleted the crystal branch April 21, 2018 15:03
@pmetzger
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants