certora-cli-alpha-master 20250913.0.7.15157__py3-none-macosx_10_9_universal2.whl → 20250915.8.25.409401__py3-none-macosx_10_9_universal2.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3817,6 +3817,14 @@ def build_source_tree(sources: Set[Path], context: CertoraContext, overwrite: bo
3817
3817
  cwd_file_path.parent.mkdir(parents=True, exist_ok=True)
3818
3818
  cwd_file_path.touch()
3819
3819
 
3820
+ # copy context.forge_remappings to remappings.txt in the source tree, overwriting any existing remappings.txt
3821
+ forge_remappings = getattr(context, 'forge_remappings', None)
3822
+ if forge_remappings:
3823
+ remappings_file_path = Util.get_certora_sources_dir() / context.cwd_rel_in_sources / Util.REMAPPINGS_FILE
3824
+ with remappings_file_path.open("w") as remap_file:
3825
+ for remap in context.forge_remappings:
3826
+ remap_file.write(remap + "\n")
3827
+
3820
3828
  # the empty file .project_directory is written in the source tree to denote the project directory
3821
3829
  rust_proj_dir = getattr(context, 'rust_project_directory', None)
3822
3830
  if rust_proj_dir:
@@ -15,6 +15,7 @@
15
15
 
16
16
  from __future__ import annotations
17
17
 
18
+ import subprocess
18
19
  import sys
19
20
  from pathlib import Path
20
21
 
@@ -37,13 +38,13 @@ log = logging.getLogger(__name__)
37
38
 
38
39
  def build_sui_project(context: CertoraContext, timings: Dict) -> None:
39
40
  """
40
- Compile the Rust artefact and record elapsed time in *timings*.
41
+ Compile the Sui artefact and record elapsed time in *timings*.
41
42
 
42
43
  Args:
43
44
  context: The CertoraContext object containing the configuration.
44
45
  timings: A dictionary to store timing information.
45
46
  """
46
- log.debug("Build Rust target")
47
+ log.debug("Build Sui target")
47
48
  start = time.perf_counter()
48
49
  set_sui_build_directory(context)
49
50
  timings["buildTime"] = round(time.perf_counter() - start, 4)
@@ -52,17 +53,60 @@ def build_sui_project(context: CertoraContext, timings: Dict) -> None:
52
53
 
53
54
 
54
55
  def set_sui_build_directory(context: CertoraContext) -> None:
55
- assert context.move_path, "build_sui_project: expecting move_path to link to a build directory"
56
+ sources: Set[Path] = set()
56
57
 
57
- shutil.copytree(context.move_path, Util.get_build_dir() / Path(context.move_path).name)
58
+ # If no move_path was specified, try to build the package
59
+ if not context.move_path:
60
+ move_toml_file = Util.find_file_in_parents("Move.toml")
61
+ if not move_toml_file:
62
+ raise Util.CertoraUserInputError("Could not find Move.toml, and no move_path was specified.")
63
+ sources.add(move_toml_file.absolute())
64
+ run_sui_build(context, move_toml_file.parent)
58
65
 
59
- sources: Set[Path] = set()
66
+ assert context.move_path, "expecting move_path to be set after build"
67
+ move_dir = Path(context.move_path)
68
+ assert move_dir.exists(), f"Output path '{move_dir}' does not exist"
69
+ assert move_dir.is_dir(), f"Output path '{move_dir}' is not a directory"
70
+
71
+ # Add all source files. We get these from the Sui build output, because it includes dependencies as well, and is
72
+ # available even if we didn't run the build ourselves.
73
+ sources.update(move_dir.rglob("*.move"))
74
+
75
+ # Add conf file if it exists
60
76
  if getattr(context, 'conf_file', None) and Path(context.conf_file).exists():
61
77
  sources.add(Path(context.conf_file).absolute())
62
78
 
79
+ # Copy the binary modules and source maps
80
+ shutil.copytree(move_dir,
81
+ Util.get_build_dir() / move_dir.name,
82
+ ignore=shutil.ignore_patterns('*.move'))
83
+
63
84
  try:
64
85
  # Create generators
65
86
  build_source_tree(sources, context)
66
87
 
67
88
  except Exception as e:
68
89
  raise Util.CertoraUserInputError(f"Collecting build files failed with the exception: {e}")
90
+
91
+ def run_sui_build(context: CertoraContext, package_dir: Path) -> None:
92
+ assert not context.move_path, "run_sui_build: expecting move_path to be empty"
93
+
94
+ build_cmd = ["sui", "move", "build", "--test", "--path", str(package_dir)]
95
+
96
+ try:
97
+ build_cmd_text = ' '.join(build_cmd)
98
+ log.info(f"Building by calling `{build_cmd_text}`")
99
+ result = subprocess.run(build_cmd, capture_output=False)
100
+
101
+ # Check if the script executed successfully
102
+ if result.returncode != 0:
103
+ raise Util.CertoraUserInputError(f"Error running `{build_cmd_text}`")
104
+
105
+ context.move_path = str(package_dir / "build")
106
+
107
+ except Util.TestResultsReady as e:
108
+ raise e
109
+ except Util.CertoraUserInputError as e:
110
+ raise e
111
+ except Exception as e:
112
+ raise Util.CertoraUserInputError(f"An unexpected error occurred: {e}")
@@ -1418,6 +1418,8 @@ def handle_remappings_file(context: SimpleNamespace) -> List[str]:
1418
1418
  elif find_nearest_foundry_toml():
1419
1419
  remappings = get_mappings_from_forge_remappings()
1420
1420
 
1421
+ context.forge_remappings = remappings
1422
+
1421
1423
  return remappings
1422
1424
 
1423
1425
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: certora-cli-alpha-master
3
- Version: 20250913.0.7.15157
3
+ Version: 20250915.8.25.409401
4
4
  Summary: Runner for the Certora Prover
5
5
  Home-page: https://pypi.org/project/certora-cli-alpha-master
6
6
  Author: Certora
@@ -39,4 +39,4 @@ Dynamic: requires-dist
39
39
  Dynamic: requires-python
40
40
  Dynamic: summary
41
41
 
42
- Commit e448c2c. Build and Run scripts for executing the Certora Prover on Solidity smart contracts.
42
+ Commit 977b242. Build and Run scripts for executing the Certora Prover on Solidity smart contracts.
@@ -13,11 +13,11 @@ certora_cli/certoraSorobanProver.py,sha256=SYJKz5Sw-N0bJrSa1njRCE53R9_PMz7IWLhfa
13
13
  certora_cli/rustMutator.py,sha256=6AvOGU8Ijz89zW_ZJCWlfXkeobJsk7EsqZhK7Eqwn-Y,14544
14
14
  certora_cli/CertoraProver/__init__.py,sha256=QHNr-PJQAoyuPgTkO7gg23GRchiWSXglWNG7yLSQZvs,849
15
15
  certora_cli/CertoraProver/certoraApp.py,sha256=RKJ2Krb_CzbRUvczbdE6FhUDrFcvrR8j0JS8MNWXX7s,1469
16
- certora_cli/CertoraProver/certoraBuild.py,sha256=Yn-J7QKxQvtp1uvs03mOfj2w7N_9XixnDmCgoxM-dWM,223495
16
+ certora_cli/CertoraProver/certoraBuild.py,sha256=ileKhlWeKmt5VADQxR8RyB9UzsoWHaMsiOsVkdEToMs,223972
17
17
  certora_cli/CertoraProver/certoraBuildCacheManager.py,sha256=YnZmBZ_gCIbLwExgK5oxFlVDQGe4_YuGIpDLMy589E0,13318
18
18
  certora_cli/CertoraProver/certoraBuildDataClasses.py,sha256=hO0w3YK9V9gZsTbh4gxxlnEAaOiubUwfzNEw6uL1HaE,14841
19
19
  certora_cli/CertoraProver/certoraBuildRust.py,sha256=ZPbNp4ttRmzcKhFsgHSiHDRExNPaLOzgxTRqu23o1D0,6061
20
- certora_cli/CertoraProver/certoraBuildSui.py,sha256=oOY6l3JnxYtFl3i3ibEcOp69x0mKsFg4Z86UnVC6CwY,2383
20
+ certora_cli/CertoraProver/certoraBuildSui.py,sha256=zMXD2XnC4oqRDzPcBvSZmVquL3UG5paBZkfUT3JPbYY,4180
21
21
  certora_cli/CertoraProver/certoraCloudIO.py,sha256=99IRWSA4wAF1q_yu7m1IpDlybMVqtupW_C5qa3Xrhs0,54351
22
22
  certora_cli/CertoraProver/certoraCollectConfigurationLayout.py,sha256=Rln6LsqMp-u0H2fAFulTLAn7GW-j3ox2XZSz0ghdjk0,14116
23
23
  certora_cli/CertoraProver/certoraCollectRunMetadata.py,sha256=i31dkYt8kwlX44SHZtV_b8QI1Egi6cbB5-uuh5beYN0,12630
@@ -65,16 +65,16 @@ certora_cli/Shared/ExpectedComparator.py,sha256=eyRR-jni4WJoa6j2TK2lnZ89Tyb8U99w
65
65
  certora_cli/Shared/__init__.py,sha256=s0dhvolFtsS4sRNzPVhC_rlw8mm194rCZ0WhOxInY40,1025
66
66
  certora_cli/Shared/certoraAttrUtil.py,sha256=Nw8ban5Axp6c6dT-KJfCD9i9tKnGk1DbvRDDNH3--DU,8574
67
67
  certora_cli/Shared/certoraLogging.py,sha256=cV2UQMhQ5j8crGXgeq9CEamI-Lk4HgdiA3HCrP-kSR4,14013
68
- certora_cli/Shared/certoraUtils.py,sha256=buUE95PnbpDEbYEZss_jcP7pWCRJhXnfV-eOA6-zvYM,58407
68
+ certora_cli/Shared/certoraUtils.py,sha256=msCKShnEQCJuXvbbF2YVDs_lAKZclnVIZoYNG0Qe63U,58450
69
69
  certora_cli/Shared/certoraValidateFuncs.py,sha256=BPLuVsS3yAcYIuCvkXtDuFQKf2qaT74TIddB0lM84yM,42508
70
70
  certora_cli/Shared/proverCommon.py,sha256=uZkl9PDLPj81kKRnBnlPUmvhMZovNP25_74No_7jaQ4,11215
71
- certora_jars/ASTExtraction.jar,sha256=YX7Rv-nVvdg8oMZ9flNjsgJ8YVMgUcVNp2O6W33JoZA,17623191
72
- certora_jars/CERTORA-CLI-VERSION-METADATA.json,sha256=BSBSGmQmbU_1cfa3tj7lqUymeQWZOQVwFOct4lSrLDo,166
73
- certora_jars/Typechecker.jar,sha256=Wbg32wRM94ui0c1pTXRqK7Mb1xPyOflCxHOmltwKRuU,17585348
71
+ certora_jars/ASTExtraction.jar,sha256=ikcKnHuLhUhMA7wKNBwvv84DyGYpS_SfcCPPfBCB0mE,17623191
72
+ certora_jars/CERTORA-CLI-VERSION-METADATA.json,sha256=ASw0g48SyKZn3GL5LO9iJJA056u0ooSEI166CXsDt5s,168
73
+ certora_jars/Typechecker.jar,sha256=BoMtRNf45c1hq-15kXUnLHAmkn2vbLB5-a4Uf79M7fw,17585348
74
74
  certora_jars/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
- certora_cli_alpha_master-20250913.0.7.15157.dist-info/LICENSE,sha256=UGKSKIJSetF8m906JLKqNLkUS2CL60XfQdNvxBvpQXo,620
76
- certora_cli_alpha_master-20250913.0.7.15157.dist-info/METADATA,sha256=r3N0N3QdUSKlhvJbuOghN2aZjUyhVOcwY3pwTPCAcyU,1301
77
- certora_cli_alpha_master-20250913.0.7.15157.dist-info/WHEEL,sha256=9Ig2YBzm5cpS_YWKLeuYxVAxcKv_uDQsCzy9XJbRZ_g,110
78
- certora_cli_alpha_master-20250913.0.7.15157.dist-info/entry_points.txt,sha256=ClZiFkCYDdK25_ufxZvnE2Rx_kNk1_4vj7KpgYUKxGM,509
79
- certora_cli_alpha_master-20250913.0.7.15157.dist-info/top_level.txt,sha256=8C77w3JLanY0-NW45vpJsjRssyCqVP-qmPiN9FjWiX4,38
80
- certora_cli_alpha_master-20250913.0.7.15157.dist-info/RECORD,,
75
+ certora_cli_alpha_master-20250915.8.25.409401.dist-info/LICENSE,sha256=UGKSKIJSetF8m906JLKqNLkUS2CL60XfQdNvxBvpQXo,620
76
+ certora_cli_alpha_master-20250915.8.25.409401.dist-info/METADATA,sha256=Bp0nksSnTPr2DEJJfriff8r66Lf5Briix6GsCnia3B0,1303
77
+ certora_cli_alpha_master-20250915.8.25.409401.dist-info/WHEEL,sha256=9Ig2YBzm5cpS_YWKLeuYxVAxcKv_uDQsCzy9XJbRZ_g,110
78
+ certora_cli_alpha_master-20250915.8.25.409401.dist-info/entry_points.txt,sha256=ClZiFkCYDdK25_ufxZvnE2Rx_kNk1_4vj7KpgYUKxGM,509
79
+ certora_cli_alpha_master-20250915.8.25.409401.dist-info/top_level.txt,sha256=8C77w3JLanY0-NW45vpJsjRssyCqVP-qmPiN9FjWiX4,38
80
+ certora_cli_alpha_master-20250915.8.25.409401.dist-info/RECORD,,
Binary file
@@ -1 +1 @@
1
- {"name": "certora-cli-alpha-master", "tag": "", "branch": "master", "commit": "e448c2c", "timestamp": "20250913.0.7.015157", "version": "20250913.0.7.015157+e448c2c"}
1
+ {"name": "certora-cli-alpha-master", "tag": "", "branch": "master", "commit": "977b242", "timestamp": "20250915.8.25.409401", "version": "20250915.8.25.409401+977b242"}
Binary file