# DFX deploy with custom Motoko version

**URL:** <https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665>\
**Category:** Command Line Tools\
**Created:** [October 2, 2021, 4:59pm UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665 "2021-10-02T16:59:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![quint](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/quint/32/40449_2.png) [@quint](https://forum.dfinity.org/u/quint)\
**Post date:** [October 2, 2021, 4:59pm UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/1 "2021-10-02T16:59:36Z")

</div>

Is there an easy way to let `dfx` use `$(vessel bin)/moc` instead of `$(dfx cache show)/moc` to build motoko canisters?

---

<div class="post-metadata">

**Author:** ![nomeata](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nomeata/32/733_2.png) [@nomeata](https://forum.dfinity.org/u/nomeata)\
**Post date:** [October 3, 2021, 5:35pm UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/2 "2021-10-03T17:35:10Z")

</div>

I wanted that too recently. Probably `"type":"custom"` and `"build":"some script"` will work, but that doesn’t really qualify as an “easy” way.

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [December 26, 2021, 6:08am UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/3 "2021-12-26T06:08:21Z")

</div>

Is there a reason why vessel uses a different moc version than dfx? It’s kinda confusing.

What if I use one version of Motoko to build my canister (i.e. dfx’s version), but use another version of Motoko to build my dependencies (i.e. vessel’s version)? Or does vessel not actually build/compile dependencies?

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [December 30, 2021, 6:40am UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/4 "2021-12-30T06:40:32Z")

</div>

Actually, now that I look into the vessel [source code](https://github.com/dfinity/vessel/blob/b19be8b5b46544a7685717e5f91a0d548f91bed7/src/lib.rs#L121), I don’t quite see the purpose of specifying a `compiler` in your project’s vessel.dhall to begin with.

That compiler version in vessel.dhall isn’t used by any vessel command _except_ `vessel bin`. It’s not used by `vessel verify` (you still need to pass in a `--moc` or `--version` flag manually) or, as OP noted, by `dfx build`.

So it’s not really useful at all but just an easier way to install a `moc` binary onto your local filesystem.

---

<div class="post-metadata">

**Author:** ![quint](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/quint/32/40449_2.png) [@quint](https://forum.dfinity.org/u/quint)\
**Post date:** [March 4, 2022, 7:46pm UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/5 "2022-03-04T19:46:04Z")

</div>

```auto
DFX_MOC_PATH="$(vessel bin)/moc" dfx deploy

```

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [March 8, 2022, 8:50am UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/6 "2022-03-08T08:50:27Z")

</div>

is this documented somewhere or did you go through the source code?

---

<div class="post-metadata">

**Author:** ![quint](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/quint/32/40449_2.png) [@quint](https://forum.dfinity.org/u/quint)\
**Post date:** [March 8, 2022, 9:24am UTC](https://forum.dfinity.org/t/dfx-deploy-with-custom-motoko-version/7665/7 "2022-03-08T09:24:16Z")

</div>

> is this documented somewhere or did you go through the source code?

I found this by going through the [source code](https://github.com/dfinity/sdk/blob/fd71bfb88c3c539c758f827421a01870f3960715/src/dfx/src/config/cache.rs#L192-L202).
