Skip to content

Commit

Permalink
Merge pull request #45 from multiversx/fix-v4-2023-12-27
Browse files Browse the repository at this point in the history
Fix args of wrapper script. Optimize build. Add more tests.
  • Loading branch information
andreibancioiu committed Dec 28, 2023
2 parents 0673893 + accd4cf commit ba88142
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_long_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Build
run: |
export PYTHONPATH=.
python ./integration_tests/test_previous_builds_are_reproducible.py --selected-builds "a.1" "a.2" "a.3"
python ./integration_tests/test_previous_builds_are_reproducible.py --selected-builds "a.1" "a.2" "a.3" "a.4"
- name: Save artifacts
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:22.04

# Constants
ARG BUILDER_NAME="multiversx/sdk-rust-contract-builder:v4.2.0"
ARG BUILDER_NAME="multiversx/sdk-rust-contract-builder:v4.2.1"
ARG VERSION_RUST="nightly-2022-10-16"
ARG VERSION_BINARYEN="version_105"
ARG DOWNLOAD_URL_BINARYEN="https://github.com/WebAssembly/binaryen/releases/download/${VERSION_BINARYEN}/binaryen-${VERSION_BINARYEN}-x86_64-linux.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion build_with_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def main(cli_args: List[str]):
parser.add_argument("--packaged-src", type=str, help="source code packaged in a JSON file")
parser.add_argument("--contract", type=str)
parser.add_argument("--output", type=str, default=Path(os.getcwd()) / "output")
parser.add_argument("--package-whole-project-src", type=bool, default=False, help="include all project files in *.source.json (default: %(default)s)")
parser.add_argument("--package-whole-project-src", action="store_true", default=False, help="include all project files in *.source.json (default: %(default)s)")
parser.add_argument("--cargo-target-dir", help="deprecated parameter, not used anymore")
parser.add_argument("--no-wasm-opt", action="store_true", default=False, help="do not optimize wasm files after the build (default: %(default)s)")
parser.add_argument("--build-root", type=str, required=False, help="root path (within container) for the build (default: %(default)s)")
Expand Down
15 changes: 15 additions & 0 deletions integration_tests/previous_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,20 @@ def __init__(self, name: str,
"safe-price-view": "b5a657445ae74423c60210c88a6fa89b0bd4bdd00d5f06e788e14495bccc34c9"
},
docker_image="sdk-rust-contract-builder:next"
),
PreviousBuild(
name="a.4",
project_archive_url="https://github.com/multiversx/mx-exchange-sc/archive/refs/heads/reproducible-v2.5.2-governance-merkle-tree.zip",
project_relative_path_in_archive="mx-exchange-sc-reproducible-v2.5.2-governance-merkle-tree",
packaged_src_url=None,
contract_name=None,
expected_code_hashes={
"lkmex-transfer": "49809df9f07839f965f8197721083cf403c3db969ddc47b5940b4ee8b464af92",
"router": "3257d57945736298c96aa23f99ea0fba3b6da01f9d2103d81230d05cff62cb5a",
"pair": "e9f117971963cb3c24b14e2a7698d48c170335af2f5c8167774c48c3c1c654e3",
"locked-token-wrapper": "1d317cfa2bbe22ea1f878f8a32f90712d49f68a01665b86657d36910b430522f",
"safe-price-view": "b5a657445ae74423c60210c88a6fa89b0bd4bdd00d5f06e788e14495bccc34c9"
},
docker_image="sdk-rust-contract-builder:next"
)
]
3 changes: 3 additions & 0 deletions multiversx_sdk_rust_contract_builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def main(cli_args: List[str]):
packaged = PackagedSourceCode.from_file(packaged_src_path)
packaged.unwrap_to_filesystem(HARDCODED_UNWRAP_FOLDER)

if not specific_contract:
specific_contract = packaged.metadata.contract_name

metadata = BuildMetadata.from_env()

options = BuildOptions(
Expand Down

0 comments on commit ba88142

Please sign in to comment.