Commit Graph

14470 Commits

Author SHA1 Message Date
Akio Nakamura b2d56059fa [script] lint-whitespace: improve print linenumber
Before this PR, the linenumber infomaition is output if trailing-space
or tab code was found, but the output occurence is only per a file.
This PR separates the output timing of file name and line number.
As a result, users will find where they need to fix more easily.
2020-10-27 23:05:02 +00:00
MarcoFalke 87f4e1c488 devtools: Exclude patches from lint-whitespace 2020-10-27 23:05:02 +00:00
Sjors Provoost c1683a142b [scripts] lint-whitespace: check last N commits or unstaged changes
Get usage instructions:
.lint-whitespace.sh -?
2020-10-27 23:05:02 +00:00
Sjors Provoost 034fe80a79 [scripts] lint-whitespace: use perl instead of grep -P
MacOS does not support 'grep -P' out of the box. This change makes
it easier for developers to check for whitespace problems locally.
2020-10-27 23:05:02 +00:00
Wladimir J. van der Laan b77da1fd0c contrib: Ignore historical release notes for whitespace check
Lint checks should not test these, they are historical documents,
and we don't want to encourage silly changes to them to satisfy
a checker.

Hopefully makes travis pass again on master.

Tree-SHA512: 37e6716c4fd5e8a4e579f9b84042e6b0ac224836b6c851cd1ca3f7d46611ffd3003bed0ae08dd0457f69d6eaa485a0d21c631e7ef16b14bdb0f2f78ea700332d
2020-10-27 23:05:02 +00:00
MeshCollider 378d6d04aa Add tab char lint check and exclude imported dependencies 2020-10-27 23:05:02 +00:00
Evan Klitzke 5da5d54216 Add a lint check for trailing whitespace.
This adds a new CHECK_DOC check that looks for newly introduced trailing
whitespace. Existing trailing whitespace (of which there is plenty!)
will not trigger an error.

This is written in a generic way so that new lint-*.sh scripts can be
added to contrib/devtools/, as I'd like to contribute additional lint
checks in the future.
2020-10-27 23:05:02 +00:00
Dan Raviv 36463d42c0 Fix header guards using reserved identifiers
Identifiers beginning with an underscore followed immediately by an uppercase letter are reserved.
2020-10-27 23:05:02 +00:00
Philip Kaufmann 70e1e116af [Trivial] ensure minimal header conventions
- ensure header namespaces and end comments are correct
- add missing header end comments
- ensure minimal formatting (add newlines etc.)
2020-10-27 23:05:02 +00:00
Homu 75f1a46023 Auto merge of #4832 - therealyingtong:release-v4.1.0-rc1, r=daira
Release candidate v4.1.0-rc1
2020-10-27 20:21:35 +00:00
therealyingtong d66cabf8c9 Update release-notes-4.1.0-rc1.md 2020-10-28 02:54:01 +08:00
therealyingtong 3cdef42bcc make-release.py: Updated release notes and changelog for 4.1.0-rc1. 2020-10-28 02:51:45 +08:00
therealyingtong 1f731e8355 make-release.py: Updated manpages for 4.1.0-rc1. 2020-10-28 02:51:44 +08:00
therealyingtong f10cf663bc make-release.py: Versioning changes for 4.1.0-rc1. 2020-10-28 02:32:03 +08:00
Homu b61a7e2e89 Auto merge of #4831 - str4d:shell-cleanups, r=daira
Shell script cleanups

Cherry-picked from https://github.com/bitcoin/bitcoin/pull/10773.

Fixes a bug with `./contrib/devtools/gen-manpages.sh` backported in zcash/zcash#4827.
2020-10-27 16:33:16 +00:00
practicalswift ab5fdb7c7d Use bash instead of POSIX sh. POSIX sh does not support arrays. 2020-10-27 15:09:43 +00:00
practicalswift 8cd66cf690 Add error handling: exit if cd fails 2020-10-27 15:08:36 +00:00
Homu 5009f219e6 Auto merge of #4830 - daira:rename-bp-funding-stream, r=daira
Rename the FS_ZIP214_ECC funding stream to FS_ZIP214_BP

See also https://github.com/zcash/zips/pull/412 .

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-27 15:06:57 +00:00
Daira Hopwood d54dda736d Rename the FS_ZIP214_ECC funding stream to FS_ZIP214_BP.
See also https://github.com/zcash/zips/pull/412 .

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-27 13:27:19 +00:00
Homu d6012677ea Auto merge of #4826 - str4d:4823-static-assert, r=daira
Replace BOOST_STATIC_ASSERT with static_assert

Closes zcash/zcash#4823.
2020-10-27 11:46:00 +00:00
Jack Grigg d476537d86 scripted-diff: Remove BOOST_STATIC_ASSERT
-BEGIN VERIFY SCRIPT-
sed -i 's/BOOST_STATIC_ASSERT(/static_assert(/' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
sed -i ':a;N;$!ba;s/#include <boost\/static_assert.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h* ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ;
-END VERIFY SCRIPT-
2020-10-27 10:44:58 +00:00
Homu 1d5ed8fa2f Auto merge of #4744 - LarryRuane:4721-treestate, r=daira
add z_gettreestate RPC

Closes #4721.
2020-10-27 09:46:56 +00:00
Larry Ruane a91a7d37cf add z_gettreestate rpc 2020-10-26 23:08:47 -06:00
Homu b9a4f291ea Auto merge of #4812 - str4d:shielded-reqs-reject-reasons, r=str4d
Improve reject reasons for unmet shielded requirements

These reject messages end up bubbling up to users via the RPC interface.
Distinguishing between the various failure cases will help users figure
out why their transaction is being rejected.

Closes zcash/zcash#3114.
2020-10-27 01:35:14 +00:00
Homu 311a079dd5 Auto merge of #4827 - str4d:commit-script-check, r=str4d
Verifier for scriptable changes

Includes changes from the following upstream PRs:
- bitcoin/bitcoin#10189
  - Excluding the `CNode` scripted changes.
- bitcoin/bitcoin#10480
- bitcoin/bitcoin#11390
- bitcoin/bitcoin#13281
  - Only the lint scripts we already have.
- bitcoin/bitcoin#13454
  - Only changes to scripts we already have.
- bitcoin/bitcoin#14864
- bitcoin/bitcoin#16327
  - Includes some portability fixes to other shell scripts.
- bitcoin/bitcoin#20069
2020-10-27 00:06:46 +00:00
Jack Grigg 1b42734b9f tests: Update chained_joinsplits test for HaveShieldedRequirements API change 2020-10-26 23:46:19 +00:00
str4d 8aadc745c2
Use HTTPS in script license headers
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-26 18:04:19 +00:00
str4d e9b836d612
Update example scripted-diff comit in doc/developer-notes.md 2020-10-26 17:59:18 +00:00
Jack Grigg 1b01bd942b test/lint: Check for working changes before checking scripted diffs 2020-10-26 17:57:26 +00:00
Wladimir J. van der Laan 001e803b92 test: Mention commit id in scripted diff error 2020-10-26 17:36:26 +00:00
Hennadii Stepanov 1d3af17140 Enable ShellCheck rules
Enabled ShellCheck rules:
  SC1087
  SC2001
  SC2004
  SC2005
  SC2006
  SC2016
  SC2028
  SC2048
  SC2066 (note that IFS already contains only a line feed)
  SC2116
  SC2166
  SC2181
  SC2206
  SC2207
  SC2230
  SC2236

Zcash: Only the changes that applied to the versions of the scripts we have.
2020-10-26 17:36:26 +00:00
Carl Dong ccd074a59b scripted-diff: Run scripted-diff in subshell
-BEGIN VERIFY SCRIPT-
sed -i 's/\bi\b/commit/g' test/lint/commit-script-check.sh
sed -i '34s/eval "$SCRIPT"/(eval "$SCRIPT")/' test/lint/commit-script-check.sh
-END VERIFY SCRIPT-
2020-10-26 17:36:26 +00:00
practicalswift 3b1bf4b4af Add "export LC_ALL=C" to all shell scripts
Zcash: Only for shell scripts we have from upstream.
2020-10-26 17:36:26 +00:00
MarcoFalke 6506fbacf1 test: Move linters to test/lint, add readme 2020-10-26 17:36:26 +00:00
John Newbery 9645ae5be0 [docs] document scripted-diff 2020-10-26 17:20:55 +00:00
Pieter Wuille 6b6f3b5649 Fail on commit with VERIFY SCRIPT but no scripted-diff 2020-10-26 17:20:55 +00:00
Cory Fields 553c9e6850 devtools: add script to verify scriptable changes 2020-10-26 15:54:33 +00:00
Jack Grigg 8f56306359 Add txid to "shielded requirements not met" messages 2020-10-26 14:12:57 +00:00
Homu 3605406358 Auto merge of #4815 - daira:fix-checksum-message, r=daira
Fix an error reporting bug in "Checksum missing or mismatched ..."

The sense of the test was accidentally inverted in my change to #4733. The message should be shown if any of the files exist but have an incorrect checksum. fixes #4813

No documentation needed.
Test plan: as for #4733, and also check that there are no false positive "Checksum missing or mismatched ..." warnings.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-26 12:12:15 +00:00
Daira Hopwood e86f83c627 Fix an error reporting bug in "Checksum missing or mismatched ..."
The sense of the test was accidentally inverted in my change to #4733.
The message should be shown if any of the files exist but have an incorrect checksum.
We also now correctly handle the case where there are no package source files.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-26 07:44:21 +00:00
Homu 40d5f0aa57 Auto merge of #4805 - str4d:fs-abstraction, r=str4d
Lightweight abstraction of boost::filesystem

This is a refactor backport ahead of replacing most of our Boost dependencies with C++17 code.

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#7667
  - Removes merge conflicts.
- bitcoin/bitcoin#9902
- bitcoin/bitcoin@2300a5e13a
- bitcoin/bitcoin#10546
  - Only the changes to `src/fs.cpp`
2020-10-26 02:03:34 +00:00
Jack Grigg d7c80e760c utils: Remove unnecessary GetTempPath() 2020-10-26 02:02:18 +00:00
Homu fef4b911d1 Auto merge of #4804 - str4d:update-secp256k1-again, r=daira
Update secp256k1 again

This migrates us to the same dependency version that upstream Bitcoin
Core migrated to in bitcoin/bitcoin#20147.
2020-10-25 00:45:09 +00:00
Jack Grigg 6fa2d1b73e Add logging to CCoinsViewCache::HaveShieldedRequirements
Enable with -debug=consensus
2020-10-23 20:16:07 +01:00
Jack Grigg 47c0c65326 Improve reject reasons for unmet shielded requirements
These reject messages end up bubbling up to users via the RPC interface.
Distinguishing between the various failure cases will help users figure
out why their transaction is being rejected.

Uses operator* instead of std::optional::value because the latter was
introduced in macOS 10.14, and our current minimum is 10.12.

Closes zcash/zcash#3114.
2020-10-23 20:16:07 +01:00
Homu a4b6aaa333 Auto merge of #4810 - daira:fix-death-tests, r=daira
Fix death gtests on macOS by switching to the threadsafe style

[Tested on macOS](https://github.com/zcash/zcash/issues/4802#issuecomment-714770192). fixes #4802

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-23 17:26:33 +00:00
Homu 693def7bac Auto merge of #4733 - nathan-at-least:download-stamp-native_rust-fix, r=daira
depends download: fix a logging bug for multi-archive packages:

No documentation change needed.

The test plan appears below. Since this bug output should appear on all builds without a pre-existing source cache, then an easier test plan might be to verify the bug output is not present from an infrastructure build log that doesn't rely on cached sources.

# Bug Behavior

While initially fetching packages, I saw `sh: test:` error messages in the make output for only two packages. However, it appears all packages are correctly fetched.

See detailed output appendix for demonstration of the bug output and conditions compared to with this patch for the same conditions.

# Analysis

## Design Requirements

The intent of the `check_or_remove_sources` is to fetch sources if either existing archive hashes do not match or the archives aren't present.

Additionally, this should report hash mismatches and be quiet about missing files.

## Bug Source

The second design requirement goal has a bug for multi-archive packages which define `$(package)_extra_sources)` because `test -f $($(package)_all_sources)` passes more than one argument to `test -f` which is not supported. If sha256sum fails in any case for multi-archive packages, a `sh: test` error line is always printed.

Aside from this spurious output, this bug has no effect, I believe. Fortunately this bug does not bypass the hash check!

## Testing

I tested this patch manually by running the same three tests against the `v4.0.0` tag and then again repeating those same three steps with this patch. In all 6 cases I visually inspected the output.

1. Starting with a pre-downloaded source cash, run the `download` target.
2. Remove an archive from a multi-archive package, then rerun `download`.
3. Alter a hash to cause a hash mismatch condition, then rerun `download`.

I believe after each step both with and without this patch the resulting source cache should be identical (except for filesystem timestamps).

### Testing v4.0.0 without this patch

Notice in the second and third steps the same bug output:

```
/bin/sh: 1: test: rust-std-1.42.0-x86_64-apple-darwin.tar.gz: unexpected operator
```
2020-10-23 15:43:57 +00:00
Daira Hopwood f23528ddd0 Fix death gtests on macOS by switching to the threadsafe style.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-23 16:08:59 +01:00
Homu 888039caf1 Auto merge of #4808 - nuttycom:fix_release_notes, r=daira
Update other incorrect uses of `python` instead of `python3`

This also adds explicit replacement of invalid characters in file read/write operations.
2020-10-22 19:07:35 +00:00
Kris Nuttycombe 4567e6f5fb Replace invalid characters in log message decoding. 2020-10-22 10:20:24 -06:00