Skip to content

refactor(build script): rewrite the main build script#2319

Merged
shamardy merged 7 commits intodevfrom
cache-invalidation-fix
Jan 21, 2025
Merged

refactor(build script): rewrite the main build script#2319
shamardy merged 7 commits intodevfrom
cache-invalidation-fix

Conversation

@onur-ozkan
Copy link
Copy Markdown

@onur-ozkan onur-ozkan commented Jan 13, 2025

Previous build script were highly unstable and relied on the MM_DATETIME and MM_VERSION files which was very annoying. These files caused cargo to invalidate the build cache, so even if you ran cargo build multiple times without changing anything, it would still rebuild because the build script triggered cache invalidation.

This PR makes the build script straightforward and more stable without causing cache invalidation. The final versioning output remains as is, but the implementation side is robust than ever.

Major effects:

  • No more cache invalidations.
  • The MM_VERSION and MM_DATETIME files are no longer needed in the project root.
  • Datetime handling is now more stable. Previously MM_DATETIME file could become outdated as it wasn't consistently updated.

Get rid of annoying file reading/writing logics

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the cache-invalidation-fix branch from 3575651 to 5f4d0f6 Compare January 13, 2025 11:07
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We need to revise our docs... This is extremely outdated.

@onur-ozkan onur-ozkan marked this pull request as ready for review January 13, 2025 11:31
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Since this is re-written from scratch, I suggest you to review this by opening the file directly as the diff view will make it likely impossible to understand the logic.

Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Only one question for now. We will need to open a docs PR once this is approved, we need to inform QA that this is breaking as well (in case something depended on the old MM_VERSION/MM_DATETIME files).

borngraced
borngraced previously approved these changes Jan 20, 2025
Copy link
Copy Markdown

@borngraced borngraced left a comment

Choose a reason for hiding this comment

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

Thanks. I tested it locally and it's clean.

// if there is MM_VERSION file, that means CI wants to put a tag to version
if !v_file.is_empty() {
version = format!("{}_{}", version, v_file.trim());
fn version_tag() -> Result<String, String> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

not important get_version_tag seems like better naming

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

LGTM! Please open docs issue @onur-ozkan

@shamardy shamardy merged commit 453b100 into dev Jan 21, 2025
@shamardy shamardy deleted the cache-invalidation-fix branch January 21, 2025 13:35
@onur-ozkan
Copy link
Copy Markdown
Author

LGTM! Please open docs issue @onur-ozkan

will do, thank you for reminding

shamardy pushed a commit that referenced this pull request Jan 28, 2025
This commit makes the build script straightforward and more stable without causing cache invalidation. The final versioning output remains as is, but the implementation side is robust than ever.
shamardy pushed a commit that referenced this pull request Jan 30, 2025
This commit makes the build script straightforward and more stable without causing cache invalidation. The final versioning output remains as is, but the implementation side is robust than ever.
shamardy pushed a commit that referenced this pull request Jan 30, 2025
This commit makes the build script straightforward and more stable without causing cache invalidation. The final versioning output remains as is, but the implementation side is robust than ever.
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Feb 4, 2025
* dev:
  fix(hash-types): remove panic, enforce fixed-size arrays (GLEECBTC#2279)
  fix(ARRR): store unconfirmed change output (GLEECBTC#2276)
  feat(tendermint): staking/delegation (GLEECBTC#2322)
  chore(deps): `timed-map` migration (GLEECBTC#2247)
  fix(mem-leak): `running_swap` never shrinks (GLEECBTC#2301)
  chore(dep-bump): libp2p (GLEECBTC#2326)
  refactor(build script): rewrite the main build script (GLEECBTC#2319)
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Feb 4, 2025
* dev:
  fix(hash-types): remove panic, enforce fixed-size arrays (GLEECBTC#2279)
  fix(ARRR): store unconfirmed change output (GLEECBTC#2276)
  feat(tendermint): staking/delegation (GLEECBTC#2322)
  chore(deps): `timed-map` migration (GLEECBTC#2247)
  fix(mem-leak): `running_swap` never shrinks (GLEECBTC#2301)
  chore(dep-bump): libp2p (GLEECBTC#2326)
  refactor(build script): rewrite the main build script (GLEECBTC#2319)
dimxy pushed a commit that referenced this pull request Feb 16, 2025
* dev:
  fix(derive_key_from_path): check length of current_key_material (#2356)
  chore(release): bump mm2 version to 2.4.0-beta (#2346)
  fix(tests): add additional testnet sepolia nodes to test code (#2358)
  fix(swaps): maintain legacy compatibility for negotiation messages (#2353)
  refactor(SwapOps): impl defaults for protocol specific swapops fns (#2354)
  feat(tpu-v2): provide swap protocol versioning (#2324)
  feat(wallet): add change mnemonic password rpc (#2317)
  fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret (#2261)
  feat(tendermint): unstaking/undelegation (#2330)
  fix(utxo-withdraw): get hw ctx only when `PrivKeyPolicy` is trezor (#2333)
  feat(event-streaming): API-driven subscription management (#2172)
  fix(hash-types): remove panic, enforce fixed-size arrays (#2279)
  fix(ARRR): store unconfirmed change output (#2276)
  feat(tendermint): staking/delegation (#2322)
  chore(deps): `timed-map` migration (#2247)
  fix(mem-leak): `running_swap` never shrinks (#2301)
  chore(dep-bump): libp2p (#2326)
  refactor(build script): rewrite the main build script (#2319)
dimxy pushed a commit that referenced this pull request Feb 16, 2025
* dev:
  fix(derive_key_from_path): check length of current_key_material (#2356)
  chore(release): bump mm2 version to 2.4.0-beta (#2346)
  fix(tests): add additional testnet sepolia nodes to test code (#2358)
  fix(swaps): maintain legacy compatibility for negotiation messages (#2353)
  refactor(SwapOps): impl defaults for protocol specific swapops fns (#2354)
  feat(tpu-v2): provide swap protocol versioning (#2324)
  feat(wallet): add change mnemonic password rpc (#2317)
  fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret (#2261)
  feat(tendermint): unstaking/undelegation (#2330)
  fix(utxo-withdraw): get hw ctx only when `PrivKeyPolicy` is trezor (#2333)
  feat(event-streaming): API-driven subscription management (#2172)
  fix(hash-types): remove panic, enforce fixed-size arrays (#2279)
  fix(ARRR): store unconfirmed change output (#2276)
  feat(tendermint): staking/delegation (#2322)
  chore(deps): `timed-map` migration (#2247)
  fix(mem-leak): `running_swap` never shrinks (#2301)
  chore(dep-bump): libp2p (#2326)
  refactor(build script): rewrite the main build script (#2319)
DeckerSU added a commit to DeckerSU/jenkins-ci-atomicdex that referenced this pull request May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants