Skip to content

Commit

Permalink
chore: Updates for Crystal 1.2
Browse files Browse the repository at this point in the history
We now need a custom copy of the sources to build, because the main
release distribution doesn't have the markd sources or the required LLVM
object files.

Closes elbywan#29
  • Loading branch information
refi64 committed Jan 1, 2022
1 parent 3f64963 commit dcf503d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
FROM crystallang/crystal:1.1.1-alpine
FROM crystallang/crystal:1.2.2-alpine

WORKDIR /app

# Add llvm deps.
RUN apk add --update --no-cache --force-overwrite \
llvm10-dev llvm10-static g++
llvm10-dev llvm10-static g++ make

# Build crystalline.
COPY . /app/
RUN shards build crystalline --no-debug --progress --stats --production --static --release -Dpreview_mt --ignore-crystal-version

RUN git clone -b 1.2.2 --depth=1 https://github.com/crystal-lang/crystal \
&& make -C crystal llvm_ext \
&& CRYSTAL_PATH=crystal/src:lib shards build crystalline \
--no-debug --progress --stats --production --static --release \
-Dpreview_mt --ignore-crystal-version \
&& rm -rf crystal
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Building from source does take a long time._

### Compatibility

| Crystal | Crystalline |
| --------- | ------------------ |
| **1.1.X** | **0.4.X (latest)** |
| 1.0.X | 0.3.X |
| 0.36.X | 0.2.X |
| 0.35.1 | 0.1.X |
| Crystal | Crystalline |
| --------------- | ------------------ |
| **1.1.X,1.2.X** | **master** |
| 1.0.X | 0.3.X |
| 0.36.X | 0.2.X |
| 0.35.1 | 0.1.X |

### Pre-built binaries

Expand Down Expand Up @@ -77,6 +77,14 @@ build.](https://github.com/elbywan/crystalline/actions)
**Warning: this can take a long time! (several minutes - up to 20 minutes,
depending on your hardware)**

Make sure you clone a copy of the [Crystal sources](https://github.com/crystal-lang/crystal)
corresponding to the version of the compiler you're running. For instance, for
version 1.2.2, you'd have:

```
$ git clone https://github.com/crystal-lang/crystal -b 1.2.2
```

#### Scoped install

In the `.shard.yml` file:
Expand All @@ -92,7 +100,7 @@ Then:
```sh
# Produces a binary at ./bin/crystalline
shards build crystalline --release --no-debug --progress -Dpreview_mt
CRYSTAL_PATH=$PATH_TO_CRYSTAL_SOURCES/src shards build crystalline --release --no-debug --progress -Dpreview_mt
```

#### Global install
Expand All @@ -101,7 +109,7 @@ shards build crystalline --release --no-debug --progress -Dpreview_mt
git clone https://github.com/elbywan/crystalline
cd crystalline
mkdir bin
crystal build ./src/crystalline.cr -o ./bin/crystalline --release --no-debug --progress -Dpreview_mt
CRYSTAL_PATH=$PATH_TO_CRYSTAL_SOURCES/src:lib crystal build ./src/crystalline.cr -o ./bin/crystalline --release --no-debug --progress -Dpreview_mt
```

#### Known Build Issues
Expand Down
2 changes: 1 addition & 1 deletion src/crystalline/lsp/ext/enum.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct Enum
super
end

def to_json(builder : JSON::Builder) : IO
def to_json(builder : JSON::Builder)
builder.string self.to_s{% if downcase %}.downcase{% end %}
end

Expand Down

0 comments on commit dcf503d

Please sign in to comment.