Comments (8)
Easy. Create 2 subfolders inside cmd
:
cmd/logging-client/logging-platform-client.go
cmd/test-server/test-server.go
This is the usual way to lay out a Go project with multiple executables.
goxc supports this because go install ./cmd/...
supports it too.
On Wed, May 11, 2016 at 11:05 PM, Dennis Günnewig [email protected]
wrote:
Background
I would like to have two separate binaries compiled by goxc and packaged
into a single archive:
- Server (Mock for testing only)
- Client
@laher https://github.com/laher Can you help me with that? I just
trying to use go for my second small project. Thanks a lot in advance.
Problemsupport for multiple binaries per project (goxc now searches
subdirectories for 'main' packages)I'm not able to build the project with goxc though there seems to be
support for projects with multiple binaries.The build fails with following error message:
[goxc:go-vet] 2016/05/11 12:59:10 Task go-vet succeeded
? github.com/my-project/logging-platform-client/api [no test files]
? github.com/my-project/logging-platform-client/cli [no test files]github.com/my-project/logging-platform-client/cmd
cmd/test-server.go:41 http://github.com/my-project/logging-platform-client/cmdcmd/test-server.go:41: main redeclared in this block
previous declaration at cmd/logging-platform-client.go:7
[goxc:go-test] 2016/05/11 12:59:10 'go' returned error: Wait error: exit status 2: # github.com/my-project/logging-platform-client/cmd
cmd/test-server.go:41 http://github.com/my-project/logging-platform-client/cmdcmd/test-server.go:41: main redeclared in this block
previous declaration at cmd/logging-platform-client.go:7
[goxc:go-test] 2016/05/11 12:59:10 Stopping after 'go-test' failed with error 'Wait error: exit status 2: # github.com/my-project/logging-platform-client/cmd
cmd/test-server.go:41 http://github.com/my-project/logging-platform-client/cmdcmd/test-server.go:41: main redeclared in this block
previous declaration at cmd/logging-platform-client.go:7'
[goxc] 2016/05/11 12:59:10 RunTasks error: Wait error: exit status 2: # github.com/my-project/logging-platform-client/cmd
cmd/test-server.go:41 http://github.com/my-project/logging-platform-client/cmdcmd/test-server.go:41: main redeclared in this block
previous declaration at cmd/logging-platform-client.go:7Currently I structured the project the following way:
[git:master]% tree
.
├── api
│ └── log.go
├── cli
│ └── runner.go
├── cmd
│ ├── logging-platform-client.go
│ └── test-server.go
├── GoBuilds
│ └── logging-platform-client
│ └── 0.1.0
└── MakefileEnvironment
- goxc version: 0.17.1
- goxc build date: empty
- go version go1.6.2 linux/amd64
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#105
from goxc.
Thanks for the quick response, but that gives me a different error:
.
├── api
│ └── log.go
├── cli
│ └── runner.go
├── cmd
│ ├── logging-platform-client
│ │ └── logging-platform-client.go
│ └── test-server
│ └── test-server.go
├── GoBuilds
│ └── logging-platform-client
│ └── 0.1.0
└── Makefile
[goxc:go-vet] 2016/05/11 13:29:44 Task go-vet succeeded
? github.com/my-project/logging-platform-client/api [no test files]
? github.com/my-project/logging-platform-client/cli [no test files]
? github.com/my-project/logging-platform-client/cmd/logging-platform-client [no test files]
? github.com/my-project/logging-platform-client/cmd/test-server [no test files]
[goxc:go-test] 2016/05/11 13:29:44 Task go-test succeeded
[goxc:go-install] 2016/05/11 13:29:44 Task go-install succeeded
[goxc:xc] 2016/05/11 13:29:44 Stopping after 'xc' failed with error 'The xc task will attempt to compile multiple binaries to the same path (/home/xgvndeg/.local/share/go/src/github.com/my-project/logging-platform-client/GoBuilds/logging-platform-client/0.1.0/logging-platform-client_0.1.0_linux_386). Please make sure {{.Os}} and {{.Arch}} variables are used in the OutPath. Currently the template is {{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.AppName}}_{{.Version}}_{{.Os}}_{{.Arch}}{{.Ext}}'
[goxc] 2016/05/11 13:29:44 RunTasks error: The xc task will attempt to compile multiple binaries to the same path (/home/xgvndeg/.local/share/go/src/github.com/my-project/logging-platform-client/GoBuilds/logging-platform-client/0.1.0/logging-platform-client_0.1.0_linux_386). Please make sure {{.Os}} and {{.Arch}} variables are used in the OutPath. Currently the template is {{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.AppName}}_{{.Version}}_{{.Os}}_{{.Arch}}{{.Ext}}
The config file
{
"ArtifactsDest": "GoBuilds/",
"OutPath": "{{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.AppName}}_{{.Version}}_{{.Os}}_{{.Arch}}{{.Ext}}",
"Tasks": [
"default"
],
"BuildConstraints": "linux windows darwin",
"PackageVersion": "0.1.0",
"TaskSettings": { },
"ConfigVersion": "0.9"
}
from goxc.
I think it's related to having the binaries inside your tree.
Could you try using "ArtifactsDest": "../GoBuilds/"
and then move the
folder itself out of the way?
(it ought to still work anyway, but I don't commonly test for this scenario)
On Wed, May 11, 2016 at 11:33 PM, Dennis Günnewig [email protected]
wrote:
Thanks for the quick response, but that gives me a different error:
.
├── api
│ └── log.go
├── cli
│ └── runner.go
├── cmd
│ ├── logging-platform-client
│ │ └── logging-platform-client.go
│ └── test-server
│ └── test-server.go
├── GoBuilds
│ └── logging-platform-client
│ └── 0.1.0
└── Makefile[goxc:go-vet] 2016/05/11 13:29:44 Task go-vet succeeded
? github.com/my-project/logging-platform-client/api [no test files]
? github.com/my-project/logging-platform-client/cli [no test files]
? github.com/my-project/logging-platform-client/cmd/logging-platform-client [no test files]
? github.com/my-project/logging-platform-client/cmd/test-server [no test files]
[goxc:go-test] 2016/05/11 13:29:44 Task go-test succeeded
[goxc:go-install] 2016/05/11 13:29:44 Task go-install succeeded
[goxc:xc] 2016/05/11 13:29:44 Stopping after 'xc' failed with error 'The xc task will attempt to compile multiple binaries to the same path (/home/xgvndeg/.local/share/go/src/github.com/my-project/logging-platform-client/GoBuilds/logging-platform-client/0.1.0/logging-platform-client_0.1.0_linux_386). Please make sure {{.Os}} and {{.Arch}} variables are used in the OutPath. Currently the template is {{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.AppName}}{{.Version}}{{.Os}}{{.Arch}}{{.Ext}}'
[goxc] 2016/05/11 13:29:44 RunTasks error: The xc task will attempt to compile multiple binaries to the same path (/home/xgvndeg/.local/share/go/src/github.com/my-project/logging-platform-client/GoBuilds/logging-platform-client/0.1.0/logging-platform-client_0.1.0_linux_386). Please make sure {{.Os}} and {{.Arch}} variables are used in the OutPath. Currently the template is {{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.AppName}}{{.Version}}{{.Os}}{{.Arch}}{{.Ext}}The config file
{
"ArtifactsDest": "GoBuilds/",
"OutPath": "{{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.AppName}}{{.Version}}{{.Os}}_{{.Arch}}{{.Ext}}",
"Tasks": [
"default"
],
"BuildConstraints": "linux windows darwin",
"PackageVersion": "0.1.0",
"TaskSettings": { },
"ConfigVersion": "0.9"
}—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#105 (comment)
from goxc.
Mmmh... I tried...
- ... to remove the
ArtifactsDest": "GoBuilds/"
-setting and rungoxc
again - ... to modify the setting to
ArtifactsDest": "../GoBuilds/"
and rungoxc
again
That didn't help. Here's the output of a goxc --verbose
-run https://gist.github.com/dg-ratiodata/d5686cd66e6a382edf4a04e3d9a0c3af with "ArtifactsDest": "../GoBuilds/"
.
from goxc.
OK. I see, it's the OutPath.
It should have the {{.ExeName}} in there somewhere otherwise both binaries
would end up with the same filename.
This should do it:
"OutPath": "{{.Dest}}{{.PS}}{{.AppName}}{{.PS}}{{.Version}}{{.PS}}{{.ExeName}}_{{.Version}}_{{.Os}}_{{.Arch}}{{.Ext}}",
On Thu, May 12, 2016 at 12:02 AM, Dennis Günnewig [email protected]
wrote:
Mmmh... I tried...
- ... to remove the ArtifactsDest": "GoBuilds/"-setting and run goxc
again- ... to modify the setting to ArtifactsDest": "../GoBuilds/" and run
goxc againThat didn't help. Here's the output of a goxc --verbose-run
https://gist.github.com/dg-ratiodata/d5686cd66e6a382edf4a04e3d9a0c3af
with "ArtifactsDest": "../GoBuilds/".—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#105 (comment)
from goxc.
Ah. Ok. So it's not possible to put them into a single archive? That's what I assumed first.
from goxc.
It will.
On Thu, May 12, 2016 at 12:17 AM, Dennis Günnewig [email protected]
wrote:
Ah. Ok. So it's not possible to put them into a single archive? That's
what I assumed first.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#105 (comment)
from goxc.
Great! Thanks a lot. Now it works.
from goxc.
Related Issues (20)
- Include linux binary in release HOT 1
- How to resolve "WARNING - no debian 'control' file found" HOT 6
- can't cross compile -- wait errors HOT 3
- Error: Stopping after 'xc' failed with error 'The xc task will attempt to compile multiple binaries to the same path HOT 1
- Ldflags only settable via json config HOT 3
- Deb packages support for conffiles/postinst HOT 1
- Custom build off of a non master branch HOT 1
- Simplify for Go 1.5+ world HOT 1
- Support for FreeBSD
- Create a License file for better overview on github
- Could you borrow some stars to my poor github projects? HOT 1
- [goxc] 2018/10/01 15:04:59 RunTasks error: Wait error: exit status 2 vendor/gopkg.in/goracle.v2
- [goxc] Failing build for Darwin on Go 1.15.x
- question: no linux binaries in releases anymore ?
- ResourcesInclude as a list, rather than a json string would be much nicer
- Installed-Size in deb control file HOT 4
- How to include binaries as part of the ResourcesInclude config settings ? HOT 1
- Bug: difference between zip contents, when the "ResourcesInclude" config setting has a path that is above the main path your building from, and its a windows build. HOT 2
- Making go-vet and go-test ignore vendor directory HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goxc.