Skip to content

Allow setting target directory for contract builds#2063

Merged
davidsemakula merged 2 commits intomasterfrom
semakula/artifacts-dir
Jun 25, 2025
Merged

Allow setting target directory for contract builds#2063
davidsemakula merged 2 commits intomasterfrom
semakula/artifacts-dir

Conversation

@davidsemakula
Copy link
Collaborator

@davidsemakula davidsemakula commented Jun 25, 2025

Summary

Related to use-ink/ink#2520

  • [y] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependent on the specific version of ink or pallet-contracts?

Description

  • Allow setting target directory for contract builds by introducing a target_dir field in ExecutionArgs
    • This is currently intended to allow e2e tests infra to share intermediate build artifacts across all contract dependency builds (see details), so it's currently not exposed as a CLI arg
  • Share target directory for intermediate build artifacts for contracts in workspaces (similar to how cargo handles target directory in workspaces)
    • Introduces an artifact_directory field in CrateMetadata allowing only the final build artifacts (i.e. contract binary, metadata e.t.c) to be placed in a separate directory for each workspace member (also similar to cargo's currently unstable --artifact-dir , but only used internally)

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have added an entry to CHANGELOG.md
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@davidsemakula davidsemakula force-pushed the semakula/artifacts-dir branch from c50a918 to 2db6052 Compare June 25, 2025 08:06
@davidsemakula davidsemakula changed the title Allow setting target-dir for contract builds Allow setting target directory for contract builds Jun 25, 2025
@davidsemakula davidsemakula marked this pull request as ready for review June 25, 2025 09:38
@davidsemakula davidsemakula requested review from AlexD10S and removed request for ascjones June 25, 2025 09:38
Copy link
Member

@AlexD10S AlexD10S left a comment

Choose a reason for hiding this comment

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

LGTM!

@davidsemakula davidsemakula merged commit c98ce28 into master Jun 25, 2025
13 checks passed
@davidsemakula davidsemakula deleted the semakula/artifacts-dir branch June 25, 2025 13:25
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.

2 participants