They are used from CI workflows to ensure that the binaries are reproducible.
In theory they could be changed to compare the sha256sum files for the archive
files too, but it's too much of a hassle to create reproducible archive files.
The code for passing -buildmode=pie in buildall.sh didn't actually work -
"go env GOOS GOARCH" outputs two lines, while the grep pattern expects one line.
The buildall.elv script implements this correctly, and as a result this exposes
the fact that passing -buildmode=pie requires some extra work for
reproducibility - among other things, it causes the binaries to be dynamically
linked.
Just disable it for now to get reproducibility. We're not losing anything as
that was the (unintended) old behavior of buildall.sh anyway.
For example, a link to language.html#number is converted to point to
https://elv.sh/ref/language.html#number instead. Such links are quite common in
elvdocs.
Also convert all link destinations that use ./language.html to use language.html
instead, and add a check in tools/check-disallowed.sh to ensure that remains the
case.
- Consolidate all checks into a "all-checks" target in the Makefile, and use it
from tools/pre-push and ci.yml.
- Remove trivial make targets, including "generate" and all the individual check
targets.
- Remove the trivial script tools/lint.sh.
- Rename the "checkstyle" scripts to "check-fmt", which is more specific.
While working on a change to augment `make lint` to be more comprehensive I
noticed that `go generate ./...` produced unexpected errors on my system (see
below). This augments the CI environment checks to verify that the generated
code is up to date. This also augments the pre-push script to perform the
checks by the tools/check-content script run by the CI environment.
FWIW: The errors shown below were because my version of the
`stringer` tool was out of date (fixed by running `go install
golang.org/x/tools/stringer@latest`) Regardless, the point of this change
is that the pre-push script and the CI environment should verify that the
generated code is up to date. This change adds those checks.
> go generate ./...
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/getopt"
pkg/getopt/getopt.go:11: running "stringer": exit status 1
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/md"
pkg/md/md.go:163: running "stringer": exit status 1
stringer: internal error: package "fmt" without types was imported from
"src.elv.sh/pkg/parse"
pkg/parse/parse.go:11: running "stringer": exit status 1
Exception: go exited with 1
[tty 102], line 1: go generate ./...
This allows the build commands in Makefile and tools/buildall.sh to be
simplified.
Official reproducible builds are now handled as a build variant, and the command
in Makefile no longer tries to produce reproducible builds.
Instructions in PACKAGING.md have been completely rewritten.
This was extracted from https://github.com/elves/elvish/pull/1326. It
augments that change by honoring $E:PATHEXT and some other
minor improvements. This matches the behavior of the Go stdlib
os/exec.LookPath() function that is used to decide if what has been typed
(in a non-completion context) represents an external command.
- Use explict ./ for consistency when invoking the script
- Rename script to "prune-cover.sh"
- Build ignore pattern in temporary file, and use grep -f to read it
- Use grep -F for correctness (path can contain dots)
- Add comment in .codecov.yml
Running `make cover` includes code in its report that is explicitly
excluded from the https://codecov.io/gh/elves/elvish/ report. This change
causes both reports to include/exclude the same source files.
This makes the output of "make test" cleaner, and only show the command that
was actually run (instead of a shell if statement).
Also use the race detector on more supported platforms.
The mechanism is now documented in PACKAGING.md.
Also refactor tools/buildall.sh to make it easy to make reproducible builds, and
fix tools/cirrus-deploy.sh.