sdk icon indicating copy to clipboard operation
sdk copied to clipboard

`revision` file is missing in the deb release breaking AOT cross-compiling

Open ntkme opened this issue 6 months ago • 2 comments

When building SDK from git source, the script write_revision_file.py is used to create a revision file at the root of SDK.

However, if git repo is not available, the revision file is not created.


When building SDK as a debian package, the git repo is excluded. As a workaround, the git revision is stored in a GIT_REVISION file in the source tree:

https://github.com/dart-lang/sdk/blob/da5ae4786cc41812eee6f83ed1e9c5c05c15f387/tools/linux_dist_support/create_tarball.py#L131-L133 https://github.com/dart-lang/sdk/blob/da5ae4786cc41812eee6f83ed1e9c5c05c15f387/tools/utils.py#L420-L423


The write_revision_file.py isn't aware of this GIT_REVISION file, therefore the current debian package is missing the revision file from the sdk, and thus breaking cross compile:

Invalid argument(s): Channel "stable" requires valid revision.
#0      SdkCache.resolveVersion (package:dartdev/src/sdk_cache.dart:88:9)
#1      CompileNativeCommand.run (package:dartdev/src/commands/compile.dart:601:43)
#2      CommandRunner.runCommand (package:args/command_runner.dart:212:27)
#3      DartdevRunner.runCommand (package:dartdev/dartdev.dart:247:30)
#4      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:122:25)
#5      new Future.sync (dart:async/future.dart:315:27)
#6      CommandRunner.run (package:args/command_runner.dart:122:14)
#7      runDartdev (package:dartdev/dartdev.dart:47:29)
#8      main (file:///__w/dart/dart/dart-sdk/sdk/pkg/dartdev/bin/dartdev.dart:13:11)
#9      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:310:33)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:12)

ntkme avatar Jun 03 '25 10:06 ntkme

root@2dece5fdff4a:/tmp# dpkg -i dart_3.8.1-1_amd64.deb 
Selecting previously unselected package dart.
(Reading database ... 6089 files and directories currently installed.)
Preparing to unpack .../dart_3.8.1-1_amd64.deb ...
Unpacking dart (3.8.1-1) ...
Setting up dart (3.8.1-1) ...

root@2dece5fdff4a:/tmp# ls -al /usr/lib/dart
total 24
drwxr-xr-x.  6 root root  151 Jun  3 00:40 .
drwxr-xr-x.  1 root root   18 Jun  3 00:40 ..
-rw-r--r--.  1 root root 1502 May 28 08:02 LICENSE
-rw-r--r--.  1 root root 1271 May 28 08:02 README
drwxr-xr-x.  5 root root  103 Jun  3 00:40 bin
-rw-r--r--.  1 root root 1482 May 28 08:02 dartdoc_options.yaml
drwxr-xr-x.  3 root root  153 Jun  3 00:40 include
drwxr-xr-x. 30 root root 4096 Jun  3 00:40 lib
drwxr-xr-x.  3 root root   21 Jun  3 00:40 pkg
-rw-r--r--.  1 root root  197 May 28 08:02 sdk_packages.yaml
-rw-r--r--.  1 root root    6 May 28 08:02 version

ntkme avatar Jun 03 '25 11:06 ntkme

This is fixed in the new way of building the Debian packages (efda4aff7cb5cdca3237a52e5fb6c805f4403c5a). We're in the process of switching over the releases to use this.

rmacnak-google avatar Jun 04 '25 20:06 rmacnak-google