lf-lang / vscode-lingua-franca

Lingua Franca extension for Visual Studio Code
Other
5 stars 3 forks source link

npm run compile fails on main #168

Closed soerendomroes closed 1 month ago

soerendomroes commented 2 months ago

Running nom run compile as suggested here for local debugging returns fails for me.

sh: 1: cd: can't cd to ./editor-support/lfwasm

If the folder is created by me, this returns the following:

make: *** No targets specified and no makefile found.  Stop.

Moreover, git pull --recurse-submodules returns Could not access submodule 'editor-support'.

What am I missing here?

I just want to build the VS Code extension without building the whole language server with it.

lhstrh commented 2 months ago

There's some functionality we implemented in Rust that needs to be built. The editor-support repo is public, so I'm not sure why you're not able to pull.

soerendomroes commented 2 months ago

If I clone it manually, I still get the following error message:

> vscode-lingua-franca@0.8.0 compile
> cd ./editor-support/lfwasm && make && cd ../.. && rimraf ./lfw-pkg && move-cli ./editor-support/lfwasm/pkg ./lfw-pkg && bash ./write-version-to-file.sh src/extension_version.ts && npm run transpile

wasm-pack build . || npx -y wasm-pack build .
/bin/sh: 1: wasm-pack: not found
Error: failed to start `cargo metadata`: No such file or directory (os error 2)
Caused by: failed to start `cargo metadata`: No such file or directory (os error 2)
Caused by: No such file or directory (os error 2)
make: *** [Makefile:2: pkg] Error 1

Running npm run transpile to skip this also fails.

npm run transpile

> vscode-lingua-franca@0.8.0 transpile
> webpack

sh: 1: webpack: not found

What else am I missing? What npm/node versions are you using and where are you documenting it?

lhstrh commented 2 months ago

The errors are pretty clear: it's looking for wasm-pack but it's not found...

soerendomroes commented 2 months ago

That is not my point. I cannot contribute to the project if it is not properly document how it can be built. I could have fixed a few issues, tried interesting things but I have to search for documentation that does not exist on how to build this.

I propose that the CONTRIBUTING.md should be kept up to date to let people actually contribute. I do not have the time to search a few hours for all the things and versions that need to be changed to just run something.

I hope that you understand that this is annoying.

cmnrd commented 2 months ago

As you can probably imagine, maintaining this project and keeping everything up to date is a lot of work. I think everyone agrees that things should be kept up to date. However, stating that things should be up to date is not going to help us achieve it. You are more than welcome to help the community effort and update the documentation based on the problems you faced and lessons you learned. That would be highly appreciated.

soerendomroes commented 2 months ago

I would gladly do this, but I am missing the time to understand what Peter was doing in this PR https://github.com/lf-lang/vscode-lingua-franca/pull/162. Maybe @petervdonovan could update the contributing.md such that I can work out the small things that might be missing for me.

I just want to be able to run npm run compile or transpile again to just build the Javascript stuff to be able to launch the extension. This does however require webpack to be available, which any of the scripts that fails for me might install. I also do not understand whether WASM should build automatically or not. The PR suggests that the comment that was added to the contributing.md regarding installing WASM is outdated and that it should be removed, but this did not happen.

The changes to the package.json since April 2024 completely overhauled how the build works. I am sorry, but at this state I cannot improve the documentation anymore since I cannot get anything to run.

soerendomroes commented 2 months ago

My current workaround is to run npm install and stop and once all devDependencies are installed since I do not want to override my local VS Code extension and remove all wasm stuff from the build.

soerendomroes commented 1 month ago

After your fix, my npm install outputs the following using npm v18.17.0, maybe I am missing something?

> vscode-lingua-franca@0.8.2 install
> npm run clean && npm run build && npm run package && npm run deploy

> vscode-lingua-franca@0.8.2 clean
> rimraf out && rimraf lib && rimraf lingua-franca/lsp/build && rimraf vscode-lingua-franca-*.vsix

> vscode-lingua-franca@0.8.2 build
> npx ts-node src/build_lds.ts

> checking dependencies...
> code [found]
> jar [found]
> javac [found]
> mvn [found]
> python3 [found]
> verifying Java compiler version...
> Java compiler version is 17.0.12
> updating Git submodules...
> starting Gradle build...
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.8/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build 

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.8/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 30s
21 actionable tasks: 8 executed, 13 up-to-date

> vscode-lingua-franca@0.8.2 package
> move-cli lingua-franca ../temp-lingua-franca89539275 && (vsce package; move-cli ../temp-lingua-franca89539275 lingua-franca)

Executing prepublish script 'npm run vscode:prepublish'...

> vscode-lingua-franca@0.8.2 vscode:prepublish
> npm run compile

> vscode-lingua-franca@0.8.2 compile
> cd ./editor-support/lfwasm && make && cd ../.. && rimraf ./lfw-pkg && move-cli ./editor-support/lfwasm/pkg ./lfw-pkg && bash ./write-version-to-file.sh src/extension_version.ts && npm run transpile

wasm-pack build . || npx -y wasm-pack build .
/bin/sh: 1: wasm-pack: not found
Error: failed to start `cargo metadata`: No such file or directory (os error 2)
Caused by: failed to start `cargo metadata`: No such file or directory (os error 2)
Caused by: No such file or directory (os error 2)
make: *** [Makefile:2: pkg] Error 1
 ERROR  npm failed with exit code 2

> vscode-lingua-franca@0.8.2 deploy
> echo "Y
> " | code --install-extension vscode-lingua-franca-*.vsix --force

Installing extensions...
Error: ENOENT: no such file or directory, open '/home/sdo/Documents/repos/vscode-lf/vscode-lingua-franca/vscode-lingua-franca-*.vsix'
    at c (/snap/code/165/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:18:2260)
    at /snap/code/165/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:18:3710
    at /snap/code/165/usr/share/code/resources/app/node_modules.asar/yauzl/index.js:37:21
    at FSReqCallback.oncomplete (node:fs:189:23) {
  code: 'Extract',
  name: 'Extract'
}
Failed Installing Extensions: file:///home/sdo/Documents/repos/vscode-lf/vscode-lingua-franca/vscode-lingua-franca-%2A.vsix
npm ERR! code 1
npm ERR! path /home/sdo/Documents/repos/vscode-lf/vscode-lingua-franca
npm ERR! command failed
npm ERR! command sh -c npm run clean && npm run build && npm run package && npm run deploy

npm ERR! A complete log of this run can be found in: /home/sdo/.npm/_logs/2024-08-05T11_15_56_015Z-debug-0.log

Moreover, I don't think that install should build the whole language server and install the extension locally. Typically, install just install the dependencies such that a npm run compile or npm run watch can work as intended. Also, I am also unsure why a Typescript project needs rust.

soerendomroes commented 1 month ago

Update, I guess, I did not have rust on my path or something from cargo was missing.