Opam install fails with --dev-pkg: Unknown key

I’ve seen relatively little on Google about this error - mostly things from a while ago before some unnamed package supported the --dev-pkg flag. Anyone know how to resolve it?

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
[ERROR] The compilation of fmt failed at "/Users/xitrium/.opam/opam-init/hooks/sandbox.sh build
        ocaml pkg/pkg.ml build --dev-pkg false --with-base-unix true --with-cmdliner true".

#=== ERROR while compiling fmt.0.8.6 ==========================================#
# context     2.0.1 | macos/x86_64 | ocaml-base-compiler.4.07.1 | https://opam.ocaml.org/#33220f75
# path        ~/.opam/4.07.1/.opam-switch/build/fmt.0.8.6
# command     ~/.opam/opam-init/hooks/sandbox.sh build ocaml pkg/pkg.ml build --dev-pkg false --with-base-unix true --with-cmdliner true
# exit-code   1
# env-file    ~/.opam/log/fmt-28608-ffb3fd.env
# output-file ~/.opam/log/fmt-28608-ffb3fd.out
### output ###
# pkg.ml: [ERROR] key --dev-pkg: Unknown key.

opam version 2.0.1

This looks like a missing constraint on topkg could you please make sure you have at least topkg.0.9.0 installed.

As a side note - you might want to opdate your opam version as well, to 2.0.4, there is quite a lot of various bug fixes, see the changelog.

Ah, the issue was that I had a pin of topkg v1.0.0 from github (probably needed this a while ago):

topkg                   1.0.0        pinned to version 1.0.0 at git+https://github.com/whitequark/top

And apparently that 1.0.0 is different from opam’s 1.0.0, so when I did opam pin remove topkg and recompiled, I was then able to install fmt. Thanks for the help!