Skip to content

feat: Make integration #4083

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

Open
wants to merge 547 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
547 commits
Select commit Hold shift + click to select a range
559869a
cargo fmt & cpilly
vporton May 7, 2024
eed2047
attempted bug fix in `dfx build`
vporton May 7, 2024
c0a7a86
bug fix
vporton May 7, 2024
092d91f
bug fix
vporton May 9, 2024
f9def45
a bug fix introducing new bugs
vporton May 9, 2024
f968255
bug fix
vporton May 9, 2024
cd093c5
removed tracing
vporton May 9, 2024
8fe9f5f
removed unused import
vporton May 9, 2024
27c1b32
cargo clippy
vporton May 9, 2024
9d7770d
cargo fmt
vporton May 9, 2024
bbbdd8a
bug fix
vporton May 9, 2024
61d3441
bug fix
vporton May 9, 2024
4742995
removed tracing
vporton May 9, 2024
011f850
removed tracing
vporton May 9, 2024
22b167b
Revert "removed tracing"
vporton May 9, 2024
fa90db2
reduced tracing
vporton May 9, 2024
126fc0c
FIXME comment
vporton May 9, 2024
4195401
started my graph library
vporton May 9, 2024
3287d4a
refactoring
vporton May 9, 2024
a14a2f3
refactored (probably with errors)
vporton May 9, 2024
8be21aa
bug fixes
vporton May 9, 2024
101f5f5
refactor with possible bugfixes
vporton May 9, 2024
5525f85
small refactor
vporton May 9, 2024
f0ffa2a
bug fix
vporton May 9, 2024
75a828b
misc dev
vporton May 9, 2024
c469252
removed commented out code
vporton May 9, 2024
b219349
bug fix
vporton May 9, 2024
24df5c0
misc debugging
vporton May 9, 2024
f9c51f2
small refactor
vporton May 9, 2024
1fb5ccf
refactor
vporton May 9, 2024
cac0af7
bug fix
vporton May 10, 2024
4d87be9
removed tracing
vporton May 10, 2024
e79b5c0
Merge branch 'master' into build-only-necessary
vporton May 10, 2024
d1caf26
misc
vporton May 10, 2024
a903bad
bug fix and commented code removal
vporton May 10, 2024
cb777c9
removed outdated TODO comment
vporton May 10, 2024
cbd73b1
refactor
vporton May 10, 2024
5810bb0
refactor
vporton May 10, 2024
231fc52
function renamed
vporton May 10, 2024
6eb4106
Merge branch 'build-only-necessary' of github.com:vporton/sdk into bu…
vporton May 10, 2024
2c4a0d2
added `imports` to env
vporton May 10, 2024
ca55305
moved imports data to Environment
vporton May 10, 2024
5134b39
simplified
vporton May 10, 2024
49681b4
comment
vporton May 10, 2024
86589b3
Merge branch 'build-only-necessary-dev' into build-only-necessary
vporton May 10, 2024
51862b4
removed an outdated FIXME comment
vporton May 14, 2024
20eb813
removed an outdated FIXME comment
vporton May 14, 2024
e4afa4c
removed a done TODO comment
vporton May 14, 2024
4a9881a
reafctor
vporton May 14, 2024
c24b3ec
comment
vporton May 14, 2024
1dc9736
messages and comments
vporton May 14, 2024
0971460
removed a wrong TODO
vporton May 14, 2024
1d0b8f8
comments
vporton May 14, 2024
e4c401f
better error message
vporton May 14, 2024
36c69bd
removed unneeded TODO comment
vporton May 14, 2024
4100443
comment
vporton May 14, 2024
8fb62b2
removed unused code
vporton May 14, 2024
b07fe2f
comment correction
vporton May 14, 2024
ecb803d
removed an undoable TODO
vporton May 14, 2024
6d8560d
variable rename
vporton May 14, 2024
9c42521
removed superfluous TODO comment
vporton May 14, 2024
7f9ad79
Merge branch 'build-only-necessary-dev' into build-only-necessary
vporton May 14, 2024
0aec121
better error message
vporton May 14, 2024
027a249
Merge branch 'build-only-necessary-dev' into build-only-necessary
vporton May 14, 2024
d913a7f
Merge remote-tracking branch 'upstream/master' into build-only-necess…
vporton May 14, 2024
dfecd10
removed commented out code
vporton May 15, 2024
6bb29af
removed an inappropriate TODO comment
vporton May 15, 2024
7508357
Merge remote-tracking branch 'upstream/master' into build-only-necess…
vporton May 15, 2024
4d86bda
merge
vporton May 15, 2024
2134dc4
Merge remote-tracking branch 'upstream/master' into build-only-necess…
vporton May 25, 2024
27c9e4d
more error context
vporton May 25, 2024
8e9d0e0
fixed a regression (after adding more error contexts)
vporton May 25, 2024
94e656b
possible bug fix
vporton May 25, 2024
2cfbcf2
debugging
vporton May 25, 2024
39ced7e
debugging
vporton May 25, 2024
33fd5b5
"deploy writes all environment variables to .env" test passed
vporton May 25, 2024
89cbac6
removed warning
vporton May 25, 2024
3b57d0c
removed an overestimated TODO comment
vporton May 25, 2024
c8fe66d
clippy
vporton May 25, 2024
fdd2ce3
cargo fmt
vporton May 25, 2024
222654c
removed commented out code
vporton May 26, 2024
568cd6b
corrected test
vporton May 26, 2024
be01eea
bug fix
vporton May 26, 2024
fb9a28a
Merge branch 'master' into build-only-necessary
vporton May 31, 2024
9338d4b
removed an apparently fixed FIXME
vporton May 31, 2024
80c6f1a
Merge branch 'build-only-necessary' of github.com:vporton/sdk into bu…
vporton May 31, 2024
5731e86
removed an outdated TODO comment
vporton Jun 9, 2024
1e057d0
removed an outdated TODO comment
vporton Jun 9, 2024
78352ae
more logging
vporton Jun 9, 2024
bb51187
TODO comment
vporton Jun 9, 2024
7299111
bug fix
vporton Jun 16, 2024
dbca709
new command line options
vporton Jan 26, 2025
a70ccd6
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Jan 26, 2025
dfb9ec3
fix bugs
vporton Jan 26, 2025
7433784
read_dependencies()
vporton Jan 26, 2025
8ea457d
Add 'old/' from commit '7299111abec4c300b15b3e6d89f14d1d4c087203'
vporton Jan 26, 2025
9722f2c
add get_dependencies
vporton Jan 27, 2025
76457e0
read_all_dependencies
vporton Jan 27, 2025
60f71b3
output all dependencies
vporton Jan 27, 2025
13e7381
output some bild rules
vporton Jan 27, 2025
8521c9c
most (all?) rules are done
vporton Jan 27, 2025
de54cfc
bug fix
vporton Jan 27, 2025
ee119c0
fixes
vporton Jan 27, 2025
c6ddab7
bug fix
vporton Jan 27, 2025
36ed949
success building some canisters
vporton Jan 27, 2025
60601c7
removed old/ subtree
vporton Jan 27, 2025
f9e0d1f
fix bug
vporton Jan 28, 2025
cac719d
remove warnings
vporton Jan 28, 2025
8c2408a
misc
vporton Jan 28, 2025
b4c9b79
output generate@ rules
vporton Jan 28, 2025
c2ea21f
bug fixes in generate@
vporton Jan 28, 2025
b75d5fb
add generate@ dependencies to rules
vporton Jan 28, 2025
d23d7f3
use relative paths
vporton Jan 28, 2025
54f04d4
misc
vporton Jan 28, 2025
bfb3ee2
remove tracing
vporton Jan 28, 2025
d2a7c90
remove unused import
vporton Jan 28, 2025
4e1ab70
fix bug
vporton Jan 28, 2025
28d4771
fix bugs
vporton Jan 28, 2025
cb47f82
fix bug
vporton Jan 28, 2025
2ef2a5b
Merge remote-tracking branch 'upstream/master' into make-merge upstream
vporton Jan 28, 2025
708b457
fix after merge upstream
vporton Jan 28, 2025
5ca650a
CHANGELOG.md
vporton Jan 28, 2025
93e2a00
cli-reference
vporton Jan 28, 2025
5e5f3f5
bug fix
vporton Jan 29, 2025
9da9139
refactor
vporton Jan 29, 2025
7b4050f
$(DEPLOY_FLAGS)
vporton Jan 29, 2025
4f21c99
bug fix
vporton Jan 29, 2025
04d29e4
bug fixes
vporton Jan 29, 2025
f0e6617
bug fix
vporton Jan 29, 2025
d9f34aa
remove outdated FIXME
vporton Jan 29, 2025
4ef5f76
remove outdated FIXME
vporton Jan 29, 2025
bc91f69
bug fix
vporton Jan 29, 2025
f595c87
remove outdated FIXME
vporton Jan 29, 2025
b2b01bc
remove superfluous FIXME
vporton Jan 29, 2025
cc22a39
remove superfluous TODOs
vporton Jan 29, 2025
34fbb9c
remove obvious comment
vporton Jan 29, 2025
ebe8c24
change wrong identifier
vporton Jan 29, 2025
68e48c9
remove workaround of fixed bug
vporton Jan 29, 2025
fac40ce
add TODO comment
vporton Jan 29, 2025
9c40e3c
refactor
vporton Jan 29, 2025
7c23640
bug fix
vporton Jan 29, 2025
e8e46f7
bug fix
vporton Jan 29, 2025
cd28912
bug fix
vporton Jan 29, 2025
df421f7
bug fix
vporton Jan 29, 2025
2be04f3
fix bug
vporton Jan 29, 2025
e63fd25
bug fix
vporton Jan 29, 2025
7d92d01
fix extra recompilations bug
vporton Jan 29, 2025
8943c39
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Jan 29, 2025
1a97f02
FIXME
vporton Jan 29, 2025
093dce0
rename variable
vporton Jan 29, 2025
dbefcf5
fix bug
vporton Jan 29, 2025
834d2bc
fix bug
vporton Jan 29, 2025
2ff4793
merge
vporton Jan 29, 2025
0bba2e8
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Jan 30, 2025
c51fa89
fix non-recompilation of asets
vporton Jan 30, 2025
029c670
fix bug
vporton Jan 30, 2025
a468c3e
fix bug
vporton Jan 30, 2025
464370c
FIXME
vporton Jan 30, 2025
a9f59b2
remove redundant code
vporton Jan 30, 2025
af0ef28
network option
vporton Jan 30, 2025
800b247
merge
vporton Feb 1, 2025
ab3428c
remove commented code
vporton Feb 1, 2025
6f6dbe9
fix bug
vporton Feb 1, 2025
b8cfa10
bug fix
vporton Feb 2, 2025
d13e6a4
fix bug
vporton Feb 2, 2025
1abf71d
fix bug
vporton Feb 3, 2025
5dc4207
bug fix
vporton Feb 4, 2025
224a20b
merge upstream
vporton Feb 4, 2025
4a075cd
fix bug
vporton Feb 4, 2025
eb0a94d
merged
vporton Feb 4, 2025
78def31
fix bug
vporton Feb 5, 2025
e0d8b0b
canister@ -> build@
vporton Feb 5, 2025
49a6353
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Feb 8, 2025
181382e
merge
vporton Feb 14, 2025
38b909a
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Feb 14, 2025
62ff007
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Feb 21, 2025
00c51dc
FIXME/TODO
vporton Feb 21, 2025
a9137e8
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton Feb 25, 2025
e97e5d1
bug fix
vporton Feb 25, 2025
b0545cc
merge upstream
vporton Feb 26, 2025
19579c0
merge
vporton Mar 16, 2025
00c6e59
merged
vporton Mar 26, 2025
3484a41
merge upstream
vporton Apr 7, 2025
06aa129
merge upstream
vporton Apr 17, 2025
870086f
merge upstream
vporton Apr 28, 2025
e27c256
merge upstream
vporton May 1, 2025
52eb421
fix bug
vporton May 9, 2025
d10a05c
fix bug
vporton May 9, 2025
4d9a38b
fix bug
vporton May 9, 2025
889bd36
add FIXME comment
vporton May 10, 2025
c1eaf99
fix bug
vporton May 10, 2025
3ea1de6
update FIXME comment
vporton May 10, 2025
113bc3f
merge upstream
vporton May 13, 2025
e44c342
rewriting
vporton May 13, 2025
3d913cb
refactor
vporton May 13, 2025
098581b
refactor
vporton May 13, 2025
3fadcbe
fix code formatting
vporton May 13, 2025
7d7d21e
rewriting
vporton May 14, 2025
7290d90
fixing rewritten code
vporton May 14, 2025
2684ca4
fixing rewritten code
vporton May 14, 2025
54d4d32
fixing rewritten code
vporton May 14, 2025
5a301c0
fixing rewritten code
vporton May 14, 2025
91e58ac
fixing rewritten code
vporton May 14, 2025
5b6f70c
fixing rewritten code
vporton May 14, 2025
23b32a4
fixing rewritten code
vporton May 14, 2025
8e407fe
fixing rewritten code
vporton May 14, 2025
cc4a11a
update code formatting
vporton May 14, 2025
dbb345e
update code formatting
vporton May 14, 2025
72d1d34
update code formatting
vporton May 14, 2025
1b87b6d
update code formatting
vporton May 14, 2025
c092e85
update code formatting
vporton May 14, 2025
7f36bec
update code formatting
vporton May 15, 2025
ec30936
fixing rewritten code
vporton May 15, 2025
31a6c02
fixing rewritten code
vporton May 15, 2025
b3f8044
fixing rewritten code
vporton May 15, 2025
def9f93
fixing rewritten code
vporton May 15, 2025
e13ef2c
fixing rewritten code
vporton May 15, 2025
89d5031
fixing rewritten code
vporton May 15, 2025
0ae8142
compiled
vporton May 15, 2025
7c05c6b
fixing rewritten code
vporton May 18, 2025
96224db
typo
vporton May 18, 2025
cfb7716
remove FIXME comment
vporton May 18, 2025
dff50b6
remove coommented out coode
vporton May 18, 2025
135c94a
simplified
vporton May 18, 2025
03038d3
simplified
vporton May 18, 2025
0e196cc
remove superfluous variable
vporton May 18, 2025
4ed582e
fix bugs
vporton May 18, 2025
c729822
remove commented out code
vporton May 18, 2025
713bcd9
refactor
vporton May 18, 2025
818bb95
remove commented out code
vporton May 18, 2025
eef7223
it seems to work
vporton May 18, 2025
5f699ef
simplify
vporton May 18, 2025
f723895
remove cmmented out code
vporton May 18, 2025
cbd5482
expanded some rules
vporton May 18, 2025
7d06e9a
improvenment
vporton May 19, 2025
49b773c
finished new rules engine
vporton May 19, 2025
6f938d5
remove superfluous rules
vporton May 19, 2025
f754bdf
make deps sorted
vporton May 20, 2025
5ff20a8
remove trailing spaces
vporton May 20, 2025
cba7e93
remove ROOT_DIR Make variable
vporton May 20, 2025
0098477
add FIXME note
vporton May 20, 2025
5221ed4
fix dependency on unexistent files
vporton May 20, 2025
d99a8d7
remove done FIXME/TODO comments
vporton May 20, 2025
cc3c1c9
Merge remote-tracking branch 'upstream/master' into make-integration2
vporton May 20, 2025
030c7bf
refactor
vporton May 20, 2025
105dd5b
remove outdated FIXME comment
vporton May 20, 2025
6444d5f
restore lost code
vporton May 21, 2025
f78cc24
bug fix
vporton May 21, 2025
7f1d6eb
merge upstream
vporton May 27, 2025
3a8f1ad
merged upstream
vporton Jun 20, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ advisory-db/

# mops
**/.mops/
.qodo
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# UNRELEASED

* Flags `--no-compile` and `--no-deps`

* Command `rules` that outputs time-efficient GNU Make rules.

### fix: deps deploy works with Canister ID out of the ranges of the pocket-ic subnets

The `dfx deps deploy` command didn't work when the pulled dependency's Canister ID is out of the ranges of the `pocket-ic` subnets.
Expand Down Expand Up @@ -99,6 +103,7 @@ This incorporates the following executed proposals:
dfx would try to reuse canister ids when switching from a shared network to a project network,
which would cause errors since those canister ids wouldn't exist. dfx now deletes the .dfx
directory if it was previously used with the shared local network.
>>>>>>> upstream/master

### feat: Set canister ids using `dfx canister set-id <canister name> <principal>`

Expand Down
7 changes: 4 additions & 3 deletions docs/cli-reference/dfx-build.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ dfx build [flag] [option] [--all | canister_name]

You can use the following optional flags with the `dfx build` command.

| Flag | Description |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--check` | Builds canisters using a temporary, hard-coded, locally-defined canister ID for testing that the canister compiles without connecting to ICP. |
| Flag | Description |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--check` | Builds canisters using a temporary, hard-coded, locally-defined canister ID for testing that the canister compiles without connecting to ICP. |
| `--no-deps` | Don't build dependencies, only this canister. |

## Options

Expand Down
1 change: 1 addition & 0 deletions docs/cli-reference/dfx-deploy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ You can use the following options with the `dfx deploy` command.
| `--next-to <canister-principal>` | Create canisters on the same subnet as this canister. |
| `--skip-pre-upgrade` | Skip the `pre_upgrade` hook on upgrade. This requires the upgrade/auto mode. |
| `--wasm-memory-persistence <mode>` | Keep or replace the Wasm main memory on upgrade. Possible values: keep, replace. This requires the upgrade/auto mode. |
| `--no-compile` | Don't compile before deploying. |

### Specifies the argument to pass to the init entrypoint

Expand Down
8 changes: 8 additions & 0 deletions docs/cli-reference/dfx-generate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ The `dfx generate` command looks for the configuration under the `declarations`
dfx generate [canister_name]
```

## Options

You can use the following options with the `dfx deploy` command.

| Argument | Description |
|----------------|-----------------------------------------------------------|
| `--no-compile` | Don't compile the canister(s) before generating bindings. |

## Arguments

You can specify the following arguments for the `dfx generate` command.
Expand Down
28 changes: 28 additions & 0 deletions docs/cli-reference/dfx-rules.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { MarkdownChipRow } from "/src/components/Chip/MarkdownChipRow";

# dfx rules

<MarkdownChipRow labels={["Reference"]} />

**Warning:** This is an experimental feature.

Use the `dfx rules` command to output GNU Make rules for efficient compilation of canisters.

The rules, that can be used:
* `canister@NAME` - compile a canister.
* `deploy@NAME` - deploy a canister.
* `generate@NAME` - generate bindings for a canister.

TODO

## Basic usage

``` bash
dfx rules [-o MAKEFILE]
```

**Warning:** The MAKEFILE is overwritten by the above command.

| Argument | Description |
|------------------------------|---------------------------------|
| `-o FILE` or `--output FILE` | Use this file instead of stdout |
8 changes: 4 additions & 4 deletions src/dfx/assets/prepare_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ fn write_binary_cache(
async fn download_and_check_sha(client: Client, source: Source) -> Bytes {
let retry_policy = ExponentialBackoffBuilder::new()
.with_initial_interval(Duration::from_secs(1))
.with_max_interval(Duration::from_secs(16))
.with_multiplier(2.0)
.with_max_elapsed_time(Some(Duration::from_secs(300)))
.with_max_interval(Duration::from_secs(64))
.with_multiplier(1.5)
.with_max_elapsed_time(Some(Duration::from_secs(3600)))
.build();

let response = retry(retry_policy, || async {
match client.get(&source.url).send().await {
match client.get(&source.url).timeout(Duration::from_secs(3600)).send().await {
Ok(response) => Ok(response),
Err(err) => Err(backoff::Error::transient(err)),
}
Expand Down
25 changes: 20 additions & 5 deletions src/dfx/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub struct CanisterBuildOpts {
#[arg(long)]
check: bool,

/// Don't compile the dependencies, only this canister.
#[arg(long)]
no_deps: bool,

/// Output environment variables to a file in dotenv format (without overwriting any user-defined variables, if the file already exists).
#[arg(long)]
output_env_file: Option<PathBuf>,
Expand All @@ -48,10 +52,21 @@ pub fn exec(env: &dyn Environment, opts: CanisterBuildOpts) -> DfxResult {

let build_mode_check = opts.check;

// Option can be None in which case --all was specified
let required_canisters = config
.get_config()
.get_canister_names_with_dependencies(opts.canister_name.as_deref())?;
let required_canisters = if opts.no_deps {
// Option can be None in which case --all was specified
let canister = opts.canister_name.as_deref();
match canister {
Some(canister) => vec![canister.to_string()],
// inefficient:
None => config
.get_config()
.get_canister_names_with_dependencies(None)?
}
} else {
config
.get_config()
.get_canister_names_with_dependencies(opts.canister_name.as_deref())?
};
let canisters_to_load = add_canisters_with_ids(&required_canisters, &env, &config);

let canisters_to_build = required_canisters
Expand Down Expand Up @@ -86,7 +101,7 @@ pub fn exec(env: &dyn Environment, opts: CanisterBuildOpts) -> DfxResult {
let build_config = BuildConfig::from_config(&config)?
.with_canisters_to_build(canisters_to_build)
.with_env_file(env_file);
runtime.block_on(canister_pool.build_or_fail(&env, logger, &build_config))?;
runtime.block_on(canister_pool.build_or_fail(&env, logger, &build_config, opts.no_deps))?;

slog::info!(logger, "Finished building canisters.");

Expand Down
5 changes: 5 additions & 0 deletions src/dfx/src/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ pub struct DeployOpts {
#[command(flatten)]
subnet_selection: SubnetSelectionOpt,

/// Skip compilation before deploying.
#[arg(long)]
no_compile: bool,

/// Always use Candid assist when the argument types are all optional.
#[arg(
long,
Expand Down Expand Up @@ -183,6 +187,7 @@ pub fn exec(env: &dyn Environment, opts: DeployOpts) -> DfxResult {
opts.no_asset_upgrade,
&mut subnet_selection,
opts.always_assist,
opts.no_compile,
))?;

if matches!(deploy_mode, NormalDeploy | ForceReinstallSingleCanister(_)) {
Expand Down
8 changes: 6 additions & 2 deletions src/dfx/src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ pub struct GenerateOpts {
/// If you do not specify a canister name, generates types for all canisters.
canister_name: Option<String>,

/// Don't compile Motoko before generating.
#[arg(long)]
no_compile: bool,

#[command(flatten)]
network: NetworkOpt,
}
Expand Down Expand Up @@ -62,7 +66,7 @@ pub fn exec(env: &dyn Environment, opts: GenerateOpts) -> DfxResult {
let generate_config =
BuildConfig::from_config(&config)?.with_canisters_to_build(canisters_to_generate);

if build_config
if !opts.no_compile && build_config
.canisters_to_build
.as_ref()
.map(|v| !v.is_empty())
Expand All @@ -71,7 +75,7 @@ pub fn exec(env: &dyn Environment, opts: GenerateOpts) -> DfxResult {
let canister_pool_build = CanisterPool::load(&env, true, &build_dependees)?;
let spinner = env.new_spinner("Building Motoko canisters before generation...".into());
let runtime = Runtime::new().expect("Unable to create a runtime");
runtime.block_on(canister_pool_build.build_or_fail(&env, log, &build_config))?;
runtime.block_on(canister_pool_build.build_or_fail(&env, log, &build_config, opts.no_compile))?;
spinner.finish_and_clear();
}

Expand Down
3 changes: 3 additions & 0 deletions src/dfx/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod new;
mod ping;
mod quickstart;
mod remote;
mod rules;
mod schema;
mod send_telemetry;
mod start;
Expand Down Expand Up @@ -57,6 +58,7 @@ pub enum DfxCommand {
Ping(ping::PingOpts),
Quickstart(quickstart::QuickstartOpts),
Remote(remote::RemoteOpts),
Rules(rules::RulesOpts),
Schema(schema::SchemaOpts),
#[command(name = "_send-telemetry", hide = true)]
SendTelemetry(send_telemetry::SendTelemetryOpts),
Expand Down Expand Up @@ -92,6 +94,7 @@ pub fn exec(env: &dyn Environment, cmd: DfxCommand) -> DfxResult {
DfxCommand::Ping(v) => ping::exec(env, v),
DfxCommand::Quickstart(v) => quickstart::exec(env, v),
DfxCommand::Remote(v) => remote::exec(env, v),
DfxCommand::Rules(v) => rules::exec(env, v),
DfxCommand::Schema(v) => schema::exec(v),
DfxCommand::SendTelemetry(v) => send_telemetry::exec(v),
DfxCommand::Start(v) => start::exec(env, v),
Expand Down
Loading