Git Product home page Git Product logo

Comments (10)

official-minister avatar official-minister commented on May 5, 2024

GoPath:
D:\GoogleAGI\agi-master\agi-master>echo %GOPATH%
D:\GPUProfiler\gapid\gapid-master\gapid-gofuse

from agi.

official-minister avatar official-minister commented on May 5, 2024

D:\GoogleAGI\agi-master\agi-master>go version
go version go1.14.2 windows/amd64

from agi.

hevrard avatar hevrard commented on May 5, 2024

The agi-gofuse directory should be outside of the AGI git checkout, see https://github.com/google/agi/blob/master/DEVDOC.md#setup-golang-development:

# Prepare a agi-gofuse directory **outside of the AGI checkout directory**
mkdir <path-outside-agi-source>/agi-gofuse

Can you try to delete your D:\GoogleAGI\agi-master\agi-gofuse directory, re-create one as e.g. D:\GoogleAGI\agi-gofuse, and re-run the //cmd/gofuse command and update your gopath accordingly?
(Moving your existing agi-gofuse won't work, you do need to create a fresh one and run cmd/gofuse.)

from agi.

official-minister avatar official-minister commented on May 5, 2024

The agi-gofuse directory should be outside of the AGI git checkout, see https://github.com/google/agi/blob/master/DEVDOC.md#setup-golang-development:

# Prepare a agi-gofuse directory **outside of the AGI checkout directory**
mkdir <path-outside-agi-source>/agi-gofuse

Can you try to delete your D:\GoogleAGI\agi-master\agi-gofuse directory, re-create one as e.g. D:\GoogleAGI\agi-gofuse, and re-run the //cmd/gofuse command and update your gopath accordingly?
(Moving your existing agi-gofuse won't work, you do need to create a fresh one and run cmd/gofuse.)

Thankyou very much, and My agi-gofuse dir is like this:
D: GoogleAGI
-------|______agi-master
------------------|________agi-gofuse
------------------|________agi-master
--------------------------------|_______gpis
--------------------------------|_______gpit
|bazel-bin
|....

and I run build cmd in dir D:\GoogleAGI\agi-master\agi-master
run dlv exec ./bazel-bin/pkg/gapis.exe also in dir : D:\GoogleAGI\agi-master\agi-master

I think the path is correct.( I do follow the instruction: https://github.com/google/agi/blob/master/DEVDOC.md#setup-golang-development. because I dowonload the zip and unzip it, it has a agi-master dir outside.)

from agi.

hevrard avatar hevrard commented on May 5, 2024

Thanks for clarifying, so it looks like your agi-gofuse directory is outside of your source directory D:\GoogleAGI\agi-master\agi-master.

I think you issue comes from the fact that you did not build in debug mode: bazel build -c dbg pkg. Or, to mirror your command above:

bazel --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" build -c dbg pkg

Can you give this a try, and let us know if it works?

from agi.

official-minister avatar official-minister commented on May 5, 2024

It works, but I find another problem:
I use "bazel build -c dbg pkg" to build debug program. And pkg is under the folder :D:\GoogleAGI\agi-master\agi-master\bazel-bin\pkg. It has agi.exe, gapis.exe....
Then I exce the cmd : bazel --output_user_root="D:\GoogleAGI\agi-master\build3" --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" run //cmd/gofuse -- -dir D:\GoogleAGI\agi-master\agi-gofuse --bazelout="D:\GoogleAGI\agi-master\build3".

and I found D:\GoogleAGI\agi-master\agi-master\bazel-bin\pkg is deleted. I check the dir, D:\GoogleAGI\agi-master\agi-master\bazel-bin just has one folder: cmd and others all missed.

so I exec debug cmd will have an error:
D:\GoogleAGI\agi-master\agi-master>dlv exec ./bazel-bin/pkg/gapis.exe -- -enable-local-files -persist -rpc localhost:8888
could not launch process: open ./bazel-bin/pkg/gapis.exe: The system cannot find the path specified.

In fact, I have tried to modify the "bazelout" param, but the result is the same.
bazel --output_user_root="D:\GoogleAGI\agi-master\build3" --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" run //cmd/gofuse -- -dir D:\GoogleAGI\agi-master\agi-gofuse --bazelout="D:\GoogleAGI\agi-master\agi-master\bazel-out".

Finally, I build my project again, and not exec bazel run \cmd\gouse.....(agi-gofuse has the compile result produced by last build.), and run delv directly, it can run debug model.

from agi.

official-minister avatar official-minister commented on May 5, 2024

bazel --output_user_root="D:\GoogleAGI\agi-master\build3" --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" run //cmd/gofuse -- -dir D:\GoogleAGI\agi-master\agi-gofuse --bazelout="D:\GoogleAGI\agi-master**\build3\wyvm3kp4\execroot\gapid\bazel-out\x64_windows-dbg"**

is the same. bazel-bin dir is clear except cmd

from agi.

official-minister avatar official-minister commented on May 5, 2024

It works, but I find another problem:
I use "bazel build -c dbg pkg" to build debug program. And pkg is under the folder :D:\GoogleAGI\agi-master\agi-master\bazel-bin\pkg. It has agi.exe, gapis.exe....
Then I exce the cmd : bazel --output_user_root="D:\GoogleAGI\agi-master\build3" --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" run //cmd/gofuse -- -dir D:\GoogleAGI\agi-master\agi-gofuse --bazelout="D:\GoogleAGI\agi-master\build3".

and I found D:\GoogleAGI\agi-master\agi-master\bazel-bin\pkg is deleted. I check the dir, D:\GoogleAGI\agi-master\agi-master\bazel-bin just has one folder: cmd and others all missed.

so I exec debug cmd will have an error:
D:\GoogleAGI\agi-master\agi-master>dlv exec ./bazel-bin/pkg/gapis.exe -- -enable-local-files -persist -rpc localhost:8888
could not launch process: open ./bazel-bin/pkg/gapis.exe: The system cannot find the path specified.

In fact, I have tried to modify the "bazelout" param, but the result is the same.
bazel --output_user_root="D:\GoogleAGI\agi-master\build3" --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" run //cmd/gofuse -- -dir D:\GoogleAGI\agi-master\agi-gofuse --bazelout="D:\GoogleAGI\agi-master\agi-master\bazel-out".

Finally, I build my project again, and not exec bazel run \cmd\gouse.....(agi-gofuse has the compile result produced by last build.), and run delv directly, it can run debug model.

and it has an error in this way
(dlv) break gapis/server/server.go:228
Command failed: could not find statement at gapis\server\server.go:228, please use a line with a statement

from agi.

hevrard avatar hevrard commented on May 5, 2024

Using --output_user_root will likely break the workflow, because it may change/delete some bazel-generated links.

To clarify, you do NOT have to run cmd/gofuse between bazel build -c dbg pkg and your call to delve. The only role of cmd/gofuse is to create a file hierarchy under agi-gofuse. You need to run this command only once when you setup the development. Once you have setup agi-gofuse, you should be able to:

  1. Build in debug mode
  2. Start debugging with delve

But you don't have to re-run cmd/gofuse in the middle. Also, you should NOT use --output_user_root, or change some Bazel arguments.

With this in mind, trying to reflect your commands, you should be able to run the following:

cd D:\GoogleAGI\agi-master\agi-master

bazel --host_jvm_args=-Djavax.net.ssl.trustStore="D:\JDK\jre\lib\security\cacerts" build -c dbg pkg

dlv exec ./bazel-bin/pkg/gapis.exe -- -enable-local-files -persist -rpc localhost:8888

Now, regarding your delve issue:

(dlv) break gapis/server/server.go:228
Command failed: could not find statement at gapis\server\server.go:228, please use a line with a statement

This is because there is currently no statement on this line: https://github.com/google/agi/blob/master/gapis/server/server.go#L228
I guess you tried this file:line because it is the one in the DEVDOC.md example, but this example is getting out of sync.

You should try a line with a statement, for example:

(dlv) break gapis/server/server.go:260

from agi.

official-minister avatar official-minister commented on May 5, 2024

Thank you! I solve the problem. It's so kind of you!

from agi.

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.