hxcpp-debugger icon indicating copy to clipboard operation
hxcpp-debugger copied to clipboard

Please help publish vshaxe.hxcpp-debugger to OpenVSX

Open jankeromnes opened this issue 3 years ago • 18 comments

Hello! 👋

It would be awesome to have vshaxe.hxcpp-debugger published on https://open-vsx.org, to make it available for non-Microsoft tools like VSCodium, Gitpod, Theia, etc.

  • Probably the best way to achieve this would be for a vshaxe.hxcpp-debugger maintainer to just run npx ovsx publish when they also publish to Microsoft VSCode marketplace (no dependencies needed, just an OVSX_PAT token)

  • If that's not an option, we'd be happy to publish it ourselves. We can do that via our auto-publish CI (with some limitations) by re-publishing an official .vsix release, or by attempting to re-package the extension ourselves


We've even already tried publishing ourselves. Since we couldn't find an official .vsix release (outside of Microsoft's marketplace, which forbids access to non-Microsoft tools), we've tried repackaging it like so:

git clone --recurse-submodules https://github.com/vshaxe/hxcpp-debugger
cd hxcpp-debugger
git checkout 1.2.4
npm install
npm install haxe
npx haxelib install vscode-debugadapter
npx haxelib install vscode
npx ovsx publish

However, this currently fails with:

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

> [email protected] vscode:prepublish /tmp/repository
> haxe build.hxml

src/Adapter.hx:4: characters 7-27 : Type not found : protocol.debug.Types

Could you please help get vshaxe.hxcpp-debugger published to OpenVSX? By order of preference:

  1. Could a maintainer please just run npx ovsx publish (with an OVSX_PAT token)?

  2. Or, could you please provide an official .vsix file (outside Microsoft's proprietary marketplace)?

  3. Or, could you please help resolve the above error to help us re-package vshaxe.hxcpp-debugger ourselves?

Many thanks! 🙏

jankeromnes avatar Nov 30 '20 09:11 jankeromnes

We have instructions here: https://github.com/vshaxe/hxcpp-debugger#installing-from-source

We don't use npm-haxe, we use lix. npm install should do all that's needed (lix download, which downloads the correct Haxe version and dependencies). Installing npm-haxe on top of lix might create conflicts - not sure, I've never tried that.

Gama11 avatar Nov 30 '20 18:11 Gama11

Thanks @Gama11!

Following these official instructions, we initially got this:

$ git clone --recurse-submodules https://github.com/vshaxe/hxcpp-debugger
$ cd hxcpp-debugger
$ git checkout 1.2.4
$ npm install
$ npx ovsx publish

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

> [email protected] vscode:prepublish /tmp/repository
> haxe build.hxml

/bin/bash: haxe: command not found

Then, seeing the npx haxe build.hxml in your instructions, we assumed that running npm install haxe would install the same library you're using.

I'm not sure why the lix download postinstall step doesn't give us haxe. I'll try to see if (re-)running this explicitly helps.

jankeromnes avatar Nov 30 '20 18:11 jankeromnes

It doesn't give you haxe, it gives you npx haxe. There's no need to specify this in prepublish since node_modules/.bin is part of the PATH in npm scripts.

Gama11 avatar Nov 30 '20 19:11 Gama11

Thanks @Gama11!

So, in trying to re-package vshaxe.hxcpp-debugger ourselves (option 3. from https://github.com/vshaxe/hxcpp-debugger/issues/26#issue-753304314) we're now at this stage:

$ git clone --recurse-submodules https://github.com/vshaxe/hxcpp-debugger
$ cd hxcpp-debugger
$ git checkout 1.2.4
$ npm install
$ lix download

Error: Command failed: lix download
/bin/sh: 1: lix: not found

How can we install lix? Maybe npm install lix?

EDIT: Ah, or maybe we need to execute npm run postinstall manually? Or maybe we need to fix our PATH?

jankeromnes avatar Dec 01 '20 11:12 jankeromnes

You don't need to run lix download manually since it's a postinstall step already. But if you were to do it manually it'd have to be npx lix download.

Gama11 avatar Dec 01 '20 11:12 Gama11

You don't need to run lix download manually since it's a postinstall step already.

Aha, thanks. I tried that in order to fix the /bin/bash: haxe: command not found error I got in https://github.com/vshaxe/hxcpp-debugger/issues/26#issuecomment-735974143

But if you were to do it manually it'd have to be npx lix download.

Thanks! Maybe that will fix it (sorry, I'm not very used to the Haxe tooling/ecosystem.)

jankeromnes avatar Dec 01 '20 11:12 jankeromnes

Aha, thanks. I tried that in order to fix the /bin/bash: haxe: command not found error I got in #26 (comment)

I don't see how that could help. It sounds more like this ovsx tool has an incorrect PATH while running the prepublish step.

Gama11 avatar Dec 01 '20 12:12 Gama11

I don't see how that could help.

My current theory is that for some reason, lix download is not being run after npm install, or it has an error that isn't visible. So I'm try to (re-)run it explicitly in order to see what it does.

Based on https://github.com/vshaxe/hxcpp-debugger/issues/26#issuecomment-735954299, I'm expecting npx lix download to download Haxe:

(lix download, which downloads the correct Haxe version and dependencies)


It sounds more like this ovsx tool has an incorrect PATH while running the prepublish step.

That may very well be the case, although ovsx package basically just runs vsce package, which itself probably delegates a lot of stuff to node/npm.

Still, a mis-configured PATH could be the reason why npm run vscode:prepublish cannot find haxe after npm install in https://github.com/vshaxe/hxcpp-debugger/issues/26#issuecomment-735974143.

jankeromnes avatar Dec 01 '20 12:12 jankeromnes

Ok, here is the error that prevents lix download from working properly:

$ npx lix download
Error: Command failed: npx lix download
Version stable configured in /home/runner/haxe/.haxerc does not exist. Attempting download ...
Looking up Haxe version "stable" online
  Resolved to official release 4.1.4. Downloading ...
Downloading Haxe: official release 4.1.4
-> Done!
  ... download complete!
(unknown) : Package "download" was not found in any of class paths
    at ChildProcess.exithandler (child_process.js:308:12)
    at ChildProcess.emit (events.js:314:20)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

jankeromnes avatar Dec 05 '20 13:12 jankeromnes

Are you sure that's being run from the correct working directory?

Version stable configured in /home/runner/haxe/.haxerc does not exist. Attempting download ..

It should not be using that global .haxerc file, but that from the cwd / this repo.

Gama11 avatar Dec 05 '20 13:12 Gama11

What should be the correct working directory?

The ‘npx lix download’ above is being run in the root of this repository.

jankeromnes avatar Dec 05 '20 13:12 jankeromnes

Yes, that's correct.

I don't understand the second part of the error message (Package "download" was not found in any of class paths), but as mentioned I think it's already going wrong earlier by downloading Haxe 4.1.4 - this repo specifies 4.0.5. Perhaps it's a lix bug. Can you reproduce this locally, or does that only happen on your CI environment?

Running npx lix download (with a fresh lix cache, otherwise it'd be a noop / not output anything) works fine for me:

> npx lix download
Neko seems to be missing. Attempting download ...
-> Done!
done
Downloading Haxe: official release 4.0.5
-> Done!
Installed 3 libraries.

> npx haxe build.hxml

>

Gama11 avatar Dec 05 '20 14:12 Gama11

Can you reproduce this locally, or does that only happen on your CI environment?

I tried reproducing this locally in a minimal Dockerfile:

FROM ubuntu:focal
SHELL ["/bin/bash", "-c"]

# Install Git, Node.js and npm
RUN apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -yq git nodejs npm

# Re-package vshaxe/hxcpp-debugger
RUN git clone --recurse-submodules https://github.com/vshaxe/hxcpp-debugger && \
    cd hxcpp-debugger && \
    git checkout 1.2.4 && \
    npm install && \
    npm run vscode:prepublish

This fails with:

> [email protected] vscode:prepublish /hxcpp-debugger
> haxe build.hxml

sh: 1: haxe: not found

Also, various attempts to get haxe via lix were unsuccessful. Is there another way to install haxe?

Or, maybe easier, is there any chance you may re-consider option 1. or 2. from https://github.com/vshaxe/hxcpp-debugger/issues/26#issue-753304314?

Could you please help get vshaxe.hxcpp-debugger published to OpenVSX? By order of preference:

  1. Could a maintainer please just run npx ovsx publish (with an OVSX_PAT token)?

  2. Or, could you please provide an official .vsix file (outside Microsoft's proprietary marketplace)?

These may be a much more straightforward way to get vshaxe.hxcpp-debugger published on OpenVSX, so that users of VSCodium, Gitpod, Theia, Eclipse Che, etc. can use this extension.

jankeromnes avatar Dec 05 '20 20:12 jankeromnes

Oh, it's because you're checking out the 1.2.4 tag... this repo was not yet using lix at the time of the latest release.

Gama11 avatar Dec 05 '20 21:12 Gama11

Aha, thanks @Gama11. Would you have any ideas:

  • how to get haxe in the 1.2.4 tag (without using lix)?

  • when the next release (with lix) will be published?

jankeromnes avatar Dec 07 '20 08:12 jankeromnes

Well, it's not just about getting Haxe, also other dependencies (three in this case). I doubt you want to maintain that.

I don't know when the next release will be, but since there haven't really been any changes since 1.2.4 apart from CI / build system improvements it wouldn't really hurt to publish HEAD.

Gama11 avatar Dec 07 '20 09:12 Gama11

Well, it's not just about getting Haxe, also other dependencies (three in this case). I doubt you want to maintain that.

Well, we're already maintaining custom prepublish commands for 21 of the 273 extensions we auto-publish to OpenVSX. Maintaining one more isn't significant.

I don't know when the next release will be, but since there haven't really been any changes since 1.2.4 apart from CI / build system improvements it wouldn't really hurt to publish HEAD.

Awesome! That would be a big help.

Even bigger help would be if you can upload a .vsix file to your repository releases, and/or simply run npx ovsx publish after the VSCode publishing script.

jankeromnes avatar Dec 07 '20 10:12 jankeromnes

Ping @Gama11 -- could you please upload a .vsix file to your GitHub Releases? This would be super helpful to us 🙏

jankeromnes avatar Feb 01 '21 15:02 jankeromnes