anoma / vscode-juvix

VSCode extension for Juvix
https://marketplace.visualstudio.com/items?itemName=heliax.juvix-mode
GNU General Public License v3.0
3 stars 2 forks source link

Typecheck and compile functionality fails #130

Closed heueristik closed 2 months ago

heueristik commented 3 months ago

Summary

The typecheck and compile buttons in the Juvix VS Code plugin result in errors preventing correct code highlighting and definition search. On the CLI, the same type checking and compilation works without problems.

Example Project

following example project

.
├── Hello.juvix
└── Package.juvix

Package.juvix

module Package;

import PackageDescription.V2 open;

package : Package :=
  defaultPackage
    {name := "anoma";
     version := mkVersion 0 1 0;
     dependencies := [ defaultStdlib
                     ; github "anoma" "juvix-anoma-stdlib" "main"
                     ]};

Hello.juvix

module Hello;
import Stdlib.Prelude open;
import Anoma.Transaction open;

main : String := "Hello world!";

After running juvix dependencies update, the following juvix.lock.yaml file is correctly produced

version: 2
checksum: ba5a40db0be704d362c2a0184663856a1451c907e1b06d27e135c1eafb769209
dependencies:
- path: .juvix-build/stdlib/
  dependencies: []
- git:
    name: anoma_juvix-anoma-stdlib
    ref: 5c72a64d5c9d17ad289c3c72d340a7ef3857bd10
    url: https://github.com/anoma/juvix-anoma-stdlib
  dependencies:
  - path: .juvix-build/stdlib/
    dependencies: []

Afterward, the juvix typecheck Hello.juvix and juvix compile native Hello.juvix command run successfully in the terminal.

Problem

Triggering the typecheck through the vscode plugin button results in the folliwung error:

/Users/<USERNAME>/Projects/Anoma/sandbox/Package.juvix:1:1: error:
The dependency /private/var/folders/62/fl3kvblx6jj7p013xzpmdylc0000gn/T/.juvix-build5syPKX/stdlib/ is declared in the package's juvix.yaml but is not declared in the lockfile: /Users/<USERNAME>/Projects/Anoma/sandbox/juvix.lock.yaml
Try running the following command:
juvix dependencies update

 *  The terminal process "/bin/zsh '-l', '-c', '/Users/<USERNAME>/.local/bin/juvix --internal-build-dir /var/folders/62/fl3kvblx6jj7p013xzpmdylc0000gn/T/.juvix-build5syPKX  typecheck /Users/<USERNAME>/Projects/Anoma/sandbox/Hello.juvix'" failed to launch (exit code: 1). 

Triggering compilation through the vscode compilation button results in an error too:

Invalid option `--output'

Usage: juvix compile COMMAND

  Compile a Juvix file

 *  The terminal process "/bin/zsh '-l', '-c', '/Users/<USERNAME>/.local/bin/juvix --internal-build-dir /var/folders/62/fl3kvblx6jj7p013xzpmdylc0000gn/T/.juvix-buildslaN1t compile --output /var/folders/62/fl3kvblx6jj7p013xzpmdylc0000gn/T/.juvix-buildbNPvRt/out /Users/<USERNAME>/Projects/Anoma/sandbox/Hello.juvix && /var/folders/62/fl3kvblx6jj7p013xzpmdylc0000gn/T/.juvix-buildbNPvRt/out'" failed to launch (exit code: 1). 

Info

System arch: Apple M1 OS: macOS 14.5 (23F79) Juvix: v0.6.2-371f8f2

VS Code Version: 1.90.0 (Universal) Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573 Date: 2024-06-04T19:34:44.157Z (5 days ago) Electron: 29.4.0 ElectronBuildId: 9593362 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.5.0