Error in Principal.mo

I have the following error:

$ dfx build
Building canisters...
Error: Failed while trying to build all canisters.
Caused by: Failed while trying to build all canisters.
  The build step failed for canister 'aovwi-4maaa-aaaaa-qaagq-cai' (test) with an embedded error: Failed to build Motoko canister 'test'.: Failed to compile Motoko.: Failed to run 'moc'.: The command '"/home/porton/.cache/dfinity/versions/0.14.0/moc" "/home/porton/Projects/NacDB/src/test/main.mo" "-o" "/home/porton/Projects/NacDB/.dfx/local/canisters/test/test.wasm" "-c" "--debug" "--idl" "--stable-types" "--public-metadata" "candid:service" "--actor-idl" "/home/porton/Projects/NacDB/.dfx/local/canisters/idl/" "--actor-alias" "test" "aovwi-4maaa-aaaaa-qaagq-cai" "--package" "base" ".vessel/base/f26c8064c70af292a4bf20bdea6225b9223ab0fe/src" "--package" "btree" ".vessel/btree/v0.3.1/src" "--package" "stable-rbtree" ".vessel/stable-rbtree/v0.6.1/src"' failed with exit status 'exit status: 1'.
Stdout:

Stderr:
.vessel/base/f26c8064c70af292a4bf20bdea6225b9223ab0fe/src/Principal.mo:101.52-101.56: type error [M0072], field isController does not exist in type
...
$ dfx --version
dfx 0.14.0
$ vessel --version
vessel 0.6.5

Isn’t isController brand new? As of moc 0.9.1?

Dfx 0.14.0 bundles with an older moc. You might need to install the latest moc binary and set the DFX_MOC_PATH environment variable when calling dfx build.

An alternative solution is to edit package-set.dhall:

  overrides =
    [
      { name = "base"
      , repo = "https://github.com/dfinity/motoko-base"
      , version = "moc-0.9.0"
      , dependencies = [] : List Text
      },
    ] : List Package

But is that enough? In package-set.dhall you specify the version of motoko-base, not of the compiler. I thought that you probably need compiler support for isController to work because it uses a new syscall ic0.is_controller. But maybe I’m wrong. Just guessing, I haven’t tried any of this myself.

Yes, @timo is correct, support for ic0.is_controller was only added in moc v0.9.1.

@qwertytrewq you would need at least version 0.9.1 of both the compiler and the base package.
The DFX_MOC_PATH env variable allows you to do this, so you do not need to wait on a DFX release.

DFX v0.14.0 only comes with Motoko compiler 0.8.7.