FAQ
I try to build a library.
But, how to release it as binary library instead of source code?

GOPATH=/home/USER/go

I put source on /home/USER/prj/mylib/mylib.go (I don't want put all
project stuff in $GOPATH, because there contains other languages)
And make a symbolic link for it.
mkdir -p /home/USER/go/src/mycompany
ln -s /home/USER/prj/mylib/ /home/USER/go/src/mycompany/mylib

I can do 'go test' under /home/USER/go/src/mycompany/mylib/

But, if I type 'go install' it response

go install: no install location for directory /home/USER/prj/mylib outside
GOPATH

Any suggestion?

BTW, during google search, I found this URL, and the issue is accepted but
not resolved for a year.
I suppose to harden released binary is important.
http://ppp.cylab.cmu.edu/wordpress/?p=667

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Tamás Gulácsi at May 10, 2013 at 4:48 am
    Put the go source at $GOPATH/src/companydesignator/.../codelib - directly, or with symlink, maybe just the go source hierarchy.
    And refer to the code as import "companydesignator/.../codelib"

    That way go tools will find it.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rodrigo Kochenburger at May 10, 2013 at 5:56 am
    If you really don't want to use GOPATH, you can create your own build
    scripts by calling the compiler and linker directly.

    http://golang.org/cmd/gc/

    That said, I strongly recommend adapting your project to conform to what
    the go tool expects. It will be much easier.
    On Thursday, May 9, 2013 9:23:26 PM UTC-7, dlin wrote:

    I try to build a library.
    But, how to release it as binary library instead of source code?

    GOPATH=/home/USER/go

    I put source on /home/USER/prj/mylib/mylib.go (I don't want put all
    project stuff in $GOPATH, because there contains other languages)
    And make a symbolic link for it.
    mkdir -p /home/USER/go/src/mycompany
    ln -s /home/USER/prj/mylib/ /home/USER/go/src/mycompany/mylib

    I can do 'go test' under /home/USER/go/src/mycompany/mylib/

    But, if I type 'go install' it response

    go install: no install location for directory /home/USER/prj/mylib outside
    GOPATH

    Any suggestion?

    BTW, during google search, I found this URL, and the issue is accepted but
    not resolved for a year.
    I suppose to harden released binary is important.
    http://ppp.cylab.cmu.edu/wordpress/?p=667
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dobrosław Żybort at May 10, 2013 at 8:18 am
    You can use goxc for that.
    It's cross compiler for Go (you can cc only if you don't use cgo).

    https://github.com/laher/goxc#more-options
    https://github.com/laher/goxc#outcome

    By default, artifacts are generated and then immediately archived into
    (outputdir).
    To set a destination root directory and artifact version number:
    goxc -d=my/jekyll/site/downloads -pv=0.1.1
    You can also use config files with goxc for faster repeatable builds
    https://github.com/laher/goxc/wiki/config

    Best regards,
    Dobrosław Żybort

    W dniu piątek, 10 maja 2013 06:23:26 UTC+2 użytkownik dlin napisał:
    I try to build a library.
    But, how to release it as binary library instead of source code?

    GOPATH=/home/USER/go

    I put source on /home/USER/prj/mylib/mylib.go (I don't want put all
    project stuff in $GOPATH, because there contains other languages)
    And make a symbolic link for it.
    mkdir -p /home/USER/go/src/mycompany
    ln -s /home/USER/prj/mylib/ /home/USER/go/src/mycompany/mylib

    I can do 'go test' under /home/USER/go/src/mycompany/mylib/

    But, if I type 'go install' it response

    go install: no install location for directory /home/USER/prj/mylib outside
    GOPATH

    Any suggestion?

    BTW, during google search, I found this URL, and the issue is accepted but
    not resolved for a year.
    I suppose to harden released binary is important.
    http://ppp.cylab.cmu.edu/wordpress/?p=667
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at May 10, 2013 at 9:30 am

    On Fri, May 10, 2013 at 12:23 PM, dlin wrote:

    I try to build a library.
    But, how to release it as binary library instead of source code?
    simply put, releasing binary library without source code is not supported.
    this is: https://code.google.com/p/go/issues/detail?id=2775

    however, there is a hack. just put a dummy.go (with a correct package
    clause)
    in corresponding source directory with mtime older than it's package.a file.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dobrosław Żybort at May 10, 2013 at 10:20 am
    Oh crap, I didn't read his mail properly. I thought he want to release main
    program binaries, not library.
    Sorry about my previous mail.

    I'm too tired today.


    W dniu piątek, 10 maja 2013 11:30:14 UTC+2 użytkownik minux napisał:

    On Fri, May 10, 2013 at 12:23 PM, dlin <dli...@gmail.com <javascript:>>wrote:
    I try to build a library.
    But, how to release it as binary library instead of source code?
    simply put, releasing binary library without source code is not supported.
    this is: https://code.google.com/p/go/issues/detail?id=2775

    however, there is a hack. just put a dummy.go (with a correct package
    clause)
    in corresponding source directory with mtime older than it's package.a
    file.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 10, '13 at 4:23a
activeMay 10, '13 at 10:20a
posts6
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase