Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create GN build for Dart SDK #27406

Closed
6 tasks done
whesse opened this issue Sep 21, 2016 · 9 comments
Closed
6 tasks done

Create GN build for Dart SDK #27406

whesse opened this issue Sep 21, 2016 · 9 comments
Assignees
Labels
area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes. P2 A bug or feature request we're likely to work on type-task A well-defined stand-alone task
Milestone

Comments

@whesse
Copy link
Contributor

whesse commented Sep 21, 2016

"Some people want to extend the GN build to the full Dart SDK.". It is currently working to build the runtime in the flutter context.

Here is a checklist of things that we would need to add:

  • Add Wiki page "Building with GN"
  • Add gn binary download to repo checkout?
  • Create working standalone GN build for runtime
  • Analyzer + summaries
  • Snapshots of tools
  • Copy files to SDK directory
@whesse whesse added type-task A well-defined stand-alone task area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes. P2 A bug or feature request we're likely to work on labels Sep 21, 2016
@whesse
Copy link
Contributor Author

whesse commented Sep 21, 2016

I'll do "Add gn binary download to repo checkout".

@zanderso
Copy link
Member

Started working on this here: https://codereview.chromium.org/2350583002/

@zanderso
Copy link
Member

zanderso commented Oct 5, 2016

The GN build can now produce the SDK on all platforms, including cross-builds, Android, and ASAN on Linux. It's wired up to both gclient runhooks and build.py. It is used as the default if the environment variable DART_USE_GN is defined, and can otherwise be selected with the flag --gn. It also produces project files for VS and XCode on Windows and Mac, respectively.

@whesse Can we get this set up on a builder or two?

@mit-mit mit-mit added this to the 1.21 milestone Oct 6, 2016
@whesse
Copy link
Contributor Author

whesse commented Oct 6, 2016

Wonderful! I'll set up builder/testers for this. We will need documentation about how to update this and GYP (and blaze) in simple cases like adding a source file to the build of a target. But that is mostly in VM, and you guys know already how to do it.

whesse added a commit that referenced this issue Oct 12, 2016
@mfrancis107
Copy link

________ running 'D:\VRProject\depot_tools\python276_bin\python.exe sdk/tools/generate_buildfiles.py --gn' in 'D:\VRProject\dart\dartbuild'
Command failed: D:\VRProject\dart\dartbuild\sdk/buildtools/win/gn gen --check --ide=vs out\DebugIA32 --args=is_release=false is_clang=false dart_zlib_path="//runtime/bin/zlib" use_goma=false dart_use_fallback_root_certificates=true target_cpu="x86" goma_dir="None" dart_use_tcmalloc=false dart_target_arch="ia32" is_asan=false is_product=false is_debug=true dart_runtime_mode="develop" dart_host_pub_exe="D:\VRProject\dart\dartbuild\sdk\tools\sdks\win\dart-sdk\bin\pub.bat" dart_debug=true host_cpu="x86" target_os="win"
output: Traceback (most recent call last):
  File "D:/VRProject/dart/dartbuild/sdk/build/toolchain/win/setup_toolchain.py", line 154, in <module>
    main()
  File "D:/VRProject/dart/dartbuild/sdk/build/toolchain/win/setup_toolchain.py", line 121, in main
    args = _SetupScript(cpu, win_sdk_path)
  File "D:/VRProject/dart/dartbuild/sdk/build/toolchain/win/setup_toolchain.py", line 68, in _SetupScript
    return [os.path.normpath(os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'],
  File "D:\VRProject\depot_tools\python276_bin\lib\os.py", line 423, in __getitem__
    return self.data[key.upper()]
KeyError: 'GYP_MSVS_OVERRIDE_PATH'
ERROR at //build/toolchain/win/BUILD.gn:28:18: Script returned non-zero exit code.
toolchain_data = exec_script("setup_toolchain.py",
                 ^----------
Current dir: D:/VRProject/dart/dartbuild/sdk/out/DebugIA32/
Command: D:/VRProject/depot_tools/python276_bin/python.exe -- D:/VRProject/dart/dartbuild/sdk/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)\Microsoft Visual Studio 14.0" ../../third_party/gyp/pylib/gyp/win_tool.py "C:\Program Files (x86)\Windows Kits\10" "C:\Windows\Sysnative;C:\Windows\SysWOW64" x86
Returned 1.
See //BUILD.gn:6:1: which caused the file to be included.
group("default") {
^-----------------
Error: Command 'D:\\VRProject\\depot_tools\\python276_bin\\python.exe sdk/tools/generate_buildfiles.py --gn' returned non-zero exit status 1 in D:\VRProject\dart\dartbuild

I get the above error when attempting to use the GN build on windows.

@zanderso
Copy link
Member

@mfrancis107 Thanks for the report. Did you follow the instructions here and set DEPOT_TOOLS_WIN_TOOLCHAIN=0. It looks like open source contributors may also need to define the environment variable GYP_MSVS_OVERRIDE_PATH to be the path to Visual Studio, e.g. C:\Program Files (x86)\Microsoft Visual Studio 14.0. I'm unable to test that at the moment, but if you're able to give it a shot, that would be helpful.

@mfrancis107
Copy link

@zanderso Manually setting the environment variable worked.

However, I think this can be resolved in the build steps. It looks like in toolchain\win\BUILD.gn a call to exec_script("setup_toolchain.py .... which uses the environment variable GYP_MSVS_OVERRIDE_PATH is called before exec_script("vs_toolchain.py".... which sets the environment variable if it is not already set.

@devoncarew devoncarew removed their assignment Nov 14, 2016
@mit-mit
Copy link
Member

mit-mit commented Nov 24, 2016

@whesse @zanderso let's get this completed -- did you look at the env var issue mentioned above?

@zanderso
Copy link
Member

I've created a new issue for the environment variable situation, which is not a blocker for the GN build. There may also still be a few other small issues remaining with the GN build, but we should file issues for those separately as well as they come up, so I'll go ahead and close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes. P2 A bug or feature request we're likely to work on type-task A well-defined stand-alone task
Projects
None yet
Development

No branches or pull requests

6 participants