Commit Graph

39 Commits

Author SHA1 Message Date
Michael McLoughlin
9c70781236 all: go 1.17 (#197)
Bump CI Go versions to 1.16 and 1.17.
Update build tags with `go:build` equivalents.
Upgrade asmfmt tool for new `go:build` support.

Updates #183
2021-10-29 01:18:34 -07:00
Michael McLoughlin
a5480393fc script: pin golangci-lint install script (#205) 2021-10-27 23:18:45 -07:00
Michael McLoughlin
9a44e522f4 script: switch to install.sh from golangci-lint repo (#203)
The goreleaser script has been deprecated:

goreleaser/godownloader#207
2021-10-27 23:07:44 -07:00
Michael McLoughlin
f295bde84c pass: ensure frame pointer register is saved (#174)
Currently `avo` uses `BP` as a standard general-purpose register. However, `BP` is used for the frame pointer and should be callee-save. Under some circumstances, the Go assembler will do this automatically, but not always. At the moment `avo` can produce code that clobbers the `BP` register. Since Go 1.16 this code will also fail a new `go vet` check.

This PR provides a (currently sub-optimal) fix for the issue. It introduces an `EnsureBasePointerCalleeSaved` pass which will check if the base pointer is written to by a function, and if so will artificially ensure that the function has a non-zero frame size. This will trigger the Go assembler to automatically save and restore the BP register.

In addition, we update the `asmdecl` tool to `asmvet`, which includes the `framepointer` vet check.

Updates #156
2021-04-18 18:37:56 -07:00
Michael McLoughlin
e5c9b4e5a6 script: use tools.mod for bootstrap (#175)
Replaces gobin with the preferred tools.mod solution for pinning tool dependencies.

Updates #166
2021-04-10 21:10:42 -07:00
Michael McLoughlin
fa88270b07 script: pin tool dependencies
An update to gofumpt caused the lint job to start failing:

https://github.com/mmcloughlin/avo/runs/638734114?check_suite_focus=true#step:7:688

The underlying issue is that the "join parameters" rule added to gofumpt
disagrees with output from go/types. It's possible to fix, but I don't
think it's important enough to deal with right now. Instead I'll pin the
gofumpt dependency to a version before that rule was added.

Pinning tool dependencies is a good idea anyway.
2020-05-03 22:38:06 -07:00
Michael McLoughlin
f891fe8d97 ci: test on go 1.14 (#138)
Add go 1.14 to CI testing. Upgrade golang.org/x/tools dependency to resolve golang/go#37617.
2020-04-25 01:27:57 -07:00
Michael McLoughlin
3426f8bd2d ci: github actions (#107)
Github actions workflow for CI.

Updates #106
2020-01-03 17:32:09 -08:00
Michael McLoughlin
0bcbe82731 ci: fix build for go 1.13 (#96)
Updates modules handling so build passes in Go 1.13. Bypasses modules for tools install in bootstrap. Upgrades golangci-lint version to avoid bug with v1.17.1 under Go 1.13.

Fixes #95
2019-09-15 14:43:44 -07:00
Michael McLoughlin
bb615f61ce all: formatting (#93)
Enforce stricter formatting and import grouping with gofumports.
2019-07-30 18:40:47 -07:00
Michael McLoughlin
cad456ebde lint: bump golangci-lint to v1.17.1 (#88) 2019-06-13 11:44:24 -07:00
Michael McLoughlin
e4cc632b47 lint: bump golangci-lint to 1.15.0
Updates #64
2019-03-04 21:33:46 -08:00
Michael McLoughlin
9c913ee847 lint: linter for package docstrings (#59)
Fixes #38
2019-01-22 21:14:59 -08:00
Michael McLoughlin
54ee3a8b77 lint: run asmdecl
Updates #24
2019-01-13 12:02:06 -08:00
Michael McLoughlin
a23fe8ee57 internal/cmd/asmdecl: standalone asmdecl checker
Updates #24
2019-01-13 11:40:47 -08:00
Michael McLoughlin
4aa8656eb0 lint: fix issues in examples (#49) 2019-01-13 10:12:52 -08:00
Michael McLoughlin
999da5143a script: fix asmtfmt install command (#8) 2019-01-10 21:48:26 -08:00
Michael McLoughlin
7a22924b14 lint: ensure conformity with asmfmt
Run asmfmt suring linting and confirm git repository isn't dirty.
This introduces a developer tools dependency on asmfmt, but not a
runtime dependency.

Updates #8
2019-01-10 21:31:04 -08:00
Michael McLoughlin
2caf9a2c35 ci: fix ref to unit.coverprofile 2019-01-09 21:58:14 -08:00
Michael McLoughlin
61e2c9dd38 ci: flag integration tests and unit tests 2019-01-09 21:51:20 -08:00
Michael McLoughlin
64026d252c ci: do not use go modules
Attempt to fix a stream of CI failures that started on the addition of
Go modules.

I wonder if we are falling foul of this warning in the wiki
https://github.com/golang/go/wiki/Modules.

"The module cache in Go 1.11 can sometimes cause various errors,
primarily if there were previously network issues or multiple go
commands executing in parallel (see #26794, which is addressed for Go
1.12). As a troubleshooting step, you can copy $GOPATH/pkg/mod to a
backup directory (in case further investigation is warranted later), run
go clean -modcache, and then see whether the original problem persists."

Updates #21
2019-01-06 20:35:58 -08:00
Michael McLoughlin
e7a6e2cb2a script: use -x in coverage script
Hope to get some insight into why CI builds are failing.
2019-01-06 20:28:46 -08:00
Michael McLoughlin
80a1adc4bb meta: initialize go modules
Updates #21
2019-01-06 18:58:30 -08:00
Michael McLoughlin
d92a147644 testing: coverage script
Updates #27
2019-01-02 20:41:59 -08:00
Michael McLoughlin
cf76c56dfc testing: script to measure coverage of a binary
Updates #27
2019-01-02 20:04:45 -08:00
Michael McLoughlin
4550badf58 doc: scripts to run embedmd on markdown files
This will help keep READMEs in sync with code.

Also adds a README for the add example.

Updates #14
2018-12-31 20:25:29 -08:00
Michael McLoughlin
6d6ff3cfc1 legal: include LICENSEs for data files
We depend upon data files from golang arch sub-repo and the Opcodes XML
database (behind PeachPy). This change includes their LICENSE files.

Updates #22
2018-12-31 16:17:44 -08:00
Michael McLoughlin
18cdf50d7c reg: support for register casting
Adds methods for referencing sub- or super-registers. For example, for
general purpose registers you can now reference As8(), As16(), ... and
for vector AsX(), AsY(), AsZ().

Closes #1
2018-12-30 18:40:45 -08:00
Michael McLoughlin
1033aa4f9c add golang.org/x/tools dependency 2018-12-17 21:13:00 -08:00
Michael McLoughlin
79bdb92163 fix ordering of generate script 2018-12-11 22:31:19 -08:00
Michael McLoughlin
e42eb1fb8c fix go get command 2018-12-05 00:56:02 -08:00
Michael McLoughlin
ceca3612c6 add go get to bootstrap 2018-12-05 00:53:16 -08:00
Michael McLoughlin
00c50be004 enable some more linters 2018-12-05 00:49:12 -08:00
Michael McLoughlin
fa18d7229f address some lint 2018-12-05 00:27:42 -08:00
Michael McLoughlin
7ab57635f6 start a lint script 2018-11-30 21:47:10 -08:00
Michael McLoughlin
b99b2cdbbf script to run code generation 2018-11-25 17:00:14 -08:00
Michael McLoughlin
0edbdb064f supporting more instructions seen in stdlib 2018-11-24 17:32:18 -08:00
Michael McLoughlin
a70227cbe3 test for stdlib opcodes 2018-11-24 14:55:51 -08:00
Michael McLoughlin
a956274bc3 import data files 2018-11-20 15:08:22 -06:00