Skip to content

Commit

Permalink
[framework] compiling the framework seems to take a lot of time so ad…
Browse files Browse the repository at this point in the history
…ding in a caching layers
  • Loading branch information
davidiw authored and aptos-bot committed Apr 1, 2022
1 parent 37cc8f4 commit b8166f7
Show file tree
Hide file tree
Showing 10 changed files with 910 additions and 49 deletions.
15 changes: 12 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"aptos-move/e2e-testsuite",
"aptos-move/framework",
"aptos-move/framework/DPN/releases",
"aptos-move/framework/cached-packages",
"aptos-move/framework/releases",
"aptos-move/genesis-viewer",
"aptos-move/move-examples",
Expand Down
19 changes: 19 additions & 0 deletions aptos-move/framework/cached-packages/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "cached-framework-packages"
version = "0.1.0"
edition = "2018"
authors = ["Aptos Labs <[email protected]>"]
description = "Builds framework packages for caching in builds and tests"
repository = "https://github.com/aptos-labs/aptos-core"
homepage = "https://aptoslabs.com"
license = "Apache-2.0"
publish = false

[dependencies]
aptos-workspace-hack = { path = "../../../crates/aptos-workspace-hack" }
framework-releases = { path = "../releases" }
once_cell = "1.7.2"

[build-dependencies]
move-command-line-common = { git = "https://github.com/diem/move", rev = "3fe033b112eae7df2d15ab3467624165ae510caa" }
framework = { path = ".." }
18 changes: 18 additions & 0 deletions aptos-move/framework/cached-packages/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0

use std::path::PathBuf;

fn main() {
let release = framework::release::ReleaseOptions {
check_layout_compatibility: false,
build_docs: false,
with_diagram: false,
script_builder: false,
script_abis: false,
errmap: false,
package: PathBuf::from("aptos-framework"),
output: PathBuf::from("fresh"),
};
release.create_release();
}
12 changes: 12 additions & 0 deletions aptos-move/framework/cached-packages/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0

use framework_releases::{Release, ReleaseFetcher};
use once_cell::sync::Lazy;

static MODULE_BLOBS: Lazy<Vec<Vec<u8>>> = Lazy::new(||
ReleaseFetcher::new(Release::Aptos, "fresh").module_blobs().unwrap());

pub fn module_blobs() -> Vec<Vec<u8>> {
MODULE_BLOBS.clone()
}
2 changes: 2 additions & 0 deletions aptos-move/framework/releases/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ use std::{

#[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord)]
pub enum Release {
Aptos,
DPN,
}

impl Release {
pub fn to_string(&self) -> &'static str {
match self {
Self::Aptos => "aptos-framework",
Self::DPN => "DPN",
}
}
Expand Down
6 changes: 1 addition & 5 deletions sdk/transaction-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ aptos-types = { path = "../../types" }
proptest = { version = "1.0.0", optional = true }
proptest-derive = { version = "0.3.0", optional = true }
aptos-workspace-hack = { version = "0.1", path = "../../crates/aptos-workspace-hack" }

[build-dependencies]
aptos-temppath = { path = "../../crates/aptos-temppath" }
framework = {path = "../../aptos-move/framework" }
move-command-line-common = { git = "https://github.com/diem/move", rev = "3fe033b112eae7df2d15ab3467624165ae510caa" }
cached-framework-packages = {path = "../../aptos-move/framework/cached-packages" }

[dev-dependencies]
proptest = "1.0.0"
Expand Down
41 changes: 0 additions & 41 deletions sdk/transaction-builder/build.rs

This file was deleted.

1 change: 1 addition & 0 deletions sdk/transaction-builder/errmap/error_description.errmap
Loading

0 comments on commit b8166f7

Please sign in to comment.