unboxedtype / light

5 stars 2 forks source link

run samples/Sample1on ubuntu #5

Open ilyar opened 1 year ago

ilyar commented 1 year ago

after fix https://github.com/unboxedtype/light/pull/6

build

git clone https://github.com/unboxedtype/light
cd light
sudo snap install dotnet-sdk  --classic
make build
ln -s $(pwd)/src/LHCompiler/bin/Release/net6.0/linux-x64/LHCompiler ~/bin/LHCompiler
export PATH=$PATH:$(pwd)/scripts/
export PATH=$PATH:$(pwd)/src/LHCompiler/bin/Release/net6.0/linux-x64
cd samples/Sample1
bash test.sh

log

fift found 
LHCompiler found 
tvm_linker found 
tonos-cli found 
genActorMessage.fsx found 
serializeExpression.fsx found 
Compiling...
args = "-c "dotnet fsi $(which serializeExpression.fsx) ./Sample1.lh ActorState '{ seqNo = 1; deployed = false; salt = 2664; state = { counter = 10; sum = 0 } }'""
Error: Shell command executed with the error: 

/home/ilyar/hack/light/scripts/serializeExpression.fsx(3,1): error FS0078: Unable to find the file '../src/LHCompiler/bin/Debug/net6.0/FsLexYacc.Runtime.dll' in any of
 /snap/dotnet-sdk/210/shared/Microsoft.NETCore.App/7.0.7
 /snap/dotnet-sdk/210/packs/Microsoft.NETCore.App.Ref/7.0.7/ref/net7.0
 /home/ilyar/hack/light/scripts
 /snap/dotnet-sdk/210/sdk/7.0.304/FSharp/

; output: 

Source: FSharp.Core
Compilation errors.. Exiting

run

./src/LHCompiler/bin/Debug/net6.0/LHCompiler /usr/bin/LHCompiler
bash: ./src/LHCompiler/bin/Debug/net6.0/LHCompiler: No such file or directory
unboxedtype commented 1 year ago

Спасибо за issue! Починил. Попробуй пожалуйста еще раз, если будет возможность. Сам я попробовал на свежей Ubuntu 22 - заработало.

Также хочу заметить, что tvm_linker, используемый в light, отличается от того, который у EverScale - классический tvm_linker запускают виртуальную машину с не вполне подходящими Capabilities.

ilyar commented 1 year ago
git clone https://github.com/unboxedtype/light
cd light
git log -n 1 --pretty=format:%h
c68735a
make clean
make build
dotnet build src/LHCompiler/
MSBuild version 17.6.3+07e294721 for .NET
  Determining projects to restore...
  Restored /home/coder/hack/light/src/LHCompiler/LHCompiler.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/Parser/Parser.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/LHTypes/LHTypes.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/FiftExecutor/FiftExecutor.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/LHExpr/LHExpr.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/LHMachine/LHMachine.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/TVM/TVM.fsproj (in 216 ms).
  Restored /home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fsproj (in 216 ms).
/home/coder/hack/light/src/TVM/TVM.fs(1362,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/TVM/TVM.fsproj]
/home/coder/hack/light/src/TVM/TVM.fs(1637,7): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/TVM/TVM.fsproj]
  FiftExecutor -> /home/coder/hack/light/src/FiftExecutor/bin/Debug/net6.0/FiftExecutor.dll
  TVM -> /home/coder/hack/light/src/TVM/bin/Debug/net6.0/TVM.dll
  LHTypes -> /home/coder/hack/light/src/LHTypes/bin/Debug/net6.0/LHTypes.dll
/home/coder/hack/light/src/LHExpr/LHExpr.fs(129,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/LHExpr/LHExpr.fsproj]
/home/coder/hack/light/src/LHExpr/LHExpr.fs(133,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/LHExpr/LHExpr.fsproj]
  LHExpr -> /home/coder/hack/light/src/LHExpr/bin/Debug/net6.0/LHExpr.dll
/home/coder/hack/light/src/Parser/ParserModule.fs(38,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/Parser/Parser.fsproj]
/home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fs(410,25): warning FS0025: Incomplete pattern matches on this expression. For example, the value 'ADT (_)' may indicate a case not covered by the pattern(s). [/home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fsproj]
^CAttempting to cancel the build...
/snap/dotnet-sdk/210/sdk/7.0.304/FSharp/Microsoft.FSharp.Targets(325,9): warning MSB5021: Terminating the task executable "dotnet" and its child processes because the build was canceled. [/home/coder/hack/light/src/Parser/Parser.fsproj]
/snap/dotnet-sdk/210/sdk/7.0.304/FSharp/Microsoft.FSharp.Targets(325,9): warning MSB5021: Terminating the task executable "dotnet" and its child processes because the build was canceled. [/home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fsproj]

Build FAILED.

/home/coder/hack/light/src/TVM/TVM.fs(1362,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/TVM/TVM.fsproj]
/home/coder/hack/light/src/TVM/TVM.fs(1637,7): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/TVM/TVM.fsproj]
/home/coder/hack/light/src/LHExpr/LHExpr.fs(129,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/LHExpr/LHExpr.fsproj]
/home/coder/hack/light/src/LHExpr/LHExpr.fs(133,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/LHExpr/LHExpr.fsproj]
/home/coder/hack/light/src/Parser/ParserModule.fs(38,11): warning FS0026: This rule will never be matched [/home/coder/hack/light/src/Parser/Parser.fsproj]
/home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fs(410,25): warning FS0025: Incomplete pattern matches on this expression. For example, the value 'ADT (_)' may indicate a case not covered by the pattern(s). [/home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fsproj]
/snap/dotnet-sdk/210/sdk/7.0.304/FSharp/Microsoft.FSharp.Targets(325,9): warning MSB5021: Terminating the task executable "dotnet" and its child processes because the build was canceled. [/home/coder/hack/light/src/Parser/Parser.fsproj]
/snap/dotnet-sdk/210/sdk/7.0.304/FSharp/Microsoft.FSharp.Targets(325,9): warning MSB5021: Terminating the task executable "dotnet" and its child processes because the build was canceled. [/home/coder/hack/light/src/LHTypeInfer/LHTypeInfer.fsproj]
    8 Warning(s)
    0 Error(s)

Time Elapsed 00:00:08.89
make: *** [Makefile:4: build] Error 1
ln -s $(pwd)/src/LHCompiler/bin/Debug/net6.0/LHCompiler ~/bin/LHCompiler
ln: failed to create symbolic link '/home/ilyar/bin/LHCompiler': File exists
ilyar commented 1 year ago

rev: fa87621

git clone https://github.com/unboxedtype/light
cd light
git log -n 1 --pretty=format:%h
fa87621
make clean
make build
ln -s $(pwd)/src/LHCompiler/bin/Debug/net6.0/LHCompiler ~/bin/LHCompiler

LHCompiler
You must install .NET to run this application.

App: /home/coder/hack/light/src/LHCompiler/bin/Debug/net6.0/LHCompiler
Architecture: x64
App host version: 6.0.18
.NET location: Not found

Learn about runtime installation:
https://aka.ms/dotnet/app-launch-failed

Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=ubuntu.20.04-x64&apphost_version=6.0.18

unboxedtype commented 1 year ago

А из какого пакета .NET устанавливал? Под Ubuntu есть snap, а есть другой. Я тестировал под вторым, а ты кажется используешь первый. Наверное, между ними есть хитрая разница, которую нужно тоже учесть.

ilyar commented 1 year ago

image другой это какой? может быть есть последовательность шагов для ubuntu которая позволит запустить примеры?

unboxedtype commented 1 year ago

Я делал $ sudo apt install dotnet-sdk-6.0 С этим пакетом .NET, у меня всё собралось так, как и на моей Fedora, и бинарник лежит в ./light/src/LHCompiler/bin/Debug/net6.0/LHCompiler Процедуру сборки не отлаживал, не до того сейчас.