mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11420 from ethereum/docs-sphinx-4-compatibility-fixes
[DOCS] Sphinx 4.x.y compatibility fixes
This commit is contained in:
commit
6324688ece
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,6 +34,7 @@ prerelease.txt
|
||||
/build*
|
||||
emscripten_build/
|
||||
docs/_build
|
||||
docs/_static/robots.txt
|
||||
__pycache__
|
||||
docs/utils/*.pyc
|
||||
/deps/downloads/
|
||||
|
@ -141,7 +141,8 @@ Both expressions can also be assigned to.
|
||||
|
||||
Local Solidity variables are available for assignments, for example:
|
||||
|
||||
.. code::
|
||||
.. code-block:: solidity
|
||||
:force:
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
@ -26,10 +26,10 @@ from pygments_lexer_solidity import SolidityLexer, YulLexer
|
||||
def setup(sphinx):
|
||||
thisdir = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.insert(0, thisdir + '/utils')
|
||||
sphinx.add_lexer('Solidity', SolidityLexer())
|
||||
sphinx.add_lexer('Yul', YulLexer())
|
||||
sphinx.add_lexer('Solidity', SolidityLexer)
|
||||
sphinx.add_lexer('Yul', YulLexer)
|
||||
|
||||
sphinx.add_stylesheet('css/custom.css')
|
||||
sphinx.add_css_file('css/custom.css')
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
|
@ -263,7 +263,7 @@ We mainly use `AFL <https://lcamtuf.coredump.cx/afl/>`_ for fuzzing. You need to
|
||||
install the AFL packages from your repositories (afl, afl-clang) or build them manually.
|
||||
Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compiler:
|
||||
|
||||
::
|
||||
.. code-block:: shell
|
||||
|
||||
cd build
|
||||
# if needed
|
||||
@ -273,7 +273,7 @@ Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compile
|
||||
|
||||
At this stage you should be able to see a message similar to the following:
|
||||
|
||||
::
|
||||
.. code-block:: text
|
||||
|
||||
Scanning dependencies of target solfuzzer
|
||||
[ 98%] Building CXX object test/tools/CMakeFiles/solfuzzer.dir/fuzzer.cpp.o
|
||||
@ -284,7 +284,7 @@ At this stage you should be able to see a message similar to the following:
|
||||
|
||||
If the instrumentation messages did not appear, try switching the cmake flags pointing to AFL's clang binaries:
|
||||
|
||||
::
|
||||
.. code-block:: shell
|
||||
|
||||
# if previously failed
|
||||
make clean
|
||||
@ -293,7 +293,7 @@ If the instrumentation messages did not appear, try switching the cmake flags po
|
||||
|
||||
Otherwise, upon execution the fuzzer halts with an error saying binary is not instrumented:
|
||||
|
||||
::
|
||||
.. code-block:: text
|
||||
|
||||
afl-fuzz 2.52b by <lcamtuf@google.com>
|
||||
... (truncated messages)
|
||||
@ -317,7 +317,7 @@ Next, you need some example source files. This makes it much easier for the fuzz
|
||||
to find errors. You can either copy some files from the syntax tests or extract test files
|
||||
from the documentation or the other tests:
|
||||
|
||||
::
|
||||
.. code-block:: shell
|
||||
|
||||
mkdir /tmp/test_cases
|
||||
cd /tmp/test_cases
|
||||
@ -334,7 +334,7 @@ that result in similar behaviour of the binary.
|
||||
|
||||
Now run the fuzzer (the ``-m`` extends the size of memory to 60 MB):
|
||||
|
||||
::
|
||||
.. code-block:: shell
|
||||
|
||||
afl-fuzz -m 60 -i /tmp/test_cases -o /tmp/fuzzer_reports -- /path/to/solfuzzer
|
||||
|
||||
|
@ -139,7 +139,8 @@ The functions ``prefixed`` and ``recoverSigner`` do this in the ``claimPayment``
|
||||
The full contract
|
||||
-----------------
|
||||
|
||||
::
|
||||
.. code-block:: solidity
|
||||
:force:
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
@ -335,7 +336,8 @@ so it is important that Bob closes the channel before the expiration is reached.
|
||||
The full contract
|
||||
-----------------
|
||||
|
||||
::
|
||||
.. code-block:: solidity
|
||||
:force:
|
||||
|
||||
// SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity >=0.7.0 <0.9.0;
|
||||
|
@ -1,3 +1,6 @@
|
||||
sphinx_rtd_theme>=0.3.1
|
||||
pygments-lexer-solidity>=0.7.0
|
||||
sphinx-a4doc>=1.2.1
|
||||
|
||||
# Sphinx 2.1.0 is the oldest version that accepts a lexer class in add_lexer()
|
||||
sphinx>=2.1.0
|
||||
|
Loading…
Reference in New Issue
Block a user