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

Build java-test directly rather than depending on release asset #3083

Closed
wants to merge 1 commit into from

Conversation

brianrodri
Copy link

@brianrodri brianrodri commented Oct 14, 2023

Fixes #3036

Mason can't update to vscode-java-test > 0.39.0 because vscjava.vscode-java-test-XX.vsix is no longer included in the release assets.

microsoft/vscode-java-test#1594 instructs users to build it themselves by following their GitHub Workflow script. Specifically, the command npm run build-plugin generates all of the .jar files in the server/ directory.

Unfortunately, this directory is different than extension/server/. This would break pretty much every plugin depending on the location of those .jar files.

I can only think to add additional build.run steps to move to the expected directory in a platform-independent way. I'm not sure if that's desired/necessary, or maybe there's an existing way to correct this behavior? I tried exporting to the correct share/ directory, but the plugin I've been testing with, LazyVim, depends on the install location not the share location.

Would appreciate some guidance here!

@williambotman williambotman requested a review from a team October 14, 2023 15:32
@brianrodri brianrodri marked this pull request as draft October 14, 2023 15:35
@brianrodri brianrodri marked this pull request as ready for review October 14, 2023 16:43
@nsoufian
Copy link

Any updates on this ?

@williamboman
Copy link
Member

Thanks for the PR! This introduces a number of external dependencies (node & npm being the most obvious ones). I'm not sure what the build-plugin script does entirely but I believe it simply builds things via maven. Microsoft seems to have removed assets from multiple of their projects, so java-test is not the only package that is unable to upgrade currently. I've been meaning to host built assets for these projects, probably through something similar to https://github.com/mason-org/julia-lsp. Surfacing these build commands directly to users will definitely cause issues and is a significant source of issue reports which is why I'm not keen on merging this as-is.

As for the share files, as long as they are in the same location as before within the share/ directory it would not be a breaking change. I believe it should be:

share:
  java-test/: server/

@williamboman
Copy link
Member

In the meantime, if you want to access this particular version of the package definition so that you can upgrade it, you can clone @brianrodri's fork and check out the fix-java-test branch and then configure Mason to source packages locally from your file system:

require("mason").setup {
  registries = {
    "file:~/path/to/mason-registry"
  }
}

Another option would be to add this package.yaml to your Neovim config by placing it in ~/.config/nvim/packages/java-test/package.yaml and then configuring Mason like so:

require("mason").setup {
  registries = {
    "file:" .. vim.fn.stdpath("config"),
    "github:mason-org/mason-registry",
  }
}

This way you can host your own package overrides inside your own Neovim config and version them accordingly.

@jvalkeal
Copy link

jvalkeal commented Dec 4, 2023

Just a heads up to those trying this route. All latest releases from vscode-java-test fail to build(main has fixes). microsoft/vscode-java-test#1633

@s1n7ax
Copy link

s1n7ax commented Dec 6, 2023

Hello. I have created a workflow that release build artifacts on new release of java-test. This is daily checking to see if there are new relea are available in the original project that's not available in the current releases.

NOTE that 0.40.1 release fail to build so at the moment I have used main branch to release the build artifacts.

https://github.com/nvim-java/vscode-java-test-releases

I have a custom mason registry to use the releases from this here

https://github.com/nvim-java/mason-registry

Adding the registry to mason & Mason should to the job. MasonInstall java-test@0.40.1 should install the newest version.

{
	'williamboman/mason.nvim',
	opts = {
		registries = {
			'github:nvim-java/mason-registry',
			'github:mason-org/mason-registry',
		},
	},
}

@williamboman
Copy link
Member

See #3348 (comment)

@brianrodri brianrodri deleted the fix-java-test branch December 29, 2023 05:23
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

Successfully merging this pull request may close these issues.

Updating java-test no longer possible
5 participants