Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

gb build all doesn't do anything [Windows] #59

Closed
laszlothewiz opened this issue May 9, 2015 · 6 comments
Closed

gb build all doesn't do anything [Windows] #59

laszlothewiz opened this issue May 9, 2015 · 6 comments

Comments

@laszlothewiz
Copy link

I set up a simple project:
src/main.go
vendor/src/go-ini/ini.go

When I run gb build all nothing happens, no files created, no error messages.

I ran gb build -v=true all and got the following:
DEBUG project root "t:\2015\PJT\Golang\CWI Automation"
DEBUG matchPackages: [t:\2015\PJT\Golang\CWI Automation\src] all
DEBUG args: []
DEBUG removing work directory: C:\Users\Laci\AppData\Local\Temp\gb086314939
DEBUG build duration: 976.6us map[]

I would be happy to debug this but don't even know where to start.

@davecheney
Copy link
Contributor

Thanks for your issue report. You need to move main.go into a package. Code cannot be built at the root of src/ because that is not a package, it has no name.

On 9 May 2015, at 20:52, laszlothewiz notifications@github.com wrote:

I set up a simple project:
src/main.go
vendor/src/go-ini/ini.go

When I run gb build all nothing happens, no files created, no error messages.

I ran gb build -v=true all and got the following:
DEBUG project root "t:\2015\PJT\Golang\CWI Automation"
DEBUG matchPackages: [t:\2015\PJT\Golang\CWI Automation\src] all
DEBUG args: []
DEBUG removing work directory: C:\Users\Laci\AppData\Local\Temp\gb086314939
DEBUG build duration: 976.6us map[]

I would be happy to debug this but don't even know where to start.


Reply to this email directly or view it on GitHub.

@laszlothewiz
Copy link
Author

Thank you for the quick response!

However, after moving the source files into a folder, the build fails (cwia is the folder I moved the files to):

FATAL command "build" failed: failed to resolve package "cwia": cannot find package "cwia" in any of:
    C:\Go\src\pkg\cwia (from $GOROOT)
    t:\2015\PJT\Golang\CWI Automation:t:\2015\PJT\Golang\CWI Automation\vendor\src\cwia (from $GOPATH)

Also, could gb consider the .go files directly under /src as the main project files and assume the name for them to be the project directory's name?
Eg: ~/someproject/src/main.go could generate a someproject.exe
This would be ideal for small projects

@davecheney
Copy link
Contributor

Possibly, but if you put your files in src/someoroject/main.go the we wouldn't have to add a special case

@laszlothewiz
Copy link
Author

That's fine but I moved my files under a subdirectory (cwia) in /src and I got the above error when trying to build.

@davecheney
Copy link
Contributor

Let me take a look tomorrow. There is a known error on windows #27 and another issue for building in src/ directly #46

@laszlothewiz
Copy link
Author

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants