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

feat(crates-io): introduce crates-io manager #3103

Merged
merged 61 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ed14be8
feat(crates-io): serialize packages to be published with version and …
clearloop Aug 18, 2023
4efa995
feat(crates-io): publish packages in order
clearloop Aug 18, 2023
9c9f161
feat(crates-io): serde manifest with cargo_toml
clearloop Aug 19, 2023
f755f4c
chore(codegen): force default features for syn
clearloop Aug 19, 2023
eb40006
chore(crates-io): update version of detailed dep
clearloop Aug 19, 2023
4e469f0
feat(crates-io): verify package before publishing
clearloop Aug 19, 2023
a2f9ea5
feat(crates-io): patch core-processor, subxt and sp-arithmetic in cra…
clearloop Aug 19, 2023
c9c25a2
feat(crates-io): merge functions
clearloop Aug 19, 2023
4f30285
ci(crates-io): introduce CI for publishing packages
clearloop Aug 19, 2023
52d249a
feat(crates-io): show case in CI
clearloop Aug 19, 2023
1982768
ci(clippy): make clippy happy
clearloop Aug 19, 2023
9a3f4af
chore(crates-io): clean workspace
clearloop Aug 19, 2023
42cc3ee
Merge branch 'master' into cl/issue-2832
clearloop Aug 19, 2023
7601972
chore(lock): update Cargo.lock
clearloop Aug 19, 2023
3fbdccf
Merge branch 'master' into cl/issue-2832
clearloop Aug 20, 2023
20c3875
Merge branch 'master' into cl/issue-2832
clearloop Aug 31, 2023
508cf63
Merge branch 'master' into cl/issue-2832
clearloop Sep 4, 2023
1d7a34f
chore(crates-io): queue sandbox deps to manager
clearloop Sep 4, 2023
8a417d6
chore(wasm-instrument): clean dep features
clearloop Sep 5, 2023
80dced3
chore(utils): add actor-system-error
clearloop Sep 5, 2023
c65856b
chore(utils): metadata for actor-system-error
clearloop Sep 5, 2023
d7066e2
chore(host): specify wasmi version
clearloop Sep 5, 2023
7cdba5e
chore(sandbox-host): pin version to workspace
clearloop Sep 5, 2023
c673227
chore(gcli): disable command meta
clearloop Sep 6, 2023
b79ea94
chore(crates-io): disable gear-sandbox-host
clearloop Sep 6, 2023
76987a3
chore(clippy): make clippy happy
clearloop Sep 6, 2023
002f9f5
ci(crates-io): test publishing
clearloop Sep 6, 2023
0fc801f
chore(lock): update Cargo.lock
clearloop Sep 6, 2023
68bbd6d
ci(crates-io): trigger only on dispatch
clearloop Sep 6, 2023
c9a6782
chore(gcli): ignore metadata tests
clearloop Sep 7, 2023
d2470d4
chore(clippy): make clippy happy
clearloop Sep 7, 2023
3bc7b81
Merge branch 'master' into cl/issue-2832
clearloop Sep 11, 2023
21df62f
ci(clippy): happy clippy
clearloop Sep 11, 2023
e8672cc
ci(crates-io): show case
clearloop Sep 11, 2023
f04a52e
ci(crates-io): trigger only on dispatching
clearloop Sep 11, 2023
e667982
ci(clippy): happy clippy
clearloop Sep 11, 2023
8200d91
Merge branch 'master' into cl/issue-2832
clearloop Sep 17, 2023
63dba93
chore(lock): update Cargo.lock
clearloop Sep 17, 2023
cf14ca2
Merge branch 'master' into cl/issue-2832
clearloop Oct 28, 2023
cfdd4c9
feat(crates-io): remove more pkgs
clearloop Oct 30, 2023
f530af9
chore(wasm-instrument): rename syscall table tests to core-backend
clearloop Oct 30, 2023
1e1d652
Merge branch 'cl/rename-sys-call-tests' into cl/issue-2832
clearloop Oct 30, 2023
24b31ee
chore(crates-io): remove patches for core-processor
clearloop Oct 30, 2023
294991d
chore(gcli): address comments
clearloop Oct 30, 2023
cb54eed
Merge branch 'master' into cl/issue-2832
clearloop Oct 30, 2023
f5b6a6f
chore(crates-io): test with pre.11
clearloop Oct 31, 2023
47e67dc
ci(crates-io): test with ci
clearloop Oct 31, 2023
7865e45
chore(gcli): remove lazy page
clearloop Nov 1, 2023
0e9e6d2
ci(crates-io): back to on workflow dispatch
clearloop Nov 1, 2023
3b9f297
ci(build): trigger
clearloop Nov 2, 2023
a2e76e6
Merge branch 'master' into cl/issue-2832
clearloop Nov 7, 2023
7a07875
Merge branch 'master' into cl/issue-2832
clearloop Nov 11, 2023
254a1de
ci(crates-io): test release still works
clearloop Nov 11, 2023
ec8907e
ci(crates-io): only work on dispatch
clearloop Nov 11, 2023
a83b466
ci(clippy): make clippy happy
clearloop Nov 11, 2023
6f55d0c
Merge branch 'master' into cl/issue-2832
clearloop Nov 15, 2023
271a9e2
chore(sandbox-host): inherit deps from workspace
clearloop Nov 15, 2023
5155633
ci(crates-io): preview publishing still works
clearloop Nov 15, 2023
d9d776b
ci(crates-io): retrive version
clearloop Nov 15, 2023
9c05fa3
Merge branch 'master' into cl/issue-2832
clearloop Nov 17, 2023
fb25c97
ci(build): trigger build
clearloop Nov 17, 2023
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
25 changes: 25 additions & 0 deletions .github/workflows/crates-io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Crates IO

on:
workflow_dispatch:

env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
TERM: xterm-256color

jobs:
publish:
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v3

- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1

- name: "Publish packages"
run: cargo run --release -p crates-io-manager
88 changes: 82 additions & 6 deletions Cargo.lock

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

14 changes: 12 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ members = [
"gclient",
"gcore",
"gmeta",
"gmeta/codegen",
"gsdk",
"gsdk/codegen",
"gsdk/api-gen",
Expand All @@ -98,6 +99,8 @@ base64 = "0.21.5"
byteorder = { version = "1.5.0", default-features = false }
blake2-rfc = { version = "0.2.18", default-features = false }
bs58 = { version = "0.5.0", default-features = false }
# TODO: upgrade this package ( issue #2694 )
cargo_metadata = "=0.15.3"
clap = { version = "4.4.8" }
codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false }
color-eyre = "0.6.2"
Expand All @@ -109,6 +112,7 @@ dlmalloc = { git = "https://github.com/gear-tech/dlmalloc-rust.git" }
dyn-clonable = "0.9.0"
enum-iterator = "1.4.0"
env_logger = "0.10"
environmental = "1.1.3"
futures = { version = "0.3", default-features = false }
futures-timer = "3.0.2"
futures-util = "0.3.29"
Expand Down Expand Up @@ -163,11 +167,15 @@ tokio = { version = "1.34.0" }
url = "2.4.1"
wat = "1.0.79"
wabt = "0.10.0"
wasmer = "2.2"
wasmer-cache = "2.2.1"
wasmer-types = "2.2"
wasmi = { version = "0.14.0", default-features = false }
wasmparser = { package = "wasmparser-nostd", version = "0.100.1", default-features = false }
which = "4.4.0"
winapi = "0.3.9"
paste = "1.0"
tempfile = "3.5.0"

# Published deps
#
Expand All @@ -194,6 +202,7 @@ gstd = { path = "gstd" }
gsys = { path = "gsys" }
gtest = { path = "gtest" }
gmeta = { path = "gmeta" }
gmeta-codegen = { path = "gmeta/codegen" }
gear-authorship = { path = "node/authorship" }
gear-core-backend = { path = "core-backend", default-features = false }
gear-call-gen = { path = "utils/call-gen" }
Expand Down Expand Up @@ -415,8 +424,6 @@ demo-wat = { path = "examples/wat" }
#
# TODO: remove these dependencies (from this file?) or add more docs.
cfg-if = "1.0.0" # gear-lazy-pages
# TODO: upgrade this package ( issue #2694 )
cargo_metadata = "=0.15.3" # utils/wasm-builder
errno = "0.3" # gear-lazy-pages
impl-trait-for-tuples = "0.2.2" # pallets/staking-rewards
indexmap = "2.1.0" # utils/weight-diff
Expand Down Expand Up @@ -448,6 +455,9 @@ fail = "0.5" # gear
scale-value = "^0.12" # gsdk
heck = "0.4.1" # gsdk-api-gen
etc = "0.1.16" # gcli
cargo_toml = "0.15.3" # crates-io
crates-io = "0.37.0" # crates-io
curl = "0.4.44" # crates-io
scale-decode = "0.9.0" # gsdk
directories = "5.0.1" # utils/key-finder
num-traits = { version = "0.2", default-features = false } # gear-core
Expand Down
3 changes: 1 addition & 2 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ use gear_core::{
};
use primitive_types::H256;
use sp_arithmetic::traits::{BaseArithmetic, One, Saturating, UniqueSaturatedInto, Unsigned};
use sp_core::crypto::UncheckedFrom;
use sp_std::{
collections::{btree_map::BTreeMap, btree_set::BTreeSet},
prelude::*,
Expand Down Expand Up @@ -108,7 +107,7 @@ impl Origin for sp_runtime::AccountId32 {
}

fn from_origin(v: H256) -> Self {
sp_runtime::AccountId32::unchecked_from(v)
Self::new(v.0)
}
}

Expand Down
2 changes: 0 additions & 2 deletions gcli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ clap = { workspace = true, features = ["derive"] }
thiserror.workspace = true
tokio = { workspace = true, features = [ "full" ] }
whoami.workspace = true
core-processor = { workspace = true, features = [ "std" ] }
gear-lazy-pages-interface = { workspace = true, features = [ "std" ] }
reqwest = { workspace = true, default-features = false, features = [ "json", "rustls-tls" ] }
etc.workspace = true
sp-io = { workspace = true, features = [ "std" ] }
Expand Down
1 change: 0 additions & 1 deletion gcli/src/cmd/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ impl Program {
Ok(())
}

/// Display meta.
fn meta(path: &PathBuf, name: &Option<String>) -> Result<()> {
let ext = path
.extension()
Expand Down
6 changes: 0 additions & 6 deletions gcli/src/meta/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
use anyhow::{anyhow, Result};
use wasmi::{AsContextMut, Engine, Extern, Linker, Memory, MemoryType, Module, Store};

const PAGE_STORAGE_PREFIX: [u8; 32] = *b"gcligcligcligcligcligcligcligcli";

/// HostState for the WASM executor
#[derive(Default)]
pub struct HostState {
Expand All @@ -39,10 +37,6 @@ pub fn call_metadata(wasm: &[u8]) -> Result<Vec<u8>> {

/// Executes the WASM code.
fn execute(wasm: &[u8], method: &str) -> Result<Vec<u8>> {
assert!(gear_lazy_pages_interface::try_to_enable_lazy_pages(
PAGE_STORAGE_PREFIX
));

let engine = Engine::default();
let module = Module::new(&engine, wasm).unwrap();

Expand Down
1 change: 0 additions & 1 deletion gcli/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pub use self::{
result::{Error, Result},
traits::{Convert, NodeExec},
};
use gear_core::ids::{CodeId, ProgramId};
use gsdk::{
ext::{sp_core::crypto::Ss58Codec, sp_runtime::AccountId32},
testing::Node,
Expand Down
2 changes: 1 addition & 1 deletion gmeta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository.workspace = true
scale-info.workspace = true
blake2-rfc.workspace = true
hex = { workspace = true, features = ["alloc"] }
gmeta-codegen = { path = "codegen", optional = true }
gmeta-codegen = { workspace = true, optional = true }
derive_more.workspace = true

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion gsdk/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ repository.workspace = true
proc-macro = true

[dependencies]
syn = { workspace = true, features = ["full"] }
syn = { workspace = true, features = ["default", "full"] }
clearloop marked this conversation as resolved.
Show resolved Hide resolved
quote.workspace = true
proc-macro2.workspace = true
12 changes: 6 additions & 6 deletions sandbox/env/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "gear-sandbox-env"
version = "0.1.0"
authors = ["Gear Technologies"]
edition = "2021"
license = "GPL-3.0"
homepage = "https://gear-tech.io"
repository = "https://github.com/gear-tech/gear"
description = "This crate provides means to instantiate and execute wasm modules."
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
version.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
24 changes: 12 additions & 12 deletions sandbox/host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[package]
name = "gear-sandbox-host"
version = "0.1.0"
authors = ["Gear Technologies"]
edition = "2021"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://gear-tech.io"
repository = "https://github.com/gear-tech/gear"
description = "A set of common definitions that are needed for defining execution engines."
readme = "README.md"
authors.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
version.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { workspace = true, features = ["std"] }
environmental = "1.1.3"
environmental.workspace = true
thiserror.workspace = true
log = { workspace = true, features = ["std"] }
wasmer = { version = "2.2", features = ["singlepass"] }
wasmer-types = "2.2"
wasmer = { workspace = true, features = ["singlepass"] }
wasmi = { git = "https://github.com/gear-tech/wasmi", branch = "v0.13.2-sign-ext", features = ["virtual_memory"] }
wasmer-types.workspace = true
sp-allocator = { workspace = true, features = ["std"] }
sp-wasm-interface = { workspace = true, features = ["std"] }
gear-sandbox-env = { workspace = true, features = ["std"] }
wasmer-cache = { version = "2.2.1", optional = true }
once_cell = "1.17.1"
tempfile = "3.5.0"
wasmer-cache = { workspace = true, optional = true }
once_cell.workspace = true
tempfile.workspace = true

[features]
default = ["wasmer-cache"]
Loading
Loading