Bootstrapping Dart from source

26 views
Skip to first unread message

Bart Ribbers

unread,
Aug 25, 2022, 2:38:59 AM8/25/22
to mi...@dartlang.org
Hi,

I'm trying to bootstrap Dart from source but am having some issues with it. As
for why I'm doing it, besides establishing a chain of trust that bootstrapping
allows, I'm running a Linux system using the Musl C library rather than glibc
and the Google-produced binaries don't run on it. Compatibility layers like
gcompat don't work either, so I'm basically stuck with no Dart.

At first bootstrapping went with quite a breeze actually, I found Dart
2.0.0.dev-8.0 was able to be compiled without needing an existing Dart, and
with that I could compile 2.0.0.dev-20.0, with which I could compile 2.0.0-
dev-36.0 -> 2.0.0.dev-54.0 -> 2.0.0.dev-65 (but a slightly broken variant,
just good enough to compile itself properly in the next iteration). I got
stuck there at that point, but this last one _should_ be enough to get
2.1.0.dev.5.0 and then the rest of the chain working.

However since my initial efforts my distribution (Alpine Linux) has dropped
Python 2 from it's repositories. Since all the mentioned versions still used
Python 2 for it's build system, I had to port them to Python 3. Although I
think I did everything correctly, I just can't get the 2.0.0.dev-8.0 build to
succeed anymore.

To be exact, it fails at the very end of the build while calling gen_snapshot:

'dart:core/annotations.dart': error: line 7 pos 1: unexpected token ''
/**
^
'dart:core': error: line 170 pos 1: library handler failed
part "annotations.dart";
^

So for some reason it can not parse that comment block, and I have no clue why
it would be different on Python 3 vs Python 2. I'm guessing code comments
should've been stripped out at this point or converted to something it can
handle (I found a line_doc_comments.dart which converts /** based comments to
/// ones but it never seems to be called anywhere) but for some reason with
Python 3 only it didn't.
I've been stuck here for quite a while and would appreciate any pointers.

The buildscript and patches I use can be found at https://
gitlab.alpinelinux.org/PureTryOut/aports/-/tree/testing_dart_python3/testing/
dart2.0.0.dev.8.0.

I've been using https://github.com/dart-lang/sdk/commit/
b5c63ce7577c8c7634651dfac28d3e093bba91f7 as a reference on what to port but I
guess I'm missing something somewhere still.

Could anybody possibly help me out here? I realize I'm trying to do something
weird ;)

Thanks in advance,
Bart
signature.asc
Reply all
Reply to author
Forward
0 new messages