Граф коммитов

38 Коммитов

Автор SHA1 Сообщение Дата
Mike Lundy c4dfa597b8
add /v2 to the module name to resolve the module path problem 2020-04-16 16:30:07 -07:00
Mislav Marohnić 994649785d [make] Use GOFLAGS instead of manually passing `-mod=vendor` 2019-10-03 00:51:07 +02:00
Eli Schwartz 7d915e232c
build: pass mod vendoring flag on newer versions of go
When go autodetects that it is being run as a go mod, and that there is
a vendor directory, it will still try to redownload all sources over the
network, unless you use -mod=vendor to tell it to use that. Additionally,
when using -mod=vendor the compiler will nicely avoid messing with
$GOPATH at all, since it can operate in a completely self-contained
manner.

Take advantage of this, when the detected go version is at least 1.11
(when the -mod flag was introduced).
2019-06-15 22:56:33 -04:00
Eli Schwartz 39e1523442 build: respect environment LDFLAGS and strip the build path
golang does not natively respect LDFLAGS, but you can pass them on the
command line using -ldflags=-extldflags=...
This is important for distributions, in order to provide common
functionality such as hardening flags.

Also strip the prefixed root source directory from the embedded source
file paths. This is not important information for the debugger, which
should only care about paths relative to $GOPATH, and results in less
build environment metadata leaking into the final binary. (This also
aids in reproducible builds when using different build directories, see
e.g. https://github.com/golang/go/issues/16860)
2019-01-02 17:00:15 +01:00
Mislav Marohnić 00e1b9957d Remove obsolete build steps
This was from the time when we tried to have hub build even if it wasn't
checkout out within a local GOPATH. This change assumes a working Go
environment.
2018-06-08 20:57:27 +02:00
Mislav Marohnić 9b4cd74258 Merge pull request #1470 from eljobe/fixes/tmpdir
Remove trailing slashes from the $TMPDIR variable
2017-06-26 20:18:38 +02:00
Mislav Marohnić 0aa5b57338 Enforce go1.8+ at build time 2017-05-17 13:09:00 +02:00
Pepper Lebeck-Jobe a572edb367
Remove comments and extra variables
These were both requested during code review.
2017-05-15 13:10:05 +09:00
Pepper Lebeck-Jobe e3518167df
Address review comments
1. Removed the check_go_version script
2. Only check go version in bootstrap
3. Simplify the go version check logic
2017-05-15 13:03:14 +09:00
Pepper Lebeck-Jobe 71fa8dad8f
Upgrade to Go 1.8
The only thing that has substansively changed is that Go 1.8 handles
redirect logic more safely than previous versions. This means we can
drop our special handling to avoid following redirects to other
domains. We were only doing that to protect against the possibility
of leaking auth headers. With Go 1.8, the auth headers are not
forwarded when following a redirect to another domain, so we don't
need our special handling any more.

As long as people are attempting to build with the Makefile, the new
check_go_version script should cause the build to stop if our
collaborators aren't using at least version 1.8 of go.
2017-05-11 13:24:04 +09:00
Pepper Lebeck-Jobe 1758a6f13b
Remove trailing slashes from the $TMPDIR variable.
This is helpful for when TMPDIR already has a trailing slash. We can't
be sure that it will on all operating systems, but this will remove it
if it is there.
2017-05-09 19:32:14 +09:00
Mislav Marohnić 7c1fedfe90 Upgrade to Go 1.6
The GO15VENDOREXPERIMENT flag is no longer necessary.
2016-08-07 23:55:53 +02:00
Mislav Marohnić 54262e6606 Makefile galore! 2016-01-25 15:58:17 +11:00
Mislav Marohnić d5aa903911 `script/build` creates `bin/hub` executable by default 2016-01-25 02:30:46 +11:00
Mislav Marohnić d0ee8f64f3 Fix `script/build test` after moving to `vendor/` directory 2016-01-20 16:13:35 +11:00
Mislav Marohnić 1b862e3388 Switch from godep & rewriting import paths to GO15VENDOREXPERIMENT 2016-01-20 14:46:44 +11:00
Mislav Marohnić fc08248073 Merge branch 'master' into cross-compiling 2015-09-27 21:38:34 +02:00
Jingwen Owen Ou a4698bcf71 Add hub version to crash report
This adds hub version to crash report. It includes refactoring of hub version to the `version` package for reusability in `commands` package and `github` package.
2015-09-27 10:58:29 -07:00
Mislav Marohnić b46574e613 Switch to Go 1.5 which has native cross compilation
We don't need `gimme` anymore to cross-compile binaries.
2015-09-26 16:19:51 +02:00
Mislav Marohnić 785005ce83 Automatically publish a GitHub release from Travis CI
Whenever CI processes a new git tag successfully, automatically create a
GitHub release and upload cross-compiled assets to it.
2015-06-07 02:40:40 +02:00
Kent R. Spillner 66d98c1662 fix non-portable GNU find(1)-ism
GNU find(1)'s -not operator is not POSIX compliant.  Use ! operator
instead in order to work with other find(1) implementations.
2015-04-22 14:59:17 -05:00
Mislav & Owen 283782497b Make `script/build` compatible with Windows
The best way to run this is in the GitHub for Windows shell.
2014-12-20 17:57:39 -08:00
Jingwen Owen Ou 667023cc23 Opt out autoupdate by default.
This makes our build scripts even more simpler. To build with autoupdate, run `go build -tags autoupdate`
2014-11-30 22:17:17 -08:00
Jingwen Owen Ou 1eb74c35cf Pull back code to set up GOPATH for build
If there’s no GOPATH set up locally, Go won’t be able to find sub packages. This is due to changes in af9163b699.
2014-11-30 19:26:45 -08:00
Jingwen Owen Ou 4fd4ce331d Change build script and package script to use `go build` directly 2014-11-30 09:24:58 -08:00
Jingwen Owen Ou 6815930a6d Include git tag SHA in build
Use the `-ldflags` to change version at the linker. See http://golang.org/cmd/ld.

Issue: https://github.com/github/hub/issues/672#issuecomment-62040388
2014-11-11 22:51:03 -08:00
Owen Ou c8ffd06ec3 Build Hub in a temporary dir for cukes
We need to run the packaging script for every platform using a Vagrant box. During the packaging step, cukes are run. However, the workspace is shared between host and the Vagrant box. Instead of cleaning up the built binary for each platform, build it into a temporary dir.
2014-10-15 16:18:28 -07:00
Jingwen Owen Ou cc816c9df8 Provide option to build `hub` without autoupdate 2014-09-20 10:15:42 -07:00
Jingwen Owen Ou 21b8711772 Extract out script/godep for running any Go command 2014-02-21 08:12:11 -08:00
Mislav Marohnić 38db23dd62 Improve bootstrap, build and test scripts
Old `script/bootstrap` & `script/build` were unfriendly to Go newbies
because they require the user having GOPATH set in their environment,
and either `godep` installed or `hg` to be able to fetch godep.

However, since dependencies are vendored, we don't have any real build
dependencies except Go itself.

- `script/bootstrap` now checks Go and installs Ruby test bundle
- `script/build` skips compiling if binary is up to date
- `script/test` runs both Go and Cucumber test suites
2014-02-07 12:44:56 +01:00
Jingwen Owen Ou d0eeb375bc Add comments to scripts 2014-01-07 14:22:14 -08:00
Jingwen Owen Ou d7ea284e4a Explicitly build to gh 2014-01-02 17:14:00 -08:00
Jingwen Owen Ou 651a1fa3b3 Use go build without all pacakges 2013-12-02 06:33:24 -08:00
Jingwen Owen Ou a79dd3cb4e Fix travis path 2013-11-14 08:50:43 -08:00
Jingwen Owen Ou 597c48afa3 Add bash debug 2013-11-14 08:46:34 -08:00
Jingwen Owen Ou a98278ac15 Update scripts to point to godep 2013-11-14 08:39:25 -08:00
Jingwen Owen Ou ebc91a30f9 Add #! to scripts 2013-10-10 20:32:46 -07:00
Jingwen Owen Ou abbc4113a3 Add some basic scripts 2013-10-10 20:26:16 -07:00