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

V5 (LTS): package whole project source code #52

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

andreibancioiu
Copy link
Contributor

@andreibancioiu andreibancioiu commented Jan 10, 2024

  • Do not exclude meta/Cargo.lock anymore - they are extremely important if the project is not a Cargo workspace.
  • The file *.source.json now contains the whole packaged source code.
  • The file *.partial.source.json contains only the source code of the contract to be built and the source code of its local dependencies - it should never be used (suffers from incompleteness) . Exists for exotic use-cases, if any.

This will be promoted to v6, as well.

Also see: https://discord.com/channels/1045353153073258557/1194657415690473482

@andreibancioiu andreibancioiu self-assigned this Jan 10, 2024
@andreibancioiu andreibancioiu changed the base branch from main to release/v5 January 10, 2024 21:17
@andreibancioiu andreibancioiu marked this pull request as ready for review January 11, 2024 10:21
@@ -1,7 +1,7 @@
FROM ubuntu:22.04

# Constants
ARG BUILDER_NAME="multiversx/sdk-rust-contract-builder:v5.4.1"
ARG BUILDER_NAME="multiversx/sdk-rust-contract-builder:v5.5.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New minor version. No impact on WASM codehashes.

@@ -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", action="store_true", 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="deprecated parameter, not used anymore")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's implicit. Will be removed at a later time.

)

create_packaged_source_code(
parent_project_folder=project_within_build_folder,
package_whole_project_src=False,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept for exotic purposes. Won't be advertised in docs etc.

@@ -24,7 +24,7 @@ def main(cli_args: List[str]):

parser = ArgumentParser()
parser.add_argument("--project", type=str, required=False, help="source code folder (project)")
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("--package-whole-project-src", action="store_true", default=False, help="deprecated parameter, not used anymore")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's implicit (always true). Will be removed at a later time.

@@ -61,8 +61,6 @@ def get_source_code_files(
def _is_source_code_file(path: Path) -> bool:
if path.suffix == ".rs":
return True
if path.parent.name == "meta" and path.name == "Cargo.lock":
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very important change. Some projects aren't Cargo workspaces, and this Cargo lock file should be included in the packaged source code.

@andreibancioiu andreibancioiu merged commit 021c0b7 into release/v5 Jan 11, 2024
2 checks passed
@andreibancioiu andreibancioiu deleted the package-whole-v5 branch January 11, 2024 12:06
@andreibancioiu andreibancioiu changed the title V5 (LTS) Package whole project source code V5 (LTS): package whole project source code Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants