amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.57k stars 206 forks source link

Support for Crystal v1.0.0 #1251

Closed ryuhhnn closed 2 years ago

ryuhhnn commented 3 years ago

Description

When doing a shards install on a fresh amber project, I'm presented with the following errors:

- `crystal (~> 0.35, >= 0.35.0)` required by `amber 0.36.0`
- `crystal (~> 0.35, >= 0.35.0)` required by `granite 0.22.1`
- `crystal (~> 0.34, >= 0.34.0)` required by `json_mapping 0.1.0`
- `crystal (>= 0.35.0, < 2.0.0)` required by `db 0.10.1`

I'm able to bypass this by passing the --ignore-crystal-version for running this locally, but I can't get it to run the command properly through the docker-compose commands.

Versions

Amber CLI (amberframework.org) - v0.36.0 Crystal 1.0.0 (2021-03-22) LLVM: 9.0.1 macOS Big Sur 11.2.3

drujensen commented 3 years ago

waiting for this PR: https://github.com/crystal-lang/json_mapping.cr/pull/4

renich commented 3 years ago

Is crystal-lang/json_mapping.cr#4 fixed in crystal-lang/json_mapping.cr/pull/5?

backward-crazy-mage-puppy-36 commented 3 years ago

This is preventing install of any version of amber on macs as both brew and macports end up installing crystal 1.0.0 before installing amber. This is inspite of there being a amber compatible version of crystal (0.36.0) being installed.

backward-crazy-mage-puppy-36 commented 3 years ago

crystal-lang/json_mapping.cr#4

Yes, it has been resolved and closed.

aquaflamingo commented 3 years ago

Temporary workaround (for those eager to try out the framework) involves cloning amberframework/amber locally and building from source:

$ git clone git@github.com:amberframework/amber.git
$ cd amber
$ shards install --ignore-crystal-version
$ make

You can then use the binary generated to generate your application and move to desired directory:

$ ./bin/amber new my_project
$ mv my_project ~/code/my_project

Once you have your project you can follow the common guidelines to generate a local amber binary in the project:

$ cd ~/code/my_project
$ shard build amber
$ ./bin/amber watch
backward-crazy-mage-puppy-36 commented 3 years ago

Temporary workaround (for those eager to try out the framework) involves cloning amberframework/amber locally and building from source:

$ git clone git@github.com:amberframework/amber.git
$ cd amber
$ shards install --ignore-crystal-version
$ make

You can then use the binary generated to generate your application and move to desired directory:

$ ./bin/amber new my_project
$ mv my_project ~/code/my_project

Once you have your project you can follow the common guidelines to generate a local amber binary in the project:

$ cd ~/code/my_project
$ shard build amber
$ ./bin/amber watch

yeah this is not working. amber requires ameba and when installing shards I get the following error

Postinstall make bin && make run_file Failed make bin && make run_file: /opt/local/bin/shards build Dependencies are satisfied Building: ameba Error target ameba failed to compile: Undefined symbols for architecture x86_64: "iconv", referenced from: Crystal::Iconv#convert<Pointer(Pointer(UInt8)), Pointer(UInt64), Pointer(Pointer(UInt8)), Pointer(UInt64)>:UInt64 in C-rystal5858I-conv.o "_iconvclose", referenced from: Crystal::Iconv#close:Nil in C-rystal5858I-conv.o "_iconvopen", referenced from: *Crystal::Iconv#initialize<String, String, (Symbol | Nil)>:Nil in C-rystal5858I-conv.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: execution of command failed with code: 1: cc "${@}" -o /Users/bcmp36/code/crystal/amber/amber/lib/ameba/bin/ameba -rdynamic -L/usr/local/lib -L/opt/local/lib -lyaml -lpcre -lgc -lpthread /usr/local/Cellar/crystal/1.0.0/src/ext/libcrystal.a -L/opt/local/lib -levent -liconv -ldl

This issue has been reported by me on ameba repository https://github.com/crystal-ameba/ameba/issues/232

eliasjpr commented 3 years ago

We are working on getting support for Crystal v1 out and potentially a Amber v1 as well

jayjah commented 3 years ago

Still no v1 version available???

Resolving dependencies
Fetching https://github.com/amberframework/amber-router.git
Fetching https://github.com/crystal-lang/json_mapping.cr.git
Fetching https://github.com/crystal-ameba/ameba.git
Fetching https://github.com/amberframework/cli.git
Unable to satisfy the following requirements:

- `crystal (>= 0.35.0)` required by `amber_router 0.4.4`
- `crystal (>= 0.34.0, < 2.0.0)` required by `json_mapping 0.1.1`
- `crystal (>= 0.35.0)` required by `ameba 0.13.4`
- `crystal (~> 0.30, >= 0.30.0)` required by `cli 0.9.3`
Failed to resolve dependencies, try updating incompatible shards or use --ignore-crystal-version as a workaround if no update is available.
elorest commented 3 years ago

@jayjah master branch should not be giving you this error right now. We spent a lot of work getting the dependencies working with Crystal 1.0 and in our tests we're not getting any warnings now. I'll try to get 1.0 officially releases and homebrew updated though tonight.

renich commented 3 years ago

Still no v1 version available???

Resolving dependencies
Fetching https://github.com/amberframework/amber-router.git
Fetching https://github.com/crystal-lang/json_mapping.cr.git
Fetching https://github.com/crystal-ameba/ameba.git
Fetching https://github.com/amberframework/cli.git
Unable to satisfy the following requirements:

- `crystal (>= 0.35.0)` required by `amber_router 0.4.4`
- `crystal (>= 0.34.0, < 2.0.0)` required by `json_mapping 0.1.1`
- `crystal (>= 0.35.0)` required by `ameba 0.13.4`
- `crystal (~> 0.30, >= 0.30.0)` required by `cli 0.9.3`
Failed to resolve dependencies, try updating incompatible shards or use --ignore-crystal-version as a workaround if no update is available.

Try removing both lock files when building amber; shards and package before make. It won't give you the error.

tdxius commented 2 years ago

When can we expect this to be released? There is a released candidate v1.0.0rc2 from 15 Jun 2021.

rnice01 commented 2 years ago

@tdxius Came here looking for an update on this but looking at the recent commits it looks like this was done?https://github.com/amberframework/amber/commit/d102df6c63da96439492aab438453f0b5cdd7f11 @elorest can this issue be closed?

elorest commented 2 years ago

Good point. I love this project and poured my life into it for a year along with a few other great programmers. For the last little while we've all been really busy with work and family and haven't been able to contribute as much as we'd like.

Back in the spring I got it working with 1.0 but didn't want to release 1.0 since I was confident no serious errors came out of it that the tests didn't find. After looking through the issues and testing it myself I released a new version against the latest crystal.

Enjoy and thanks for caring.

mixflame commented 2 years ago

Thanks @elorest do you think at some time you could look into #1265 getting merged? This would greatly improve the speed of Amber in Amber/Redis/WS scenarios with more than 1 Amber channel.