Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help publish vshaxe.hxcpp-debugger to OpenVSX #26

Open
jankeromnes opened this issue Nov 30, 2020 · 18 comments
Open

Please help publish vshaxe.hxcpp-debugger to OpenVSX #26

jankeromnes opened this issue Nov 30, 2020 · 18 comments

Comments

@jankeromnes
Copy link

jankeromnes commented Nov 30, 2020

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! 🙏

@Gama11
Copy link
Member

Gama11 commented Nov 30, 2020

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.

@jankeromnes
Copy link
Author

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 added a commit to open-vsx/publish-extensions that referenced this issue Nov 30, 2020
@Gama11
Copy link
Member

Gama11 commented Nov 30, 2020

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.

@jankeromnes
Copy link
Author

jankeromnes commented Dec 1, 2020

Thanks @Gama11!

So, in trying to re-package vshaxe.hxcpp-debugger ourselves (option 3. from #26 (comment)) 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?

@Gama11
Copy link
Member

Gama11 commented Dec 1, 2020

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.

@jankeromnes
Copy link
Author

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 #26 (comment)

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 added a commit to open-vsx/publish-extensions that referenced this issue Dec 1, 2020
@Gama11
Copy link
Member

Gama11 commented Dec 1, 2020

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.

@jankeromnes
Copy link
Author

jankeromnes commented Dec 1, 2020

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 #26 (comment), 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 #26 (comment).

@jankeromnes
Copy link
Author

jankeromnes commented Dec 5, 2020

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)

@Gama11
Copy link
Member

Gama11 commented Dec 5, 2020

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.

@jankeromnes
Copy link
Author

What should be the correct working directory?

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

@Gama11
Copy link
Member

Gama11 commented Dec 5, 2020

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

>

@jankeromnes
Copy link
Author

jankeromnes commented Dec 5, 2020

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 #26 (comment)?

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.

@Gama11
Copy link
Member

Gama11 commented Dec 5, 2020

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.

@jankeromnes
Copy link
Author

jankeromnes commented Dec 7, 2020

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?

@Gama11
Copy link
Member

Gama11 commented Dec 7, 2020

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.

@jankeromnes
Copy link
Author

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
Copy link
Author

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

tennox pushed a commit to tennox/publish-extensions that referenced this issue Jan 21, 2022
tennox pushed a commit to tennox/publish-extensions that referenced this issue Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants