Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix args of wrapper script. Optimize build. Add more tests. #45

Merged
merged 4 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
andreibancioiu marked this conversation as resolved.
Show resolved Hide resolved
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:
andreibancioiu marked this conversation as resolved.
Show resolved Hide resolved
specific_contract = packaged.metadata.contract_name

metadata = BuildMetadata.from_env()

options = BuildOptions(
Expand Down
Loading