laher/goxc

Pass Through Options For ldflags

leehambley opened this issue · 9 comments

It's really cool the way that you pass through ldflags. It'd be great if we could specify other flags to export, perhaps as a map[string]string of something like:

build_time: date +"%m-%d-%Y"
something_else: ....

Hi lee, that's a good call. I've been meaning to do that too, I just
haven't had anyone ask for it yet.
As I remember you can use ldflags to initialise any number of global
variables, and goxc's config is already well suited to maps of strings. The
only complication is the use of variables, but 'build date' is a good use
case. I guess text/template can help out there, but I don't want to get too
exotic about it.
I also can't remember what other things ldflags can do for you. I think
it's quite powerful.
I'll take a look over the weekend. Cheers
On Aug 1, 2013 7:39 AM, "Lee Hambley" notifications@github.com wrote:

It's really cool the way that you pass through ldflags. It'd be great if
we could specify other flags to export, perhaps as a map[string]string of
something like:

build_time: date +"%m-%d-%Y"
something_else: ....


Reply to this email directly or view it on GitHubhttps://github.com//issues/15
.

Lee,
I think I want to create a whole config section to manage all of the go build flags, so I'm going to spend a little more time on this (probably not for a couple of weeks though). I just want to take stock of all those options before making a call on it.

For the time being, if you'd like a 'build date/time', I've hardcoded another option -X main.BUILD_DATE 'Sun, 04 Aug 2013 21:25:22 NZST'. See latest version.
Note that I'll make the date format configurable, but RFC1123 seems like a good default - human-readable & complete. I'll also make the variable names configurable too (but still defaulting to 'main.BUILD_DATE' & 'main.VERSION').

Suggestions welcome. Cheers

As always English speaking world forget about rest of the world.
'Sun, 04 Aug 2013 21:25:22 NZST' is readable only for people who know English.

I think that 2013-08-04T13:08:52+02:00 is far more readable (ISO8601 format), at last for rest of the world.

Best regards,
Dobrosław Żybort

Dobrosław, you're right, silly me.
Done

On Sun, Aug 4, 2013 at 11:10 PM, Dobrosław Żybort
notifications@github.comwrote:

As always English speaking world forget about rest of the world.
'Sun, 04 Aug 2013 21:25:22 NZST' is readable only for people who know
English.

I think that 2013-08-04T13:08:52+02:00 is far more readable, at last for
rest of the world.

Best regards,
Dobrosław Żybort


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-22070057
.

Thank you.

Best regards,
Dobrosław Żybort

ISO8601 is always preferable :-)
Am 04.08.2013 13:44 schrieb "Dobrosław Żybort" notifications@github.com:

Thank you.

Best regards,
Dobrosław Żybort


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-22070458
.

Lee, just to say that I have just released support for all current compiler flags. They were available via config for several weeks, but I've only just added them via commandline flags.

Here they are:

-build-ccflags
-build-compiler
-build-gccgoflags
-build-gcflags
-build-installsuffix
-build-ldflags
-build-print-commands
-build-processors
-build-race
-build-tags
-build-verbose

Cheers

Awesome! Great work!

Sent from my Nexus 4.
On 24 Nov 2013 09:26, "Am Laher" notifications@github.com wrote:

Lee, just to say that I have just released support for all current
compiler flags. They were available via config for several weeks, but I've
only just added them via commandline flags.

Here they are:

-build-ccflags
-build-compiler
-build-gccgoflags
-build-gcflags
-build-installsuffix
-build-ldflags
-build-print-commands
-build-processors
-build-race
-build-tags
-build-verbose

Cheers


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-29151123
.

closing because I believe it's done. Cheers