barisssss / pdRemoteVscode

Do What The F*ck You Want To Public License
2 stars 1 forks source link

Build issues #2

Closed agraef closed 1 year ago

agraef commented 1 year ago

make tries to install @vscode/vsce each time it is invoked. That shouldn't be needed.

Also, on Linux it fails if run as ordinary user. That should never happen. People expect to run make install using sudo, but not make which is supposed to just build the software and not install anything (yet).

If I still try to run sudo make, this is what I get:

Building Pd Remote VS Code...
npm install -g @vscode/vsce

changed 106 packages, and audited 107 packages in 2s

31 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
vsce package
Executing prepublish script 'npm run vscode:prepublish'...

> pd-remote-vscode@1.0.1 vscode:prepublish
> npm run compile

npm WARN logfile Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm WARN logfile  error cleaning log files [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
npm WARN logfile   errno: -13,
npm WARN logfile   code: 'EACCES',
npm WARN logfile   syscall: 'scandir',
npm WARN logfile   path: '/root/.npm/_logs'
npm WARN logfile }

> pd-remote-vscode@1.0.1 compile
> tsc -p ./

sh: line 1: tsc: command not foundile Error: EACCES: permission denied, scandir '/root/.n
 ERROR  npm failed with exit code 127
make: *** [Makefile:7: build] Error 1

The output at the bottom seems garbled, but it seems to complain both about a missing tsc command, and still missing some permissions in spite of running this as root.

In any case, I'm really worried that it wants root access just to build the package. That's a no-go for me.

So the Makefile doesn't seem to work at all on Linux. I'm running this on Arch -- Manjaro, more precisely, with visual-studio-code 1.75.1 installed from the Arch User Repositories, code is on PATH. npm is 8.19.2-1 installed from the official Arch repositories.

Trying to just run vsce package (without sudo) manually (after sudo npm install -g @vscode/vsce) also doesn't work, it complains about that missing tsc command again:

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

> pd-remote-vscode@1.0.1 vscode:prepublish
> npm run compile

> pd-remote-vscode@1.0.1 compile
> tsc -p ./

sh: line 1: tsc: command not found
 ERROR  npm failed with exit code 127

Looks like I probably miss some typescript bits and bobs there? Where can I find that tsc command?

agraef commented 1 year ago

Ah ok, that's the typescript compiler, which isn't included in vscode, but can apparently be installed with npm.

agraef commented 1 year ago

It then still misses a bunch of other packages which are used by the project, but it seems that after installing @vscode/vsce globally, all the rest can just be installed locally with npm install. Which also needs to be done once before running vsce package.

Ok, I think I grok this now and can fix the Makefile myself. Stay tuned...

agraef commented 1 year ago

Fix available in #3. Works for me now on Linux, will try on Mac later.

Update: Tried on Mac using npm from Homebrew, works like a charm. (And of course doesn't need root there when using npm from Homebrew.)

agraef commented 1 year ago

BTW, are those vsix packages fully portable? I'd hope so, they're simply javascript in a binary package, right? Or must they be built for every target platform?

agraef commented 1 year ago

Just built the package on a MacBook M1 Air, then took that vsix file and installed it into VS Code on Windows, works. I guess that this answers my question. :)