Skip to content

Commit

Permalink
Merge branch 'master' into vincent/SDK-1798
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-dfinity authored Sep 27, 2024
2 parents 201e2b7 + ba7bc4f commit 0e5e10c
Show file tree
Hide file tree
Showing 12 changed files with 311 additions and 163 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Valid settings are:

## Dependencies

### Motoko

Updated Motoko to [0.13.0](https://github.com/dfinity/motoko/releases/tag/0.13.0)

### Replica

Updated replica to elected commit 179973553248415fc85679d853b48b0e0ec231c6.
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The `IC SDK` installation script installs several components in default location
| Component | Description | Default location |
|--------------|----------------------------------------------------------------------------------------------------|-----------------------------------------------|
| dfx | Command-line interface (CLI) | `/usr/local/bin/dfx` |
| dfxvm | Command-line interface, version manager | `/usr/local/bin/dfxvm` |
| moc | Motoko runtime compiler | `~/.cache/dfinity/versions/<VERSION>/moc` |
| replica | Internet Computer local network binary | `~/.cache/dfinity/versions/<VERSION>/replica` |
| uninstall.sh | Script to remove the SDK and all of its components | `~/.cache/dfinity/uninstall.sh` |
Expand All @@ -28,8 +29,10 @@ There are a few components above worth expanding on:

1. **dfx** - `dfx` is the command-line interface for the `IC SDK`. This is why many commands for the IC SDK start with the command "`dfx ..`" such as `dfx new` or `dfx stop`.

2. **Canister Development Kit (CDK)** - A CDK is an adapter used by the IC SDK so a programming language has the features needed to create and manage canisters.
The IC SDK comes with a few CDKs already installed for you so you can use them in the language of yoru choice. That is why there is a [Rust CDK](https://github.com/dfinity/cdk-rs), [Python CDK](https://demergent-labs.github.io/kybra/),
2. **dfxvm** - `dfxvm` is the version manager for `dfx`, i.e. a CLI for selecting and managing installed `dfx` versions.

3. **Canister Development Kit (CDK)** - A CDK is an adapter used by the IC SDK so a programming language has the features needed to create and manage canisters.
The IC SDK comes with a few CDKs already installed for you so you can use them in the language of your choice. That is why there is a [Rust CDK](https://github.com/dfinity/cdk-rs), [Python CDK](https://demergent-labs.github.io/kybra/),
[TypeScript CDK](https://demergent-labs.github.io/azle/), etc... Since CDKs are components used the SDK, some developer choose to use the CDK directly (without the `IC SDK`),
but typically are used as part of the whole `IC SDK`.

Expand Down
2 changes: 1 addition & 1 deletion e2e/tests-dfx/upgrade_check.bash
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ teardown() {
jq '.canisters.hello_backend.main="v5.mo"' dfx.json | sponge dfx.json
echo yes | (
assert_command dfx deploy
assert_match "Stable interface compatibility check issued an ERROR"
assert_match "Stable interface compatibility check issued a WARNING"
)
assert_command dfx canister call hello_backend read '()'
assert_match "(0 : int)"
Expand Down
18 changes: 9 additions & 9 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,27 @@
"builtin": false,
"description": "The Motoko base library",
"owner": "dfinity",
"sha256": "1ilqh5f8y5dwf7vx9g627bw6vprg42z9qm8cl24kdcaakqvb7p8l",
"sha256": "02nf25bm21rmyh425arh0srb52bgsyrbqmnmy7r8zd1lfd6jnpfc",
"type": "tarball",
"url": "https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz",
"url": "https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-base-library.tar.gz",
"url_template": "https://github.com/dfinity/motoko/releases/download/<version>/motoko-base-library.tar.gz",
"version": "0.12.1"
"version": "0.13.0"
},
"motoko-x86_64-darwin": {
"builtin": false,
"sha256": "0yjzfavxfllmg1dnrbmm1aw3l9kk10dxsa8jy5c284iwz6ka3ks1",
"sha256": "1bknwvhh44ysdr1xg3x856x528b55752yn6x808lwjyi1yysnqcc",
"type": "file",
"url": "https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Darwin-x86_64-0.12.1.tar.gz",
"url": "https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Darwin-x86_64-0.13.0.tar.gz",
"url_template": "https://github.com/dfinity/motoko/releases/download/<version>/motoko-Darwin-x86_64-<version>.tar.gz",
"version": "0.12.1"
"version": "0.13.0"
},
"motoko-x86_64-linux": {
"builtin": false,
"sha256": "1qmyrnirwgrafgqdwv4bw5803gzinvqa7mfk7qnlmmhgm5csjp8y",
"sha256": "1njn9cyalgj33imysblbbpxpqp0fvadckk5b8wsw92l67fksp0mf",
"type": "file",
"url": "https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Linux-x86_64-0.12.1.tar.gz",
"url": "https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Linux-x86_64-0.13.0.tar.gz",
"url_template": "https://github.com/dfinity/motoko/releases/download/<version>/motoko-Linux-x86_64-<version>.tar.gz",
"version": "0.12.1"
"version": "0.13.0"
},
"pocket-ic-x86_64-darwin": {
"rev": "285a5db07da50a4e350ec43bf3b488cc6fe36102",
Expand Down
23 changes: 17 additions & 6 deletions src/dfx-core/src/config/project_templates.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use itertools::Itertools;
use std::collections::BTreeMap;
use std::fmt::Display;
use std::io;
use std::sync::OnceLock;

Expand All @@ -17,11 +18,18 @@ pub enum Category {
Frontend,
FrontendTest,
Extra,
Support,
}

#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ProjectTemplateName(pub String);

impl Display for ProjectTemplateName {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}

#[derive(Debug, Clone)]
pub struct ProjectTemplate {
/// The name of the template as specified on the command line,
Expand All @@ -38,14 +46,17 @@ pub struct ProjectTemplate {
/// as well as for interactive selection
pub category: Category,

/// If true, run `cargo update` after creating the project
pub update_cargo_lockfile: bool,
/// Other project templates to patch in alongside this one
pub requirements: Vec<ProjectTemplateName>,

/// Run a command after adding the canister to dfx.json
pub post_create: Vec<String>,

/// If true, patch in the any_js template files
pub has_js: bool,
/// If set, display a spinner while this command runs
pub post_create_spinner_message: Option<String>,

/// If true, run npm install
pub install_node_dependencies: bool,
/// If the post-create command fails, display this warning but don't fail
pub post_create_failure_warning: Option<String>,

/// The sort order is fixed rather than settable in properties:
/// For backend:
Expand Down
16 changes: 8 additions & 8 deletions src/dfx/assets/dfx-asset-sources.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ url = 'https://download.dfinity.systems/ic/285a5db07da50a4e350ec43bf3b488cc6fe36
sha256 = '112b0612df652f5291214c3999b2d0fff90f024e408aee28a503bc7c40b3a2e9'

[x86_64-darwin.motoko]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Darwin-x86_64-0.12.1.tar.gz'
sha256 = '41cfa1a6f93c122458f11229dd1b0873263ab80ab5ae6c5b789552d7b7725f7a'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Darwin-x86_64-0.13.0.tar.gz'
sha256 = '8c61abbd0fd14b4e1140dd582fca29652151ba29a88fd7436eda1302e1e676ae'
# The replica, canister_sandbox and compiler_sandbox binaries must have the same revision.

[x86_64-darwin.replica]
Expand Down Expand Up @@ -53,8 +53,8 @@ url = 'https://download.dfinity.systems/ic/285a5db07da50a4e350ec43bf3b488cc6fe36
sha256 = '2957435b0fdadd6bf0a7e91de1b16a7dbc580caa15b03fa09793262b71ffc674'

[x86_64-darwin.motoko-base]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz'
sha256 = '21a9c67658033a9cfafae2b9b1a601b5536e460621ede835f879a1c76eaa0a45'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-base-library.tar.gz'
sha256 = 'fcefaf998b0ddb75100f46cc23ac8a384ef4d7b26374a38f353055b2c8fa3fb6'

[x86_64-darwin.ic-btc-canister]
url = 'https://github.com/dfinity/bitcoin-canister/releases/download/release%2F2023-10-13/ic-btc-canister.wasm.gz'
Expand All @@ -81,8 +81,8 @@ url = 'https://download.dfinity.systems/ic/285a5db07da50a4e350ec43bf3b488cc6fe36
sha256 = 'd8c7c9d4bca638afd87afd4b4125395fe5255a61c23830fd9d6de8ae95458588'

[x86_64-linux.motoko]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-Linux-x86_64-0.12.1.tar.gz'
sha256 = '1e5da959a90fd64a2d3ed3d5a3f0b6f1bf0150e18b6cdef0732a3f9ea3cdbee2'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-Linux-x86_64-0.13.0.tar.gz'
sha256 = 'ae82aba73b868ac43547abccc99ada0e5c7cfb5d8b2eed6b1c433eaa3c4b56da'
# The replica, canister_sandbox and compiler_sandbox binaries must have the same revision.

[x86_64-linux.replica]
Expand Down Expand Up @@ -112,8 +112,8 @@ url = 'https://download.dfinity.systems/ic/285a5db07da50a4e350ec43bf3b488cc6fe36
sha256 = '7723cc8d89f2d94e820d3c207bccb8fb5cff755035ee3c1aabcb572ccaa78389'

[x86_64-linux.motoko-base]
url = 'https://github.com/dfinity/motoko/releases/download/0.12.1/motoko-base-library.tar.gz'
sha256 = '21a9c67658033a9cfafae2b9b1a601b5536e460621ede835f879a1c76eaa0a45'
url = 'https://github.com/dfinity/motoko/releases/download/0.13.0/motoko-base-library.tar.gz'
sha256 = 'fcefaf998b0ddb75100f46cc23ac8a384ef4d7b26374a38f353055b2c8fa3fb6'

[x86_64-linux.ic-btc-canister]
url = 'https://github.com/dfinity/bitcoin-canister/releases/download/release%2F2023-10-13/ic-btc-canister.wasm.gz'
Expand Down
Loading

0 comments on commit 0e5e10c

Please sign in to comment.