Unable to build gaia from git in windows. Getting “Makefile:671: recipe for target 'preferences' failed”

蓝咒 提交于 2019-12-13 02:37:32

问题


I am trying to build and deploy a gaia build from git repo in Windows. I am trying to deploy it in অ Flame. I am trying to do it in a windows 7 with cygwin installed. After installing everything this is the error I am getting

This works just fine in a Linux machine, but I need to do this in Windows since right now I have access to it only.

Any pointers to what I am doing wrong here?


回答1:


I'm afraid it's not going to work without significant effort for several reasons. Much better to use a VM with Linux on as even if it did work it will be really slow. Windows is slow at handling lots of file access and Cygwin slows it down even more.

For example in making a simple change to config.sh (full stack build) so it works on Cygwin I found it took hours to run (on a decent PC). And then I had a couple of corrupt git repos I had to hand fix.

I also looked at getting gaia's make to work, but stopped after the problem just got bigger.

Here's what I found for future reference

  • The build is not really portable, it expects a linux like environment
  • While cygwin gives good linux emulation most of the tools run are win32 native and handling path conversion for them requires not trivial changes due to assumptions. For example you can switch to the Win32 XPCshell and hack the command line paths to use cygpath, but environment variable are an extra source of dependency in the JS scripts and are all unix paths. ( I did manage this part).
  • these path and environment dependencies get magnified with the C build chain and other tools.
  • You need to change the mount to use noacl or else cygwin attaches ACLs to simulate file properties, thus breaking things. It's might even be a little faster without ACLS
  • I also tried MinGW which provides native versions without the emulation so should be faster. However it falls short of the requirements and its automatic path conversion heuristics get in the way.
  • you need to turn of any antivirus prog as they slow it down. in fact the very first time I used the old FIrefox WIndows build it would crash after a long time. Turned out to be a mem leak in the AV :(

So all-in-all it's too much hassle in terms of dev time to convert and probably maintain. A true Windows build would be better but then it's so easy these days to run a VM. You can even share directories between the guest and host so could flash from Windows.




回答2:


I also tried with cygwin, but was unable to build the gaia source code on windows.

It's not straightforward to build the gaia source code on windows. Please follow these steps:-

  1. Download Mozilla Build from MozillaBuild - Mozilla Wiki and install the tools in c:/mozilla-build (preferred). It includes everything (make, wget, python etc) you need to build gaia source code.
  2. Run start-shell.bat. If build process failed with this batch file then run start-shell-msvc2013.bat if you have Visual Studio 2013 or start-shell-msvc2015.bat if you have Visual Studio 2015. (You need Visual Studio for the second step).
  3. Browse to the gaia source code directory using the command cd Mozilla/gaia.
  4. Run DEVICE_DEBUG=1 make command. Don't run DEVICE=1 make or make command (because you won't be able to debug the apps, I was able to connect to the Firefox OS 2.2 but was not able to debug the apps when I ran these commands).
  5. If you are running this command for the first time, it will download the b2g_sdk otherwise it will create a folder profile with your custom profile.
  6. Open the WEBIDE using Firefox (Nightly preferred) and point to the profile folder you just created.

Links for your reference:-

  • https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Developing_Gaia
  • https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Different_ways_to_run_Gaia
  • https://developer.mozilla.org/en-US/docs/Tools/WebIDE/Troubleshooting
  • https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Making_Gaia_code_changes
  • https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites


来源:https://stackoverflow.com/questions/26326405/unable-to-build-gaia-from-git-in-windows-getting-makefile671-recipe-for-targ

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!