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

Build fails with crystal 1.1.0 (2021-07-14) #2256

Closed
tinglycraniumplacidly opened this issue Jul 15, 2021 · 12 comments · Fixed by #2295
Closed

Build fails with crystal 1.1.0 (2021-07-14) #2256

tinglycraniumplacidly opened this issue Jul 15, 2021 · 12 comments · Fixed by #2295

Comments

@tinglycraniumplacidly
Copy link

tinglycraniumplacidly commented Jul 15, 2021

user@host:~/gits/invidious$ crystal build src/invidious.cr --release
Showing last frame. Use --error-trace for full trace.

In /usr/share/crystal/src/socket/addrinfo.cr:192:7

 192 | resolve(domain, service, family, Type::STREAM, Protocol::TCP) { |addrinfo| yield addrinfo }
       ^------
Error: no overload matches 'Socket::Addrinfo.resolve' with types Int32, Socket::Family, Bool, Socket::Type, Socket::Protocol

Overloads are:
 - Socket::Addrinfo.resolve(domain, service, family : Family | ::Nil = nil, type : Type = nil, protocol : Protocol = Protocol::IP, timeout = nil)
 - Socket::Addrinfo.resolve(domain, service, family : Family | ::Nil = nil, type : Type = nil, protocol : Protocol = Protocol::IP, timeout = nil, &block)
@unixfox
Copy link
Member

unixfox commented Jul 15, 2021

We don't support crystal 1.1.0 yet, you are advised to use crystal 1.0.0 until further notices.

@SamantazFox
Copy link
Member

Looks like an issue with crystal itself (The error points to the code at /usr/share/crystal/src/socket/addrinfo.cr:192:7 and we don't use the resolve() function).

What distro are you using? Are you using the upstream binaries or your package maintainer's?

@tinglycraniumplacidly
Copy link
Author

Hi @SamantazFox thanks for following up.

I'm using Ubuntu, and I followed the Manual setup as outlined here
https://crystal-lang.org/install/on_ubuntu/

I wasn't sure how to downgrade/get 1.0.0.

@syeopite
Copy link
Member

It might not be an upstream issue. I just quickly ran an error trace which pointed to these extension methods for a potential culprit

class TCPSocket
def initialize(host, port, dns_timeout = nil, connect_timeout = nil, family = Socket::Family::UNSPEC)
Addrinfo.tcp(host, port, timeout: dns_timeout, family: family) do |addrinfo|
super(addrinfo.family, addrinfo.type, addrinfo.protocol)
connect(addrinfo, timeout: connect_timeout) do |error|
close
error
end
end
end
end

@GauthierPLM
Copy link
Contributor

Hello,

If you upgraded crystal to 1.1.0 and encounter issues, you can try to downgrade to 1.0.0 until a fix is done.
Unfortunately, the official Crystal repository does not contains the 1.0.0 version any more.

If you are lucky, the package could still be in /var/cache/apt/archives/.
You can install it using sudo apt install /var/cache/apt/archives/crystal_1.0.0-1+61.1_amd64.deb.

To avoid upgrading the package, you can hold it so it does not upgrade: sudo apt-mark hold crystal. Don't forget to regularly upgrade the package when it's considered stable. More information.

Hope this can help !

@markozajc
Copy link

markozajc commented Jul 17, 2021

Here's the output with --error-trace, in case it's needed.

You can also grab Crystal 1.0.0 from their release page on GitHub.

@SamantazFox
Copy link
Member

Here's the output with --error-trace, in case it's needed.

What distro are you using? And what crystal release (from github, from repos)?

@markozajc
Copy link

@SamantazFox I am on Debian Bullseye/testing and I got the 1.1.0 release from the official repository on OBS (https://download.opensuse.org/repositories/devel:/languages:/crystal/Debian_Testing). Full version string is 1.1.0-1+2.1.

@SamantazFox
Copy link
Member

I'll try to update on our test instance when I'll have the time for that.

@nahdoubtit
Copy link

I got this same issue on Debian 10 buster & Crystal 1.1.0 [af095d72d]. I noticed tleydxdy has a PR to fix it, so I tried that before downgrading crystal and #2263 works. builds fine, and runs fine.

@SamantazFox
Copy link
Member

I got this same issue on Debian 10 buster & Crystal 1.1.0 [af095d72d]. I noticed tleydxdy has a PR to fix it, so I tried that before downgrading crystal and #2263 works. builds fine, and runs fine.

For now, we recommend to stay on v1.0.* of crystal. As discussed on matrix, while the modifications provided by @tleydxdy solve the compilation error, they doesn't fix the actual code, and the proxy feature (for bypass of region-restricted videos) is still broken.

@nahdoubtit
Copy link

I got this same issue on Debian 10 buster & Crystal 1.1.0 [af095d72d]. I noticed tleydxdy has a PR to fix it, so I tried that before downgrading crystal and #2263 works. builds fine, and runs fine.

For now, we recommend to stay on v1.0.* of crystal. As discussed on matrix, while the modifications provided by @tleydxdy solve the compilation error, they doesn't fix the actual code, and the proxy feature (for bypass of region-restricted videos) is still broken.

I was worried it'd be difficult to downgrade, i.e. compile it myself and have dependency issues, but it was easy as uninstalling crystal 1.1.0 and downloading the deb from this quote below, and manually installing it with dpkg.

Here's the output with --error-trace, in case it's needed.

You can also grab Crystal 1.0.0 from their release page on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants