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

Amber is incompatible with crystal 0.36.x? #1245

Closed
factyy opened this issue Feb 3, 2021 · 7 comments
Closed

Amber is incompatible with crystal 0.36.x? #1245

factyy opened this issue Feb 3, 2021 · 7 comments

Comments

@factyy
Copy link

factyy commented Feb 3, 2021

Description

Amber fails to build an empty app using crystal 0.36.x
Reproducing both in host and docker environments (the following description is for a docker one)

Steps to Reproduce

  1. Get a crystal docker image docker pull crystallang/crystal:0.36.0 and create a container from it;
  2. Install amber from sources:
git clone https://github.com/amberframework/amber.git
cd amber
make
make install
  1. Generate a new minimal amber app:
amber new --minimal .
  1. Run amber with amber w

Expected behavior: Amber app starts

Actual behavior: Amber app fails to build:

watch.run (Info) Building...
INFO - watch.run: Building...
Showing last frame. Use --error-trace for full trace.

In lib/amber/src/amber/router/session/cookie_store.cr:41:3

 41 | class CookieStore < AbstractStore
      ^
Error: abstract `def Amber::Router::Session::AbstractStore#update(other_hash)` must be implemented by Amber::Router::Session::CookieStore
INFO - watch.run: Compile time errors detected, exiting...
watch.run (Info) Compile time errors detected, exiting...

Reproduces how often: 100% reproduction with crystal 0.36.0 and 0.36.1

Versions

Crystal 0.36.0 [1e6f96aef] (2021-01-26)

LLVM: 10.0.0
Default target: x86_64-unknown-linux-gnu

Amber CLI (amberframework.org) - v0.35.0

Additional Information

I'm entirely new to crystal but it looks like a method with type constraints doesn't override the most generic one in the base class via inheritance. This particular error can be fixed by adding (to the base class) or removing (from CookieStore) type constraints from the method signature. But there are lots of errors like this in the generated code base, so it looks like it is not possible to eliminate all of them by hand without breaking something in the framework (touching the framework by hand is a pretty bad idea itself).

@acook
Copy link

acook commented Feb 12, 2021

The fix should be merged, however given that there hasn't been a fresh release of Amber since June I expect that you'll need to use the main branch version to get things to work.

@factyy
Copy link
Author

factyy commented Feb 12, 2021

Sadly I have to confirm that this problem exists with an up-to-day amber (master branch).

I've patched the description

@acook
Copy link

acook commented Feb 13, 2021

Oh, wow. Thanks for posting more info. I had tried to install Amber a few days ago and assumed it was a fairly simple issue.

Looks like there will need to be some deeper fixes in Amber to bring it up to date with the latest breaking changes. So, for a solution for you I would suggest: either roll back to an older version of Crystal or I'm sure the Amber project would love to have someone tackling these issues.

@factyy
Copy link
Author

factyy commented Feb 17, 2021

Currently I decided to stick with 0.35.1 but hopefully I will be able to help with such issues in the foreseeable future :)

@drujensen
Copy link
Member

Released Amber 0.36.0 to support Crystal 0.36.x

@renich
Copy link
Contributor

renich commented Feb 22, 2021

I'm getting this on a project created with v0.35.1 while trying amber w with a newly compiled v0.36.0

[renich@introdesk rafita]$ amber -v
Amber CLI (amberframework.org) - v0.36.0

[renich@introdesk rafita]$ amber w
11:13:54 watch.run (Info) Building...
2021-02-22T17:13:54.330479Z   INFO - watch.run: Building...
Showing last frame. Use --error-trace for full trace.

In lib/amber/src/amber/router/session/cookie_store.cr:41:3

 41 | class CookieStore < AbstractStore
      ^
Error: abstract `def Amber::Router::Session::AbstractStore#update(other_hash)` must be implemented by Amber::Router::Session::CookieStore
2021-02-22T17:13:55.910551Z   INFO - watch.run: Compile time errors detected, exiting...
11:13:55 watch.run (Info) Compile time errors detected, exiting...

@renich
Copy link
Contributor

renich commented Feb 22, 2021

OK, the fix was kind of easy. I just deleted lib/*, updated shards.yml to the ones currently used and ran shards install again. After that, it worked.

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

No branches or pull requests

4 participants