diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 77c1889ac..0f0d2d5a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -199,7 +199,10 @@ If you want to read about using Atom or developing packages in Atom, the [Atom F #### Local development -All packages can be developed locally. For instructions on how to do this, see [Contributing to Official Atom Packages][contributing-to-official-atom-packages] in the [Atom Flight Manual](http://flight-manual.atom.io). +Atom Core and all packages can be developed locally. For instructions on how to do this, see the following sections in the [Atom Flight Manual](http://flight-manual.atom.io): + +* [Hacking on Atom Core][hacking-on-atom-core] +* [Contributing to Official Atom Packages][contributing-to-official-atom-packages] ### Pull Requests @@ -492,3 +495,4 @@ Please open an issue on `atom/atom` if you have suggestions for new labels, and [beginner]:https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Abeginner+label%3Ahelp-wanted+user%3Aatom+sort%3Acomments-desc [help-wanted]:https://github.com/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted+user%3Aatom+sort%3Acomments-desc+-label%3Abeginner [contributing-to-official-atom-packages]:http://flight-manual.atom.io/hacking-atom/sections/contributing-to-official-atom-packages/ +[hacking-on-atom-core]: http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/ diff --git a/README.md b/README.md index ab6cd06a6..c29203ea0 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,10 @@ repeat these steps to upgrade to future releases. ## Building -* [Linux](./docs/build-instructions/linux.md) -* [macOS](./docs/build-instructions/macOS.md) * [FreeBSD](./docs/build-instructions/freebsd.md) -* [Windows](./docs/build-instructions/windows.md) +* [Linux](http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-linux) +* [macOS](http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-mac) +* [Windows](http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-windows) ## License diff --git a/docs/build-instructions/linux.md b/docs/build-instructions/linux.md index dee67d726..3499f6ac9 100644 --- a/docs/build-instructions/linux.md +++ b/docs/build-instructions/linux.md @@ -1,130 +1 @@ -# Linux - -Ubuntu LTS 12.04 64-bit is the recommended platform. - -## Requirements - -* OS with 64-bit or 32-bit architecture -* C++11 toolchain -* Git -* Node.js 6.x or later (we recommend installing it via [nvm](https://github.com/creationix/nvm)) -* npm 3.10.x or later (run `npm install -g npm`) -* Ensure node-gyp uses python2 (run `npm config set python /usr/bin/python2 -g`, use `sudo` if you didn't install node via nvm) -* Development headers for [libsecret](https://wiki.gnome.org/Projects/Libsecret). - -For more details, scroll down to find how to setup a specific Linux distro. - -## Instructions - -```sh -git clone https://github.com/atom/atom.git -cd atom -script/build -``` - -To also install the newly built application, use `--create-debian-package` or `--create-rpm-package` and then install the generated package via the system package manager. - -### `script/build` Options - -* `--compress-artifacts`: zips the generated application as `out/atom-{arch}.tar.gz`. -* `--create-debian-package`: creates a .deb package as `out/atom-{arch}.deb` -* `--create-rpm-package`: creates a .rpm package as `out/atom-{arch}.rpm` -* `--install[=dir]`: installs the application in `${dir}`; `${dir}` defaults to `/usr/local`. - -### Ubuntu / Debian - -* Install GNOME headers and other basic prerequisites: - - ```sh - sudo apt-get install build-essential git libsecret-1-dev fakeroot rpm libx11-dev libxkbfile-dev - ``` - -* If `script/build` exits with an error, you may need to install a newer C++ compiler with C++11: - - ```sh - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install gcc-5 g++-5 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 80 --slave /usr/bin/g++ g++ /usr/bin/g++-5 - sudo update-alternatives --config gcc # choose gcc-5 from the list - ``` - -### Fedora 22+ - -* `sudo dnf --assumeyes install make gcc gcc-c++ glibc-devel git-core libsecret-devel rpmdevtools libX11-devel libxkbfile-devel` - -### Fedora 21 / CentOS / RHEL - -* `sudo yum install -y make gcc gcc-c++ glibc-devel git-core libsecret-devel rpmdevtools` - -### Arch - -* `sudo pacman -S --needed gconf base-devel git nodejs npm libsecret python2 libx11 libxkbfile` -* `export PYTHON=/usr/bin/python2` before building Atom. - -### Slackware - -* `sbopkg -k -i node -i atom` - -### openSUSE - -* `sudo zypper install nodejs nodejs-devel make gcc gcc-c++ glibc-devel git-core libsecret-devel rpmdevtools libX11-devel libxkbfile-devel` - - -## Troubleshooting - -### TypeError: Unable to watch path - -If you get following error with a big traceback right after Atom starts: - - ``` - TypeError: Unable to watch path - ``` - -you have to increase number of watched files by inotify. For testing if -this is the reason for this error you can issue - - ```sh - sudo sysctl fs.inotify.max_user_watches=32768 - ``` - -and restart Atom. If Atom now works fine, you can make this setting permanent: - - ```sh - echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_user_watches - ``` - -See also [#2082](https://github.com/atom/atom/issues/2082). - -### /usr/bin/env: node: No such file or directory - -If you get this notice when attempting to run any script, you either do not have -Node.js installed, or node isn't identified as Node.js on your machine. If it's -the latter, this might be caused by installing Node.js via the distro package -manager and not nvm, so entering `sudo ln -s /usr/bin/nodejs /usr/bin/node` into -your terminal may fix the issue. On some variants (mostly Debian based distros) -you can use `update-alternatives` too: - -```sh -sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 1 --slave /usr/bin/js js /usr/bin/nodejs -``` - -### AttributeError: 'module' object has no attribute 'script_main' - -If you get following error with a big traceback while building Atom: - - ``` - sys.exit(gyp.script_main()) AttributeError: 'module' object has no attribute 'script_main' gyp ERR! - ``` - -you need to uninstall the system version of gyp. - -On Fedora you would do the following: - -```sh -sudo yum remove gyp -``` - -### Linux build error reports in atom/atom -* Use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Alinux&type=Issues) - to get a list of reports about build errors on Linux. +See the [Hacking on Atom Core](http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-linux) section in the [Atom Flight Manual](http://flight-manual.atom.io). diff --git a/docs/build-instructions/macOS.md b/docs/build-instructions/macOS.md index ae3ed9c84..3085d11f3 100644 --- a/docs/build-instructions/macOS.md +++ b/docs/build-instructions/macOS.md @@ -1,29 +1 @@ -# macOS - -## Requirements - - * macOS 10.8 or later - * Node.js 6.x or later (we recommend installing it via [nvm](https://github.com/creationix/nvm)) - * npm 3.10.x or later (run `npm install -g npm`) - * Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install) - -## Instructions - -```sh -git clone https://github.com/atom/atom.git -cd atom -script/build -``` - -To also install the newly built application, use `script/build --install`. - -### `script/build` Options - -* `--code-sign`: signs the application with the GitHub certificate specified in `$ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL`. -* `--compress-artifacts`: zips the generated application as `out/atom-mac.zip`. -* `--install[=dir]`: installs the application at `${dir}/Atom.app` for dev and stable versions or at `${dir}/Atom-Beta.app` for beta versions; `${dir}` defaults to `/Applications`. - -## Troubleshooting - -### macOS build error reports in atom/atom -* Use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Amac&type=Issues) to get a list of reports about build errors on macOS. +See the [Hacking on Atom Core](http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-mac) section in the [Atom Flight Manual](http://flight-manual.atom.io). diff --git a/docs/build-instructions/windows.md b/docs/build-instructions/windows.md index a6c327ec8..f75a07530 100644 --- a/docs/build-instructions/windows.md +++ b/docs/build-instructions/windows.md @@ -1,90 +1 @@ -# Windows - -## Requirements - -* Node.js 6.9.4 or later (the architecture of node available to the build system will determine whether you build 32-bit or 64-bit Atom) -* Python v2.7.x - * The python.exe must be available at `%SystemDrive%\Python27\python.exe`. If it is installed elsewhere create a symbolic link to the directory containing the python.exe using: `mklink /d %SystemDrive%\Python27 D:\elsewhere\Python27` -* 7zip (7z.exe available from the command line) - for creating distribution zip files -* Visual Studio, either: - * [Visual C++ Build Tools 2015](http://landinghub.visualstudio.com/visual-cpp-build-tools) - * [Visual Studio 2013 Update 5](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs) (Express Edition or better) - * [Visual Studio 2015](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs) (Community Edition or better) - - Also ensure that: - * The default installation folder is chosen so the build tools can find it - * If using Visual Studio make sure Visual C++ support is selected/installed - * If using Visual C++ Build Tools make sure Windows 8 SDK is selected/installed - * A `git` command is in your path - * Set the `GYP_MSVS_VERSION` environment variable to the Visual Studio/Build Tools version (`2013` or `2015`) e.g. ``[Environment]::SetEnvironmentVariable("GYP_MSVS_VERSION", "2015", "User")`` in PowerShell (or set it in Windows advanced system settings). - -## Instructions - -You can run these commands using Command Prompt, PowerShell, Git Shell, or any other terminal. These instructions will assume the use of Command Prompt. - -``` -cd C:\ -git clone https://github.com/atom/atom.git -cd atom -script\build -``` - -To also install the newly built application, use `script\build --create-windows-installer` and launch the generated installers. - -### `script\build` Options -* `--code-sign`: signs the application with the GitHub certificate specified in `$WIN_P12KEY_URL`. -* `--compress-artifacts`: zips the generated application as `out\atom-windows.zip` (requires [7-Zip](http://www.7-zip.org)). -* `--create-windows-installer`: creates an `.msi`, an `.exe` and two `.nupkg` packages in the `out` directory. -* `--install[=dir]`: installs the application in `${dir}\Atom\app-dev`; `${dir}` defaults to `%LOCALAPPDATA%`. - -### Running tests - -In order to run tests from command line you need `apm`, available after you install Atom or after you build from source. If you installed it, run the following commands (assuming `C:\atom` is the root of your Atom repository): - -```bash -cd C:\atom -apm test -``` - -When building Atom from source, the `apm` command is not added to the system path by default. In this case, you can either add it yourself or explicitly list the complete path in previous commands. The default install location is `%LOCALAPPDATA%\Atom\app-dev\resources\cli\`. - -**NOTE**: Please keep in mind that there are still some tests that don't pass on Windows. - -## Troubleshooting - -### Common Errors -* `node is not recognized` - * If you just installed Node.js, you'll need to restart Command Prompt before the `node` command is available on your path. - -* `msbuild.exe failed with exit code: 1` - * If using **Visual Studio**, ensure you have the **Visual C++** component installed. Go into Add/Remove Programs, select Visual Studio, press Modify, and then check the Visual C++ box. - * If using **Visual C++ Build Tools**, ensure you have the **Windows 8 SDK** component installed. Go into Add/Remove Programs, select Visual C++ Build Tools, press Modify and then check the Windows 8 SDK box. - -* `script\build` stops with no error or warning shortly after displaying the versions of node, npm and Python - * Make sure that the path where you have checked out Atom does not include a space. For example, use `C:\atom` instead of `C:\my stuff\atom`. - * Try moving the repository to `C:\atom`. Most likely, the path is too long. See [issue #2200](https://github.com/atom/atom/issues/2200). - -* `error MSB4025: The project file could not be loaded. Invalid character in the given encoding.` - * This can occur because your home directory (`%USERPROFILE%`) has non-ASCII characters in it. This is a bug in [gyp](https://code.google.com/p/gyp/) - which is used to build native Node.js modules and there is no known workaround. - * https://github.com/TooTallNate/node-gyp/issues/297 - * https://code.google.com/p/gyp/issues/detail?id=393 - -* `'node_modules\.bin\npm' is not recognized as an internal or external command, operable program or batch file.` - * This occurs if the previous build left things in a bad state. Run `script\clean` and then `script\build` again. - -* `script\build` stops at installing runas with `Failed at the runas@x.y.z install script.` - * See the next item. - -* `error MSB8020: The build tools for Visual Studio 201? (Platform Toolset = 'v1?0') cannot be found.` - * Try setting the `GYP_MSVS_VERSION` environment variable to **2013** or **2015** depending on what version of Visual Studio/Build Tools is installed and then `script\clean` followed by `script\build` (re-open the Command Prompt if you set the variable using the GUI). - -* `'node-gyp' is not recognized as an internal or external command, operable program or batch file.` - * Try running `npm install -g node-gyp`, and run `script\build` again. - -* Other `node-gyp` errors on first build attempt, even though the right Node.js and Python versions are installed. - * Do try the build command one more time as experience shows it often works on second try in many cases. - -### Windows build error reports in atom/atom -* If all fails, use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Awindows&type=Issues) to get a list of reports about build errors on Windows, and see if yours has already been reported. -* If it hasn't, please open a new issue with your Windows version, architecture (x86 or x64), and a screenshot of your build output, including the Node.js and Python versions. +See the [Hacking on Atom Core](http://flight-manual.atom.io/hacking-atom/sections/hacking-on-atom-core/#platform-windows) section in the [Atom Flight Manual](http://flight-manual.atom.io).