dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.23k stars 1.57k forks source link

The build.py script doesn't seem to be correctly updating versions #32614

Open leafpetersen opened 6 years ago

leafpetersen commented 6 years ago

On my mac if I:

I don't see the version number changing to the latest commit. See bolded bits in the transcript below:

leafp-macbookpro:sdk leafp$ git log | head -1 commit 0e764393f3c84f32e909a6dde347c82677fe2067 leafp-macbookpro:sdk leafp$ ./tools/build.py -m release create_sdk using /var/folders/00/1tc1r000h01000cxqpysvccm0079h7/T/goma_leafp as tmpdir Using goma VERSION=151 (latest) GOMA version 9f6de7dc0b75ab401cc9a12298e7d19c0c0d8b2f@1520492350

goma is already running.

ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk ninja: Entering directory `xcodebuild/ReleaseX64' ninja: no work to do. ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk done. The build took 2.991 seconds leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart --version Dart VM version: 2.0.0-edge.86b16464752da5e2d38c208d7ad7926c68b4b1e6 (Tue Mar 20 17:06:25 2018 +0000) on "macos_x64" leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --version dartanalyzer version 2.0.0-edge.86b16464752da5e2d38c208d7ad7926c68b4b1e6 leafp-macbookpro:sdk leafp$ rm -rf xcodebuild/ReleaseX64/dart-sdk/bin/dart leafp-macbookpro:sdk leafp$ ./tools/build.py -m release create_sdk using /var/folders/00/1tc1r000h01000cxqpysvccm0079h7/T/goma_leafp as tmpdir Using goma VERSION=151 (latest) GOMA version 9f6de7dc0b75ab401cc9a12298e7d19c0c0d8b2f@1520492350

goma is already running.

ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk ninja: Entering directory `xcodebuild/ReleaseX64' [5/5] STAMP obj/create_sdk.stamp ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk done. The build took 2.746 seconds leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart --version Dart VM version: 2.0.0-edge.86b16464752da5e2d38c208d7ad7926c68b4b1e6 (Tue Mar 20 17:06:25 2018 +0000) on "macos_x64" leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --version dartanalyzer version 2.0.0-edge.86b16464752da5e2d38c208d7ad7926c68b4b1e6 leafp-macbookpro:sdk leafp$ rm -rf xcodebuild/ReleaseX64/dart-sdk/ leafp-macbookpro:sdk leafp$ ./tools/build.py -m release create_sdk using /var/folders/00/1tc1r000h01000cxqpysvccm0079h7/T/goma_leafp as tmpdir Using goma VERSION=151 (latest) GOMA version 9f6de7dc0b75ab401cc9a12298e7d19c0c0d8b2f@1520492350

goma is already running.

ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk ninja: Entering directory `xcodebuild/ReleaseX64' [1/1] Regenerating ninja files [185/185] STAMP obj/create_sdk.stamp ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk done. The build took 5.348 seconds leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart --version Dart VM version: 2.0.0-edge.86b16464752da5e2d38c208d7ad7926c68b4b1e6 (Tue Mar 20 17:06:25 2018 +0000) on "macos_x64" leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --version dartanalyzer version 2.0.0-edge.0e764393f3c84f32e909a6dde347c82677fe2067 leafp-macbookpro:sdk leafp$ leafp-macbookpro:sdk leafp$ gclient sync Syncing projects: 100% (83/83), done.
Running hooks: 26% ( 4/15) drt_resources
____ running 'download_from_google_storage --no_auth --no_resume --bucket dart-dependencies --platform=win32 --directory sdk/third_party/drt_resources' in '/Users/leafp/src/dart-repo' The current platform doesn't match "win32", skipping. Running hooks: 40% ( 6/15) 7zip
____ running 'download_from_google_storage --no_auth --no_resume --bucket dart-dependencies --platform=win32 --extract -s sdk/third_party/7zip.tar.gz.sha1' in '/Users/leafp/src/dart-repo' The current platform doesn't match "win32", skipping. Hook '/usr/bin/python sdk/tools/generate_buildfiles.py' took 13.06 secs Running hooks: 100% (15/15), done. leafp-macbookpro:sdk leafp$ ./tools/build.py -m release create_sdk using /var/folders/00/1tc1r000h01000cxqpysvccm0079h7/T/goma_leafp as tmpdir Using goma VERSION=151 (latest) GOMA version 9f6de7dc0b75ab401cc9a12298e7d19c0c0d8b2f@1520492350

goma is already running.

ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk ninja: Entering directory `xcodebuild/ReleaseX64' [1/1] Regenerating ninja files ninja: no work to do. ninja -C xcodebuild/ReleaseX64 -j1000 create_sdk done. The build took 4.022 seconds leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart --version Dart VM version: 2.0.0-edge.86b16464752da5e2d38c208d7ad7926c68b4b1e6 (Tue Mar 20 17:06:25 2018 +0000) on "macos_x64" leafp-macbookpro:sdk leafp$ ~/src/dart-repo/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --version dartanalyzer version 2.0.0-edge.0e764393f3c84f32e909a6dde347c82677fe2067

mit-mit commented 6 years ago

cc @whesse

whesse commented 6 years ago

@sortie @zanderso

zanderso commented 6 years ago

I understand why this is not the best result, but I'm not sure that fixing this issue is the right choice for engineering productivity. Any solution would require recompiling parts of the VM, and relinking {dart, gen_snapshot, dart_precompiled_runtime, ...}, which would then require rebuilding every app-jit snapshot for the SDK, which is pretty expensive:

$ touch tools/VERSION
$ ./tools/build.py -m release -a x64 create_sdk
...
The build took 77.381 seconds

That cost would be incurred even if a git pull --rebase only updates .status files or Dart files under tests/, for example.

sortie commented 6 years ago

The dart VM executable could look for its matching version in a standalone file rather than putting it in the executable / snapshots. Then an incremental build would just update that file in the appropriate out dart-sdk directory.