Commit Graph

47 Commits

Author SHA1 Message Date
Chris Smowton
e9278b5477 Merge pull request #386 from smowton/smowton/admin/improve-error-messages
Improve error messages
2020-10-23 08:27:03 +01:00
Chris Smowton
82de513764 Merge pull request #384 from sauyon/gobuild
extractor: Extract the working directory if no packages are passed
2020-10-22 15:43:48 +01:00
Chris Smowton
3716f6d7e9 Improve error messages 2020-10-22 14:42:23 +01:00
Sauyon Lee
e22bf96ba3 extractor: Extract the working directory if no packages are passed 2020-10-22 05:22:33 -07:00
Chris Smowton
5cc695f1d5 Autobuilder: fall back when os.Executable fails
This can happen under tracing, perhaps because of https://github.com/github/codeql-tracer/issues/29
2020-10-22 13:19:55 +01:00
Sauyon Lee
e5afd1dcb6 go-extractor: clarify --mimic error message
Co-authored-by: Chris Smowton <smowton@github.com>
2020-10-14 09:43:10 -07:00
Sauyon Lee
85c92251d6 Add a new binary for tracing 2020-10-08 23:31:06 -07:00
Sauyon Lee
de0582a67f autobuilder: extract out attempted build commands 2020-10-08 23:31:05 -07:00
Sauyon Lee
cd63ea84aa extractor: revamp argument parsing 2020-10-08 23:31:05 -07:00
Sauyon Lee
2da89c6527 extractor: factor out run from autobuilder 2020-10-08 23:31:05 -07:00
Chris Smowton
6b6c862274 Autobuilder: Use fully resolved path for GOPATH
Otherwise on systems where /tmp is a symlink (e.g. default OSX setup), GOPATH does not match the current working directory after os.Chdir'ing to that directory (os.Chdir resolves symlinks, unlike a shell's 'cd' command), which causes `dep` to fail complaining that it is being run from outside GOPATH.
2020-10-02 17:05:47 +01:00
Max Schaefer
655e229d1e Revert "Revert "autobuilder: Add support for GITHUB_REPOSITORY environment variable""
This reverts commit ccfccb4828.
2020-09-07 15:14:52 +01:00
Chris Smowton
246e8b1b27 Make failure to restore a file to its original location non-fatal 2020-09-02 11:44:43 +01:00
Chris Smowton
8de188a6ca Restore repo layout post-autobuild 2020-09-02 11:44:43 +01:00
Chris Smowton
4d084372b5 Fix autobuilder Go version comparison
The semver package requires versions of the form v1.2.3, and unhelpfully evaluates any malformed versions as equal.
2020-08-27 11:02:23 +01:00
Chris Smowton
c6dbb9fcb2 Tidy up -mod argument stringification 2020-08-27 10:46:36 +01:00
Chris Smowton
b13b54f7d7 Don't try to use -mod=... when go.mod doesn't exist
Also don't pass a blank argument to `go` when using an old version.
2020-08-26 13:56:36 +01:00
Chris Smowton
9ad2d6c119 Factor default and custom install paths
These now follow the same route:

* Run a default or custom build script
* If needed, check if vendor/ is usable
* If it isn't, or if their build failed, install dependencies using go get etc

This commit shouldn't cause any behavioural change.
2020-08-26 12:02:54 +01:00
Chris Smowton
859b427881 Check if the vendor/ directory is usable, even after a successful build 2020-08-26 11:53:50 +01:00
Sauyon Lee
8f6b25e0ac autobuilder: Use -mod=mod for vendor directories wihtout modules.txt 2020-08-26 11:25:30 +01:00
Sauyon Lee
70d425d317 autobuilder: move vendor check before dependency installation check
This means dependency installation is still attempted when a vendor
directory is inconsistent.
2020-08-26 11:25:30 +01:00
Sauyon Lee
852ae9397b autobuilder: Test for vendor inconsistency 2020-08-26 11:25:30 +01:00
Sauyon Lee
28c69743a4 Add workaround for go 1.14 explicit vendoring requirement
This only applies for module files for which no Go version has
been specified; Go will assume these should be parsed with the
latest Go version, which will cause them to fail if the vendor
directory has been generated with an old version of Go, as
the vendor/modules.txt will not meet the new requirements for
consistency.
2020-08-26 11:25:30 +01:00
Sauyon Lee
8e6c1835dd autobuilder: Don't try to determine import paths for file URLs
Also improve logging
2020-08-05 23:21:34 -07:00
Max Schaefer
4257a68c27 Include newlines in messages printed by go-gen-dbscheme. 2020-07-10 14:08:37 +01:00
Max Schaefer
f74a94e382 Merge pull request #170 from sauyon/tracing
Extract more dependency ASTs
2020-07-01 14:25:52 +01:00
Max Schaefer
ccfccb4828 Revert "autobuilder: Add support for GITHUB_REPOSITORY environment variable" 2020-06-30 15:13:26 +01:00
Sauyon Lee
3513c352e6 extractor: Factor out FileExists utility function 2020-06-24 23:29:48 -07:00
Sauyon Lee
ba0f922a28 autobuilder: Add support for GITHUB_REPOSITORY environment variable
This is for use within GitHub actions
2020-06-09 11:52:23 -07:00
Sauyon Lee
aef7524f35 Add a go-gen-dbscheme for generating dbschemes 2020-05-22 08:04:40 -07:00
Sauyon Lee
a663eaae23 Merge pull request #89 from max-schaefer/extractor-profiling
Add environment variables for dumping CPU and memory profiles.
2020-04-06 03:33:08 -07:00
Max Schaefer
510b6070c9 Introduce official environment variable for goroutine limiting.
We've had to tell people how to do this, so we should have a name for it that doesn't refer to a defunct company.
2020-04-02 10:45:52 +01:00
Sauyon Lee
eba8dd0a36 Merge pull request #82 from github/max-schaefer-patch-1
Improve autobuilder logging
2020-04-01 09:07:55 -07:00
Max Schaefer
611751a9c3 Improve autobuilder logging 2020-04-01 15:31:50 +01:00
Max Schaefer
efc9ecefc8 Introduce CODEQL_GO_EXTRACTOR_BUILD_COMMAND as an alias for LGTM_INDEX_BUILD_COMMAND.
We've occasionally had to tell people to set this variable manually, so we might as well have an alias that doesn't refer to a soon-to-be obsolete product.
2020-04-01 09:35:57 +01:00
Max Schaefer
590f01d0c2 Add environment variables for dumping CPU and memory profiles.
These are intentionally undocumented for now.
2020-03-31 07:50:06 +01:00
Sauyon Lee
57b874e047 extractor: Only skip dependency installation when vendor folder is detected 2020-03-11 02:59:33 -07:00
Sauyon Lee
0aa46becf9 extractor: Use -mod=vendor when a vendor directory exists 2020-03-10 16:44:03 -07:00
Max Schaefer
bdf757b8ac Ensure LGTM_INDEX_BUILD_COMMAND takes precedence over build-command guessing. 2020-02-20 08:59:56 +00:00
Sauyon Lee
5417102c37 Rename the go module to github.com/github/codeql-go 2020-02-10 11:00:00 -08:00
Sauyon Lee
4e5fd46bc6 autobuilder: Close stdin of subprocesses
This fixes issues where build programs were prompting for input,
causing the build to hang indefinitely.
2020-01-17 12:43:07 -08:00
Sauyon Lee
53e5ebba20 autobuilder: Run build tools if relevant files exist 2020-01-17 12:43:06 -08:00
Sauyon Lee
c76684851f autobuilder: run make if Makefile exists 2020-01-17 12:43:05 -08:00
Max Schaefer
215fe26a73 Fix a dead assignment. 2019-11-20 10:28:12 +00:00
Sauyon Lee
2ba680ef4c autobuilder: Add a missing newline to the usage blurb 2019-11-12 15:11:03 -08:00
Sauyon Lee
7c45316aa7 autobuilder: Add line printing the environment and build versions of Go 2019-11-08 19:59:52 -08:00
Max Schaefer
d14eb855fc Go analysis support for CodeQL. 2019-11-08 12:16:26 +00:00