Skip to content

Commit

Permalink
Run "pub get" for the frontend_server package before building. (flutt…
Browse files Browse the repository at this point in the history
…er#4562)

In flutter#4554 I removed the .packages
file in the frontend_server directory, because it was out of sync with
the pubspec.yaml. It seems like the right solution is to run `pub get`
when we get the dependencies, i.e. when we run `gclient sync`.

Being out of sync is a problem because it means that running "pub get"
in that directory changes what packages are being used, and changes
the `.packages` file, which leads to having to revert changes before
committing code, etc. Having to regularly update this file doesn't
make much sense either, since the files that were missing were files
that are obtained from the network (e.g. the `io` package as used by
the `test` package).

Previously, (see
flutter#3982 (comment)),
we did not do this because we did not want the build to call into the
network. This still does not call into the network during the _build_
phase, only during `gclient sync` (which is when all the dependencies
are brought down).

Currently the network dependencies only matter for running tests. We
should make sure this remains the case. Ideally we wouldn't even
depend on those.
  • Loading branch information
Hixie authored Jan 17, 2018
1 parent d5cd548 commit 2dfeaa6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,33 @@ hooks = [
'pattern': '.',
'action': ['python', 'src/tools/dart/update.py'],
},
{
'name': 'frontend_server_packages',
'pattern': '.',
'condition': 'host_os == "linux"',
'cwd': 'src/flutter/frontend_server/',
'action': [
'../../../src/third_party/dart/tools/sdks/linux/dart-sdk/bin/pub', 'get',
],
},
{
'name': 'frontend_server_packages',
'pattern': '.',
'condition': 'host_os == "mac"',
'cwd': 'src/flutter/frontend_server/',
'action': [
'../../../src/third_party/dart/tools/sdks/mac/dart-sdk/bin/pub', 'get',
],
},
{
'name': 'frontend_server_packages',
'pattern': '.',
'condition': 'host_os == "windows"',
'cwd': 'src/flutter/frontend_server/',
'action': [
'../../../src/third_party/dart/tools/sdks/win/dart-sdk/bin/pub.bat', 'get',
],
},
{
# Ensure that we don't accidentally reference any .pyc files whose
# corresponding .py files have already been deleted.
Expand Down

0 comments on commit 2dfeaa6

Please sign in to comment.