mlir piggybacks onto LLVM_BUILD_LLVM_DYLIB for determining if a
shared libMLIR.so is emitted. This also fixes build failures
in MLIR 20+ where tablegen'd files aren't generated.
In file included from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/UseDefLists.h:16,
from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/Value.h:17,
from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/BlockSupport.h:16,
from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/OperationSupport.h:18,
from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/Dialect.h:17,
from /build/mlir-src-21.0.0-unstable-2025-03-09/mlir/tools/mlir-lsp-server/mlir-lsp-server.cpp:9:
/build/mlir-src-21.0.0-unstable-2025-03-09/mlir/include/mlir/IR/Location.h:145:10: fatal error: mlir/IR/BuiltinLocationAttributes.h.inc: No such file or directory
145 | #include "mlir/IR/BuiltinLocationAttributes.h.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Hash mismatch on darwin, for some reason.
error: hash mismatch in fixed-output derivation
'/nix/store/97ladc5962id20y3d2m4a5j4k96yv83s-source.drv':
specified: sha256-eDJRTLYKHcL7yAgFL8vZQh9zp5fBxcZRsWChp8y3Am0=
got: sha256-UBGVc98lrtTCp/kYDEFM/8iG9n7Tekx+xbE7Wdyp2uQ=
error: 1 dependencies of derivation
'/nix/store/sbmwhp3b7h5r5arw2y9b01mzaywsr365-ocamllex-grammar-0.0.0+rev=c5cf996.drv'
failed to build
error: 1 dependencies of derivation
'/nix/store/zb1pm9gm8bvs04g2lfzq3ss4zsk0y5x1-vimplugin-treesitter-grammar-ocamllex.drv'
failed to build
This produced an unnecessarily infinitely deep config tree.
The "cut off" option can be written to, but not read from.
Being written to is important, because it allows users to
conveniently define vmVariant config without having to check
isVmVariant.
There's a small chance that someone *reads* from vmVariant config
in their normal config, and for them it will not be possible
to evaluate with `nixos-rebuild build-vm` anymore.
If this is a problem, we could perhaps make the vmVariant root
appear instead of the `throw` error.
This could also be done using mkOption apply.