-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
310 changed files
with
6,757 additions
and
5,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
load("vars.bzl", "ADDITIONAL_IMPORTS") | ||
|
||
exports_files([ | ||
".clang-format", | ||
"package.json", | ||
"yarn_ganache.lock", | ||
] + glob(["*.py"])) | ||
|
||
# The 'starkware' library adds 'src' to PYTHONPATH. | ||
# The library on its own does not add any dependencies. | ||
# This library is needed to allow us to use "import starkware.foo" instead of | ||
# "import src.starkware.foo". | ||
py_library( | ||
name = "starkware", | ||
srcs = [], | ||
imports = [ | ||
"src", | ||
] + ADDITIONAL_IMPORTS, | ||
visibility = ["//visibility:public"], | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
FROM ciimage/python:3.9 | ||
|
||
RUN apt update | ||
RUN apt install -y make libgmp3-dev g++ python3-pip python3.9-dev python3.9-venv npm | ||
# Installing cmake via apt doesn't bring the most up-to-date version. | ||
RUN pip install cmake==3.22 | ||
COPY ./docker_common_deps.sh /app/ | ||
WORKDIR /app/ | ||
RUN ./docker_common_deps.sh | ||
RUN apt-get install -y git libgmp3-dev python3-pip python3.9-venv python3.9-dev npm | ||
|
||
# Install solc and ganache | ||
RUN curl https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.6.12+commit.27d51765 -o /usr/local/bin/solc-0.6.12 | ||
RUN echo 'f6cb519b01dabc61cab4c184a3db11aa591d18151e362fcae850e42cffdfb09a /usr/local/bin/solc-0.6.12' | sha256sum --check | ||
RUN chmod +x /usr/local/bin/solc-0.6.12 | ||
RUN npm install -g --unsafe-perm [email protected] | ||
|
||
COPY . /app/ | ||
|
||
# Build. | ||
WORKDIR /app/ | ||
RUN ./build.sh | ||
COPY . /app | ||
|
||
WORKDIR /app/build/Release | ||
RUN make all -j8 | ||
# Build the cairo-lang package. | ||
RUN bazel build //src/starkware/cairo/lang:create_cairo_lang_package_zip | ||
RUN build/bazelbin/src/starkware/cairo/lang/create_cairo_lang_package_zip | ||
|
||
# Run tests. | ||
RUN ctest -V -j8 | ||
# Build and test all the targets. | ||
RUN bazel build //... | ||
RUN bazel test //... | ||
|
||
WORKDIR /app/ | ||
RUN src/starkware/cairo/lang/package_test/run_test.sh | ||
|
||
# Build the Visual Studio Code extension. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") | ||
load("//bazel_utils:get_from_cairo_lang.bzl", "get_from_cairo_lang") | ||
|
||
http_archive( | ||
name = "build_bazel_rules_nodejs", | ||
sha256 = "f10a3a12894fc3c9bf578ee5a5691769f6805c4be84359681a785a0c12e8d2b6", | ||
urls = [ | ||
"https://github.com/bazelbuild/rules_nodejs/releases/download/5.5.3/rules_nodejs-5.5.3.tar.gz", | ||
], | ||
) | ||
|
||
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") | ||
|
||
build_bazel_rules_nodejs_dependencies() | ||
|
||
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") | ||
|
||
yarn_install( | ||
name = "npm_ganache", | ||
package_json = "//:package.json", | ||
yarn_lock = "//:yarn_ganache.lock", | ||
) | ||
|
||
http_file( | ||
name = "solc-0.6.12", | ||
downloaded_file_path = "solc-0.6.12", | ||
executable = True, | ||
sha256 = "f6cb519b01dabc61cab4c184a3db11aa591d18151e362fcae850e42cffdfb09a", | ||
urls = [ | ||
"https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.6.12+commit.27d51765", | ||
"https://starkware-third-party.s3.us-east-2.amazonaws.com/ethereum/solc-0.6.12", | ||
], | ||
) | ||
|
||
http_archive( | ||
name = "rules_python", | ||
sha256 = "a3a6e99f497be089f81ec082882e40246bfd435f52f4e82f37e89449b04573f6", | ||
strip_prefix = "rules_python-0.10.2", | ||
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.10.2.tar.gz", | ||
) | ||
|
||
http_archive( | ||
name = "cairo-compiler-archive-1.0.0", | ||
build_file = get_from_cairo_lang("//src/starkware/starknet/compiler/v1:BUILD.cairo-compiler-archive-1.0.0"), | ||
strip_prefix = "cairo", | ||
url = "https://github.com/starkware-libs/cairo/releases/download/v1.0.0-rc0/release-x86_64-unknown-linux-musl.tar.gz", | ||
) | ||
|
||
http_archive( | ||
name = "pypy3.9", | ||
build_file = "//:pypy3.9_archive_build_file.bzl", | ||
sha256 = "46818cb3d74b96b34787548343d266e2562b531ddbaf330383ba930ff1930ed5", | ||
strip_prefix = "pypy3.9-v7.3.9-linux64", | ||
url = "https://downloads.python.org/pypy/pypy3.9-v7.3.9-linux64.tar.bz2", | ||
) | ||
|
||
register_toolchains("//bazel_utils/python:py_stub_toolchain") | ||
|
||
load("@rules_python//python:repositories.bzl", "python_register_toolchains") | ||
|
||
python_register_toolchains( | ||
name = "python3", | ||
python_version = "3.9", | ||
register_toolchains = False, | ||
) | ||
|
||
# Install python pip packages in a lazy way. | ||
load("@python3//:defs.bzl", "interpreter") | ||
load("@rules_python//python:pip.bzl", "pip_parse") | ||
|
||
pip_parse( | ||
name = "cpython_reqs", | ||
python_interpreter_target = interpreter, | ||
requirements_lock = "//scripts:requirements.txt", | ||
) | ||
|
||
load("@cpython_reqs//:requirements.bzl", "install_deps") | ||
|
||
install_deps() | ||
|
||
pip_parse( | ||
name = "pypy_reqs", | ||
python_interpreter_target = "@pypy3.9//:bin/pypy3", | ||
requirements_lock = "//scripts:pypy-requirements.txt", | ||
) | ||
|
||
load("@pypy_reqs//:requirements.bzl", pypy_install_deps = "install_deps") | ||
|
||
pypy_install_deps() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
load("//bazel_utils:python.bzl", "py_exe") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
exports_files(["pytest_wrapper.py"]) | ||
|
||
py_binary( | ||
name = "gen_python_exe", | ||
srcs = ["gen_python_exe.py"], | ||
main = "gen_python_exe.py", | ||
) | ||
|
||
py_binary( | ||
name = "solc_wrapper", | ||
srcs = ["solc_wrapper.py"], | ||
) | ||
|
||
sh_binary( | ||
name = "solc-0.6.12", | ||
srcs = ["@solc-0.6.12//file"], | ||
) | ||
|
||
py_library( | ||
name = "default_extract_artifacts_lib", | ||
srcs = [ | ||
"__init__.py", | ||
"extract_artifacts.py", | ||
], | ||
visibility = ["//visibility:public"], | ||
deps = [], | ||
) | ||
|
||
py_exe( | ||
name = "default_extract_artifacts_exe", | ||
module = "bazel_utils.extract_artifacts", | ||
deps = ["default_extract_artifacts_lib"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def get_from_cairo_lang(label): | ||
return label |
Oops, something went wrong.