kemalcr / kemal

Fast, Effective, Simple Web Framework
https://kemalcr.com
MIT License
3.65k stars 189 forks source link

Compilation issue with crystal 1.6 #650

Closed waghanza closed 2 years ago

waghanza commented 2 years ago

With the following command shards build --release --no-debug --static, I have a compilation issue

Error target server failed to compile:
Showing last frame. Use --error-trace for full trace.

In lib/kemal/src/kemal/static_file_handler.cr:51:27

 51 | last_modified = modification_time(file_path)
                      ^----------------
Error: undefined method 'modification_time' for Kemal::StaticFileHandler

Source is https://github.com/the-benchmarker/web-frameworks/blob/013fbc9fc6966052ee98fc2e4749f3753d3f1b83/crystal/kemal/src/server.cr#L1

I try to compile inside a container based on alpine

FROM crystallang/crystal:1.6.0-alpine

WORKDIR /usr/src/app

COPY . ./

RUN apk add --update yaml-static

RUN shards lock
RUN shards install --production
RUN shards build --release --no-debug --static

FROM alpine

COPY --from=0 /usr/src/app/bin/server /usr/bin/app

WORKDIR /usr/bin
CMD ./app
Blacksmoke16 commented 2 years ago

Duplicate of #649, #648, and #643

guanting112 commented 2 years ago

try this:

dependencies:
  kemal:
    github: kemalcr/kemal
    branch: master

kemal

sdogruyol commented 2 years ago

I'll cut a release in the upcoming hours 👍

sdogruyol commented 2 years ago

Here we go https://github.com/kemalcr/kemal/releases/tag/v1.3.0 🚀