Code Monkey home page Code Monkey logo

Comments (11)

abrams27 avatar abrams27 commented on July 29, 2024 2

btw, version parser has been updated (you can use homebrew version): #68

from bazel-bsp.

ckipp01 avatar ckipp01 commented on July 29, 2024 1

temporary workaround would be changing to version without homebrew suffix (4.*.* preferable)

second option is to update a source code locally - change SEMANTIC_VERSION_REGEX value into ^([0-9]+)\\.([0-9]+)\\.([0-9]+)-homebrew

👍🏼 bingo that did it. I uninstalled with Brew and just did a manual install, and we are back in business. Thanks for helping me track that down! Looking forward to digging more into this.

from bazel-bsp.

abrams27 avatar abrams27 commented on July 29, 2024

Hi, thanks a lot for such detailed explanation!

Lots of things have changed, but we forgot to update readme (fixed yesterday).

Initialization is quite tricky -- we'll try to simplify it somehow. Also, currently it's still 0.1.0, but as far as I know we'll try to introduce next verstion soon. Nevertheless, this should help you:

In bazel-bsp project reposiotry:

./buildAndRunLocally.sh

And then in the target repository:

coursier launch -r sonatype:snapshots -r central -r file:///~/.m2/repository org.jetbrains.bsp:bazel-bsp:0.1.0 -M org.jetbrains.bsp.bazel.install.Install

(all files, incuding ./bsp/.bazelbsp should be created)

from bazel-bsp.

ckipp01 avatar ckipp01 commented on July 29, 2024

And then in the target repository:

So something seems to not be fully publishing correctly since if I do those exact steps in my target repo or even on a fresh clone of this repository I end up with:

~/Documents/java-workspace/bazel-bsp dev
❯ ./buildAndRunLocally.sh
Building server...
============================
INFO: Analyzed target //src/main/java/org/jetbrains/bsp/bazel:bsp-install (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //src/main/java/org/jetbrains/bsp/bazel:bsp-install up-to-date:
  bazel-bin/src/main/java/org/jetbrains/bsp/bazel/bsp-install.jar
  bazel-bin/src/main/java/org/jetbrains/bsp/bazel/bsp-install
INFO: Elapsed time: 0,130s, Critical Path: 0,00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action


Running server at /Users/ckipp/Documents/java-workspace/bazel-bsp
============================
Bazel BSP server installed in


Done!

~/Documents/java-workspace/bazel-bsp dev
❯ coursier launch -r sonatype:snapshots -r central -r file:///~/.m2/repository org.jetbrains.bsp:bazel-bsp:0.1.0 -M org.jetbrains.bsp.bazel.install.Install

Error: Could not find or load main class org.jetbrains.bsp.bazel.install.Install
Caused by: java.lang.ClassNotFoundException: org.jetbrains.bsp.bazel.install.Install

Note that using the script and passing in the dir for the target or just letting it run in the current dir does create the .bsp/bazelbsp.json file, but then I still on it never responding to the initialization request.

from bazel-bsp.

abrams27 avatar abrams27 commented on July 29, 2024

Sorry for this misunderstanding. Obviously I messed up -- this should help you:

in bsp-bazel repo:

bazel build //src/main/java/org/jetbrains/bsp/bazel:bsp-install
export bsp_path="$(bazel info bazel-bin)/src/main/java/org/jetbrains/bsp/bazel/bsp-install"

and then in your repo:

$bsp_path

(it worked for me)

Like I said - it's a bit tricky, tricky enough to trick me.

Sorry for this

from bazel-bsp.

ckipp01 avatar ckipp01 commented on July 29, 2024

No worries at all, thanks for the explanation. If I'm not mistaken that should be the same as just doing ./buildAndRunLocally.sh <path to repo>. However your instructions correctly create the bsp dirs, but unfortunately I still have the initial issue of it not being able to connect.

2021.06.19 09:11:24 ERROR Timeout waiting for 'build/initialize' response
2021.06.19 09:11:24 ERROR Failed to connect with build server, no functionality will work.

Any tips on debugging what my be happening on the bazel-bsp side? If not I'll just start doing a deep dive into trying to figure out what's happening.

from bazel-bsp.

abrams27 avatar abrams27 commented on July 29, 2024

If I'm not mistaken that should be the same as just doing ./buildAndRunLocally.sh

yep

I tested it on my own with intellij client and everything succeed.

What version of bazel are you using? bazel version

Maybe your client doesnt create conection correctly or something? does it happen only with bazel-bsp, or maybe other bsp implementations have similiar problems?

from bazel-bsp.

ckipp01 avatar ckipp01 commented on July 29, 2024

What version of bazel are you using? bazel version

❯ bazel version
Build label: 4.1.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800

Maybe your client doesnt create conection correctly or something? does it happen only with bazel-bsp, or maybe other bsp implementations have similiar problems?

So by default Metals uses Bloop, but we've also tested with sbt as a BSP server and also Mill. All of them initialize correctly with Metals. There is a much better chance of me just totally missing something then our BSP discovery and initialization process not working right. It should be pretty battle tested since we fully rely on it working.

I just actually tested with IntelliJ as well, and I actually got a bit more info. When I do try to load the BSP project (this repo) via intelliJ it fails with:

java.lang.IllegalArgumentException: Invalid version format

	at org.jetbrains.bsp.bazel.server.bazel.data.SemanticVersion.<init>(SemanticVersion.java:27)

	at org.jetbrains.bsp.bazel.server.bazel.data.SemanticVersion.fromReleaseData(SemanticVersion.java:51)

	at org.jetbrains.bsp.bazel.server.bazel.data.BazelData.<init>(BazelData.java:21)

	at org.jetbrains.bsp.bazel.server.bazel.BazelDataResolver.resolveBazelData(BazelDataResolver.java:30)

	at org.jetbrains.bsp.bazel.server.BazelBspServer.<init>(BazelBspServer.java:48)

	at org.jetbrains.bsp.bazel.server.ServerInitializer.main(ServerInitializer.java:49)

Which does give me some places to dig into.

from bazel-bsp.

abrams27 avatar abrams27 commented on July 29, 2024

okey, I believe that our parser is not prepared for the *-homebrew version, I'll try to address this issue

from bazel-bsp.

abrams27 avatar abrams27 commented on July 29, 2024

temporary workaround would be changing to version without homebrew suffix (4.*.* preferable)

second option is to update a source code locally - change SEMANTIC_VERSION_REGEX value into ^([0-9]+)\\.([0-9]+)\\.([0-9]+)-homebrew

from bazel-bsp.

abrams27 avatar abrams27 commented on July 29, 2024

Great! Hopefully everything'll be fine now.

If you have any further questions / problems dont hesitate to contact us

from bazel-bsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.