Skip to content

Commit

Permalink
Cairo v0.11.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
liorgold2 committed May 29, 2023
1 parent 00ee901 commit 361fe32
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
12 changes: 6 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ http_archive(
)

http_archive(
name = "cairo-compiler-archive-1.1.0-rc",
name = "cairo-compiler-archive-1.1.0",
build_file = get_from_cairo_lang(
"//src/starkware/starknet/compiler/v1:BUILD.cairo-compiler-archive-1.1.0-rc",
"//src/starkware/starknet/compiler/v1:BUILD.cairo-compiler-archive-1.1.0",
),
strip_prefix = "cairo",
url = "https://github.com/starkware-libs/cairo/releases/download/v1.1.0-rc0/release-x86_64-unknown-linux-musl.tar.gz",
url = "https://github.com/starkware-libs/cairo/releases/download/v1.1.0/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",
sha256 = "d506172ca11071274175d74e9c581c3166432d0179b036470e3b9e8d20eae581",
strip_prefix = "pypy3.9-v7.3.11-linux64",
url = "https://downloads.python.org/pypy/pypy3.9-v7.3.11-linux64.tar.bz2",
)

register_toolchains("//bazel_utils/python:py_stub_toolchain")
Expand Down
2 changes: 1 addition & 1 deletion src/starkware/cairo/lang/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.11.2a0
0.11.2
2 changes: 1 addition & 1 deletion src/starkware/cairo/lang/create_cairo_lang_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from starkware.python.utils import get_build_dir_path

COMPILER_DIR = get_build_dir_path("../cairo-compiler-archive-1.1.0-rc")
COMPILER_DIR = get_build_dir_path("../cairo-compiler-archive-1.1.0")

INIT_FILE_CONTENT = "__path__ = __import__('pkgutil').extend_path(__path__, __name__)\n"

Expand Down
2 changes: 1 addition & 1 deletion src/starkware/cairo/vars.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ CAIRO_VM_CRYPTO_ADDITIONAL_LIBS = []
CAIRO_COMMON_LIB_ADDITIONAL_FILES = []
CAIRO_COMMON_LIB_ADDITIONAL_LIBS = []
CAIRO_INSTANCES_LIB_ADDITIONAL_FILES = []
CAIRO_COMPILER_ARCHIVE = "cairo-compiler-archive-1.1.0-rc"
CAIRO_COMPILER_ARCHIVE = "cairo-compiler-archive-1.1.0"
20 changes: 20 additions & 0 deletions src/starkware/python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,26 @@ def get_source_dir_path(rel_path: str = "", default_value: Optional[str] = None)
raise Exception(f"Failed to get source path for {rel_path}.")


def deduce_absolute_path(path: str) -> str:
"""
Returns the given path if it is absolute, and otherwise joins it with the current working
directory.
This function is useful when using Bazel, which changes the current working directory.
Important note: This function assumes that the code is being run using Bazel.
"""

if os.path.isabs(path):
return path

# The path is considered to be relative to the current working directory.
build_working_directory = os.getenv("BUILD_WORKING_DIRECTORY")
assert (
build_working_directory is not None
), "Could not deduce your working directory path; please run your code using Bazel."
return os.path.join(build_working_directory, path)


def assert_same_and_get(*args):
"""
Verifies that all the arguments are the same, and returns this value.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package(default_visibility = ["//visibility:public"])

filegroup(
name = "cairo-compiler-archive-1.1.0-rc",
name = "cairo-compiler-archive-1.1.0",
srcs = glob(["**/*"]),
visibility = ["//visibility:public"],
)
2 changes: 1 addition & 1 deletion src/starkware/starknet/compiler/v1/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

r = runfiles.Create()

COMPILER_DIR = r.Rlocation("cairo-compiler-archive-1.1.0-rc/bin")
COMPILER_DIR = r.Rlocation("cairo-compiler-archive-1.1.0/bin")
else:
COMPILER_DIR = os.path.join(os.path.dirname(__file__), "bin")

Expand Down

0 comments on commit 361fe32

Please sign in to comment.