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

Try build ic again after update crystal to 1.12.1, but get ic 1.11.2 #22

Closed
zw963 opened this issue Apr 13, 2024 · 4 comments
Closed

Try build ic again after update crystal to 1.12.1, but get ic 1.11.2 #22

zw963 opened this issue Apr 13, 2024 · 4 comments

Comments

@zw963
Copy link

zw963 commented Apr 13, 2024

My current crystal was compiled by myself, and update into 1.12.1

 ╰─ $ cr version
Crystal 1.12.1 [4cea10199] (2024-04-11)

LLVM: 17.0.6
Default target: x86_64-pc-linux-gnu

But when i try to rebuilt ic use make release, l always get the ic of verison 1.11.2

 ╰─ $ ic
ic(1.11.2):001>

What is expected is, 1.12.1.

Thanks.

@I3oris
Copy link
Owner

I3oris commented Apr 22, 2024

This is expected. The crystal version shown is the one included in the share directory, the place where the interpreter used by IC lives. The version of which crystal it have been compiled doesn't matter, the version of interpreter will stay the same.

I done this like that to avoid instability because I have several patches (monkey patching) of the compiler, and sometime the new version of crystal would break theses patches.

That said, the ic --version that show the crystal version could clarify that.

Version: 0.7.0
REPLy version: 0.3.1
Running Crystal version: 1.11.2
Compiled with Crystal version: 1.12.1

instead of

Version: 0.7.0
REPLy version: 0.3.1
Crystal version: 1.11.2

@zw963
Copy link
Author

zw963 commented Apr 23, 2024

Thanks, so, my understanding is that ic use SAME interpreter version as official crystal i?

But, it seem like not true.

 ╰─ $ ic
ic(1.11.2):001> puts Crystal::VERSION
1.11.2
 => nil

 ╰─ $ crystal i
Crystal interpreter 1.12.1 [4cea10199] (2024-04-11).
EXPERIMENTAL SOFTWARE: if you find a bug, please consider opening an issue in
https://github.com/crystal-lang/crystal/issues/new/
icr:1> puts Crystal::VERSION
1.12.1

So, they just use different version standard library? is there any reason to not update to 1.12.1?

@I3oris
Copy link
Owner

I3oris commented Apr 23, 2024

Thanks, so, my understanding is that ic use SAME interpreter version as official crystal i?

No, It's the same that the version on ic/share directory (coming from ic master).

The version never change unless I update myself the version on master. (I just updated the master to 1.12.1 yesterday)

However if you want to update the crystal version without waiting the update, you could simply fetch the crystal master into ic/share/crystal-ic (it's always the exact copy of crystal without changes).

using a script like that:
fetch-crystal-i.sh:

#!/bin/sh

# version=1.11.2
version=1.12.1

rm -Rf share/crystal-ic

# Fetch the crystal-i interpreter from the official crystal repo:
curl -L https://github.com/crystal-lang/crystal/archive/refs/tags/$version.zip > crystal.zip
unzip crystal

mkdir -p share/crystal-ic
mv crystal-$version/src share/crystal-ic/src
mv crystal-$version/lib share/crystal-ic/lib
mv crystal-$version/Makefile share/crystal-ic/
mv crystal-$version/LICENSE share/crystal-ic/
rm -Rf crystal.zip crystal-$version

But keep in mind that doing this could break IC if the compiler internal have changed.

@zw963
Copy link
Author

zw963 commented Apr 23, 2024

It works! please see screenshot! (although there is no lib folder anymore)

image

I will do this when next time crystal update it version before create new issue here, and let you know if it works, thanks!

@zw963 zw963 closed this as completed Apr 23, 2024
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

2 participants