craftinginterpreters
craftinginterpreters copied to clipboard
Can't build with current Dart (3.0.0)
Following the install instructions gives an immediate error after installing Dart (according to Dart site install instructions) and running "make get" (Ubuntu 22.04).
jungd@Daphnis:~/dev/craftinginterpreters$ make get
Resolving dependencies...
The lower bound of "sdk: '>2.11.0 <3.0.0'" must be 2.12.0'
or higher to enable null safety.
The current Dart SDK (3.0.0) only supports null safety.
For details, see https://dart.dev/null-safety
make: *** [Makefile:10: get] Error 65
Without knowing anything about Dart, I tried editing tool/pubspec.yaml to change the 2.11.0 to 2.12.0, but just caused different error:
Because tool depends on mustache_template <2.0.0 which doesn't support null safety, version solving
failed.
I am on macOS i have installed an older version of DART i have used those commands:
brew install [email protected]
brew unlink dart && brew link [email protected]
On Ubuntu I uninstalled the default 3+ version of dart
sudo apt-get remove dart
Then installed the newest 2.x version
sudo apt-get install dart=2.19.6-1
This fixed the issue for me.
On Arch Manjaro, Dart version (3.0.7) Since I just wanted to build and try the interpreters, I built without the dependencies. my public.yaml:
name: tool
publish_to: none
environment:
sdk: '>3.0.0'
dependencies:
charcode: ^1.1.3
path: ^1.7.0
pool: ^1.4.0
sass: ^1.26.5
string_scanner: ^1.0.5
The below commands worked successfully:
make get make jlox make clox
Note: This still fails make
Ah, yes. When I get some time, I'll try to update it to the latest.
same issue here on windows, I know zero about dart and dont have the bandwidth to learn
Make sure to clean any build stuff from 3.0 after switching.
on macOS
brew tap dart-lang/dart
brew install dart-lang/dart/[email protected]
export PATH=$(brew --prefix dart-lang/dart/[email protected])/bin:$PATH
dart --version
Dart SDK version: 2.19.6 (stable) (Tue Mar 28 13:41:04 2023 +0000) on "macos_arm64"
make clean
make get
make # no errors