GithubHelp home page GithubHelp logo

windows specific path problem about gb HOT 4 CLOSED

constabulary avatar constabulary commented on August 19, 2024
windows specific path problem

from gb.

Comments (4)

davecheney avatar davecheney commented on August 19, 2024

Thanks. I'm in the process of setting up CI. I expect there will be a some
windows errors due to the usual filepath.Seperator shenanigans.

On Sun, May 3, 2015 at 7:59 AM, Jason Buberel [email protected]
wrote:

Just working through a couple of user scenarios, and trying to get gb
working on a windows workstation.

I built gb.exe successfully, and then created the following directory
structure:

C:\Users\jason_000\mymysqltestproj> dir /a-d /b /s
C:\Users\jason_000\mymysqltestproj\bin\gb-env.exe
C:\Users\jason_000\mymysqltestproj\bin\gb-vendor.exe
C:\Users\jason_000\mymysqltestproj\bin\gb.exe
C:\Users\jason_000\mymysqltestproj\pkg\windows_amd64\github.com\constabulary\gb.a
C:\Users\jason_000\mymysqltestproj\pkg\windows_amd64\github.com\constabulary\gb\cmd.a
C:\Users\jason_000\mymysqltestproj\src\mytestproj\main.go

The only GO-named environment variable set is GOPATH:

C:\Users\jason_000\mymysqltestproj> set GO
GOPATH="C:\Users\jason_000\mymysqltestproj"

I can run the program using go run as follows:

C:\Users\jason_000\mymysqltestproj> go run src\mytestproj\main.go
Hello, world.

But trying to build the application using gb fails:

C:\Users\jason_000\mymysqltestproj> bin\gb.exe build -v all
2015/05/02 14:54:14 INFO project root "C:\Users\jason_000\mymysqltestproj"
2015/05/02 14:54:14 DEBUG matchPackages: [C:\Users\jason_000\mymysqltestproj\src] all
2015/05/02 14:54:14 DEBUG args: [mytestproj]
2015/05/02 14:54:14 DEBUG loadPackage: mytestproj
2015/05/02 14:54:14 INFO build duration: 0 map[]
2015/05/02 14:54:14 command "build" failed: failed to resolve package "mytestproj": cannot find package "mytestproj" in any of:
c:\go\src\mytestproj (from $GOROOT)
C:\Users\jason_000\mymysqltestproj:C:\Users\jason_000\mymysqltestproj\vendor\src\mytestproj (from $GOPATH)

I believe the problem is due o gb not appending src to the project root
when it looks for matching package/path names. In the last line of output,
notice that the search path is:

C:\Users\jason_000\mymysqltestproj:C:\Users\jason_000\mymysqltestproj\vendor\src\mytestproj

Instead of:

C:\Users\jason_000\mymysqltestproj\src:C:\Users\jason_000\mymysqltestproj\vendor\src\mytestproj


Reply to this email directly or view it on GitHub
#27.

from gb.

jbuberel avatar jbuberel commented on August 19, 2024

Confirmed the fix locally. Thanks.

$ gb build -v all
DEBUG project root "c:\\Users\\jason_000\\gbtest"
DEBUG matchPackages: [c:\Users\jason_000\gbtest\src] all
DEBUG args: [github.com/constabulary/gb github.com/constabulary/gb/cmd github.com/constabulary/gb/cmd/gb github.com/constabulary/gb/cmd/gb-env mysqltest]
DEBUG loadPackage: github.com/constabulary/gb true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb)
DEBUG loadPackage: github.com/constabulary/gb/cmd true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd)
DEBUG loadPackage: github.com/constabulary/gb/cmd/gb true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb)
DEBUG loadPackage: github.com/constabulary/gb/cmd/gb-env true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env)
DEBUG loadPackage: mysqltest true (c:\Users\jason_000\gbtest\src\mysqltest)
DEBUG buildPackage: github.com/constabulary/gb
DEBUG buildPackage: github.com/constabulary/gb/cmd
DEBUG buildPackage: github.com/constabulary/gb/cmd/gb
DEBUG {main github.com/constabulary/gb/cmd/gb c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb} is a main package, not installing
DEBUG buildPackage: github.com/constabulary/gb/cmd/gb-env
DEBUG {main github.com/constabulary/gb/cmd/gb-env c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env} is a main package, not installing
DEBUG buildPackage: mysqltest
DEBUG {main mysqltest c:\Users\jason_000\gbtest\src\mysqltest} is a main package, not installing
INFO github.com/constabulary/gb
DEBUG gc:gc github.com/constabulary/gb c:\Users\jason_000\gbtest\src\github.com\constabulary\gb C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb.a [build.go context.go gb.go gc.go gotest.go install.go log.go package.go project.go stdlib.go target.go test.go toolchain.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete build.go context.go gb.go gc.go gotest.go install.go log.go package.go project.go stdlib.go target.go test.go toolchain.go]
INFO github.com/constabulary/gb/cmd/gb-env
DEBUG gc:gc github.com/constabulary/gb/cmd/gb-env c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb-env\main.a [main.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb/cmd/gb-env -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb-env\main.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete main.go]
INFO mysqltest
DEBUG gc:gc mysqltest c:\Users\jason_000\gbtest\src\mysqltest C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\mysqltest\main.a [main.go]
DEBUG cd c:\Users\jason_000\gbtest\src\mysqltest; [C:\Go\pkg\tool\windows_amd64\6g -p mysqltest -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\mysqltest\main.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete main.go]
DEBUG cd .; [C:\Go\pkg\tool\windows_amd64\6l -o c:\Users\jason_000\gbtest\bin\gb-env -L C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -L c:\Users\jason_000\gbtest\pkg\windows\amd64 C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb-env\main.a]
DEBUG cd .; [C:\Go\pkg\tool\windows_amd64\6l -o c:\Users\jason_000\gbtest\bin\mysqltest -L C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -L c:\Users\jason_000\gbtest\pkg\windows\amd64 C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\mysqltest\main.a]
DEBUG copyfile(dst: c:\Users\jason_000\gbtest\pkg\windows\amd64\github.com\constabulary\gb.a, src: C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb.a)
INFO github.com/constabulary/gb/cmd
DEBUG gc:gc github.com/constabulary/gb/cmd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd.a [env.go import.go path.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb/cmd -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete env.go import.go path.go]
DEBUG copyfile(dst: c:\Users\jason_000\gbtest\pkg\windows\amd64\github.com\constabulary\gb\cmd.a, src: C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd.a)
INFO github.com/constabulary/gb/cmd/gb
DEBUG gc:gc github.com/constabulary/gb/cmd/gb c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb\main.a [build.go main.go plugin.go test.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb/cmd/gb -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb\main.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete build.go main.go plugin.go test.go]
DEBUG cd .; [C:\Go\pkg\tool\windows_amd64\6l -o c:\Users\jason_000\gbtest\bin\gb -L C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -L c:\Users\jason_000\gbtest\pkg\windows\amd64 C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb\main.a]
DEBUG removing work directory: C:\Users\JASON_~1\AppData\Local\Temp\gb214506947
DEBUG build duration: 809.4249ms map[compile:257.0565ms link:574.115ms]

from gb.

davecheney avatar davecheney commented on August 19, 2024

Thanks for confirming, how do you like the new default logging (no -v) ?

On Mon, May 11, 2015 at 10:17 AM, Jason Buberel [email protected]
wrote:

Confirmed the fix locally. Thanks.

$ gb build -v all
DEBUG project root "c:\Users\jason_000\gbtest"
DEBUG matchPackages: [c:\Users\jason_000\gbtest\src] all
DEBUG args: [github.com/constabulary/gb github.com/constabulary/gb/cmd github.com/constabulary/gb/cmd/gb github.com/constabulary/gb/cmd/gb-env mysqltest]
DEBUG loadPackage: github.com/constabulary/gb true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb)
DEBUG loadPackage: github.com/constabulary/gb/cmd true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd)
DEBUG loadPackage: github.com/constabulary/gb/cmd/gb true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb)
DEBUG loadPackage: github.com/constabulary/gb/cmd/gb-env true (c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env)
DEBUG loadPackage: mysqltest true (c:\Users\jason_000\gbtest\src\mysqltest)
DEBUG buildPackage: github.com/constabulary/gb
DEBUG buildPackage: github.com/constabulary/gb/cmd
DEBUG buildPackage: github.com/constabulary/gb/cmd/gb
DEBUG {main github.com/constabulary/gb/cmd/gb c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb} is a main package, not installing
DEBUG buildPackage: github.com/constabulary/gb/cmd/gb-env
DEBUG {main github.com/constabulary/gb/cmd/gb-env c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env} is a main package, not installing
DEBUG buildPackage: mysqltest
DEBUG {main mysqltest c:\Users\jason_000\gbtest\src\mysqltest} is a main package, not installing
INFO github.com/constabulary/gb
DEBUG gc:gc github.com/constabulary/gb c:\Users\jason_000\gbtest\src\github.com\constabulary\gb C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb.a [build.go context.go gb.go gc.go gotest.go install.go log.go package.go project.go stdlib.go target.go test.go toolchain.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete build.go context.go gb.go gc.go gotest.go install.go log.go package.go project.go stdlib.go target.go test.go toolchain.go]
INFO github.com/constabulary/gb/cmd/gb-env
DEBUG gc:gc github.com/constabulary/gb/cmd/gb-env c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb-env\main.a [main.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb-env; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb/cmd/gb-env -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb-env\main.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete main.go]
INFO mysqltest
DEBUG gc:gc mysqltest c:\Users\jason_000\gbtest\src\mysqltest C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\mysqltest\main.a [main.go]
DEBUG cd c:\Users\jason_000\gbtest\src\mysqltest; [C:\Go\pkg\tool\windows_amd64\6g -p mysqltest -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\mysqltest\main.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete main.go]
DEBUG cd .; [C:\Go\pkg\tool\windows_amd64\6l -o c:\Users\jason_000\gbtest\bin\gb-env -L C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -L c:\Users\jason_000\gbtest\pkg\windows\amd64 C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb-env\main.a]
DEBUG cd .; [C:\Go\pkg\tool\windows_amd64\6l -o c:\Users\jason_000\gbtest\bin\mysqltest -L C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -L c:\Users\jason_000\gbtest\pkg\windows\amd64 C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\mysqltest\main.a]
DEBUG copyfile(dst: c:\Users\jason_000\gbtest\pkg\windows\amd64\github.com\constabulary\gb.a, src: C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb.a)
INFO github.com/constabulary/gb/cmd
DEBUG gc:gc github.com/constabulary/gb/cmd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd.a [env.go import.go path.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb/cmd -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete env.go import.go path.go]
DEBUG copyfile(dst: c:\Users\jason_000\gbtest\pkg\windows\amd64\github.com\constabulary\gb\cmd.a, src: C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd.a)
INFO github.com/constabulary/gb/cmd/gb
DEBUG gc:gc github.com/constabulary/gb/cmd/gb c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb\main.a [build.go main.go plugin.go test.go]
DEBUG cd c:\Users\jason_000\gbtest\src\github.com\constabulary\gb\cmd\gb; [C:\Go\pkg\tool\windows_amd64\6g -p github.com/constabulary/gb/cmd/gb -pack -o C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb\main.a -I C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -I c:\Users\jason_000\gbtest\pkg\windows\amd64 -complete build.go main.go plugin.go test.go]
DEBUG cd .; [C:\Go\pkg\tool\windows_amd64\6l -o c:\Users\jason_000\gbtest\bin\gb -L C:\Users\JASON_~1\AppData\Local\Temp\gb214506947 -L c:\Users\jason_000\gbtest\pkg\windows\amd64 C:\Users\JASON_~1\AppData\Local\Temp\gb214506947\github.com\constabulary\gb\cmd\gb\main.a]
DEBUG removing work directory: C:\Users\JASON_~1\AppData\Local\Temp\gb214506947
DEBUG build duration: 809.4249ms map[compile:257.0565ms link:574.115ms]


Reply to this email directly or view it on GitHub
#27 (comment).

from gb.

jbuberel avatar jbuberel commented on August 19, 2024

Very nice. Using that on the beego package:

jason_000@velocity-micro /c/Users/jason_000/gbtest
$ git clone https://github.com/astaxie/beego src/github.com/astaxie/beego
Cloning into 'src/github.com/astaxie/beego'...
remote: Counting objects: 7183, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 7183 (delta 0), reused 0 (delta 0), pack-reused 7180
Receiving objects: 100% (7183/7183), 5.32 MiB | 2.48 MiB/s, done.
Resolving deltas: 100% (3965/3965), done.
Checking connectivity... done.

jason_000@velocity-micro /c/Users/jason_000/gbtest
$ gb build github.com/astaxie/beego
github.com/astaxie/beego/config
github.com/astaxie/beego/utils
github.com/astaxie/beego/logs
github.com/astaxie/beego/toolbox
github.com/astaxie/beego/session
github.com/astaxie/beego/context
github.com/astaxie/beego

from gb.

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.