]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/contributor/quick-start.itexi
CG: Update info - how to request access to tracker
[lilypond.git] / Documentation / contributor / quick-start.itexi
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3 @node Quick start
4 @chapter Quick start
5
6 Want to submit a patch for LilyPond?  Great!  Never created a patch
7 before? Never compiled software before? No problem!  This chapter is
8 for you and will help you do this as quickly and easily as possible.
9
10 @menu
11 * LilyDev::
12 * lily-git::
13 * git-cl::
14 * Compiling with LilyDev::
15 * Now start work!::
16 @end menu
17
18 @node LilyDev
19 @section LilyDev
20
21 @c This text was written based on LilyDev 4.0 - JL
22
23 There is a @q{remix} of Debian GNU/Linux -- known as @qq{LilyDev} for
24 short -- which includes all the necessary software and tools to compile
25 LilyPond, the documentation and the website (also see
26 @ref{Website work}).
27
28 @warning{LilyDev does not include the software for the Grand Unified
29 Builder -- also see @ref{Grand Unified Builder (GUB)}.}
30
31 While compiling LilyPond on Mac OS and Windows is possible, both
32 environments are complex to set up.  LilyDev can be easily installed
33 and run inside a @q{virtual machine} on either of these operating
34 systems relatively easily using readily available virtualization
35 software.  We recommend using VirtualBox as it is available for all
36 major operating systems and is very easy to install & configure.
37
38 The LilyDev disk image can also be written to a USB device or @q{burnt}
39 to a DVD -- it is approximately 900 MB in size -- and installed just
40 like any standard GNU/Linux distribution.
41
42 The current image is based on a 32-bit version of Debian 8 (@q{Jessie})
43 and the disk image was generated using Debian
44 @uref{http://live.debian.net/, live-build 4}.
45
46 @noindent
47 Download the LilyDev disk image file (a @code{.iso} file) from here:
48
49 @example
50 @uref{https://github.com/fedelibre/LilyDev/releases/latest}
51 @end example
52
53 @warning{Apart from installing and configuring LilyDev in VirtualBox,
54 the rest of the chapter assumes that you are comfortable using the
55 command-line and is intended for users who may have never created a
56 patch or compiled software before.  More experienced developers (who
57 prefer to use their own development environment) may still find it
58 instructive to skim over the following information.}
59
60 If you are not familiar with GNU/Linux, it may be beneficial to read a
61 few @qq{introduction to Linux} type web pages.
62
63 @menu
64 * Installing LilyDev in VirtualBox::
65 * Configuring LilyDev in VirtualBox::
66 @end menu
67
68
69 @node Installing LilyDev in VirtualBox
70 @unnumberedsubsec Installing LilyDev in VirtualBox
71
72 This section discusses how to install and use LilyDev with VirtualBox.
73
74 @warning{If you already know how to install a virtual machine using a
75 disc image inside VirtualBox (or your own virtualization software) then
76 you can skip this section and go straight to @ref{lily-git}.}
77
78 @enumerate
79 @item
80 Download VirtualBox from here:
81
82 @example
83 @uref{http://www.virtualbox.org/wiki/Downloads}
84 @end example
85
86 @warning{In virtualization terminology, the operating system where
87 VirtualBox is installed is known as the @strong{host}.  LilyDev
88 will be installed @q{inside} VirtualBox as a @strong{guest}.}
89
90 @item
91 Start the VirtualBox software and click @q{New} to create a new
92 @qq{virtual machine}.
93
94 The @q{New Virtual Machine Wizard} will walk you through setting up your
95 guest virtual machine.  Choose an appropriate name for your LilyDev
96 installation and select the @q{Linux} operating system.  When selecting
97 the @q{version} choose @q{Debian (32 bit)} (don't use the @q{64 bit}
98 option).  If you do not have that specific option choose @q{Linux 2.6}
99 (again do not choose any option that has 64 bit next to it).
100
101 @item
102 Select the amount of RAM you will allow the LilyDev guest to use from
103 your host operating system when it is running.  If possible, use at
104 least 700 MB of RAM; the more RAM you can spare from your host the
105 better, although LilyDev will currently use no more than 4 GB (4096 MB)
106 even if you are able to assign more.
107
108 @item
109 For your @q{Virtual Hard Disk}, leave the @q{Create new hard disk}
110 option checked, use the default @q{VDI} and @qq{Dynamically allocated}
111 options for the virtual hard drive.  A complete compile of everything
112 (code, docs, regression tests) can reach 10 GB so size your virtual disk
113 and its location accordingly.
114
115 @item
116 Verify the summary details and click @q{Create}, when you are satisfied.
117 Your new guest will be displayed in the VirtualBox window.
118
119 @warning{The image contains a @q{686-pae} kernel, so you must enable
120 @code{PAE} within the virtual machine's settings -- click on
121 @clicksequence{System @click{} Processor} and select
122 @q{Extended features: Enable PAE/NX}.}
123
124 @item
125 Click the @q{Start} button and the @q{First Run Wizard} will prompt you
126 for the installation media.  Click the browse icon, locate the LilyDev
127 disk image file that you downloaded (the @code{.iso} file) and click
128 through the wizard to begin the installation process.
129
130 @item
131 When the LilyDev disk image boots for the first time, choose either the
132 @q{Install} or the @q{Graphical install} menu item.  The installer will
133 then walk you through the complete installation process.
134
135 @item
136 At the @qq{Partition disks} stage, do not be afraid to select
137 @qq{Guided - use entire disk}, since this refers to your
138 @strong{@emph{virtual disk}}, not your computer's own hard disk.
139
140 @item
141 Continue to click through the rest of the wizard, filling in any
142 appropriate details when asked, and wait for the install to complete.
143 This will take about 10 minutes or so on a reasonably modern computer.
144
145 @item
146 When the installation is completed, just click on @q{Continue} (you
147 do not have to remove any media since you installed LilyDev from a Disk
148 image, which is just a file on your computer).  The installer will
149 reboot the virtual machine.
150
151 @end enumerate
152
153 @noindent
154 LilyDev should now be installed and running!
155
156
157 @node Configuring LilyDev in VirtualBox
158 @unnumberedsubsec Configuring LilyDev in VirtualBox
159
160 VirtualBox has extra @q{guest additions} which although are not
161 necessary to use LilyDev or compile LilyPond, do provide some additional
162 features to your Virtual Machine to make it easier to work with.  Such
163 as being able to dynamically resize the LilyDev window, allow seamless
164 interaction with your mouse pointer on both the host and guest and let
165 you copy/paste between your host and guest if needed.
166
167 @enumerate
168
169 @item
170 Select the @q{Devices} menu from the virtual machine window and choose
171 @q{Install Guest Additions...}.  This will automount a CD which will
172 prompt you to autorun it.  Click OK and follow the instructions.  It is
173 recommended to reboot the guest when the installation is complete.
174
175 Other virtualization software will also have their own @q{guest}
176 additions, follow the normal procedures for your virtualization software
177 with LilyDev as the client.
178
179 @item
180 Restart LilyDev to complete the installation of the guest additions.
181
182 @advanced{If you do any kernel upgrades, you may need to reinstall the
183 additional software.  Just follow the step above again and reboot when
184 the reinstallation is complete.}
185
186 @end enumerate
187
188 @noindent
189 Other items that may be helpful:
190
191 @itemize
192
193 @item
194 In the settings for the virtual machine, set the network to
195 Bridged mode to allow you to access shared folders when using Windows
196 hosts.
197
198 @item
199 Set up any additional features, such as @q{Shared Folders} between
200 your main operating system and LilyDev.  This is distinct from the
201 networked share folders in Windows.  Consult the external documentation
202 for this.
203
204 Some longtime contributors have reported that @q{shared folders}
205 are rarely useful and not worth the fuss, particularly since files
206 can be shared over a network instead.
207
208 @item
209 Pasting into a terminal is done with @code{Ctrl+Shift+v}.
210
211 @item
212 Right-click allows you to edit a file with the text editor (default
213 is Leafpad).
214
215 @end itemize
216
217 @knownissues
218 Not all hardware is supported in all virtualization tools.  In
219 particular, some contributors have reported problems with USB network
220 adapters.  If you have problems with network connection (for example
221 Internet connection in the host system is lost when you launch virtual
222 system), try installing and running LilyDev with your computer's
223 built-in network adapter used to connect to the network.  Refer to the
224 help documentation that comes with your virtualization software.
225
226
227 @node lily-git
228 @section lily-git
229
230 The @q{LilyPond Contributor's Git Interface} (otherwise known as
231 @command{lily-git.tcl}) is a simple-to-use GUI to help you download and
232 update the LilyPond source code as well as an aid to making software
233 patches.
234
235 @menu
236 * Where to get lily-git::
237 * Using lily-git to download the source code::
238 * How to use lily-git::
239 @end menu
240
241 @node Where to get lily-git
242 @unnumberedsubsec Where to get lily-git
243
244 Depending on your development environment, lily-git may already be
245 installed on your computer.
246
247 @itemize
248 @item
249 If you are using LilyDev (see @ref{LilyDev}) then lily-git should
250 already be installed and ready to run.  If this is not the case you can
251 easily turn it on by adding the following line in @code{~/.bashrc}:
252
253 @example
254 # add lily-git to the PATH
255 PATH=$LILYPOND_GIT/scripts/auxiliar:"$@{PATH@}"
256 @end example
257
258 @item
259 For those not using LilyDev, lily-git can be obtained by downloading
260 the software directly. See @ref{Manually installing lily-git.tcl}.
261
262 @item
263 lily-git is part of the LilyPond source code and is located in
264 @file{$LILYPOND_GIT/scripts/auxillar/lily-git.tcl}.
265
266 @end itemize
267
268
269 @node Using lily-git to download the source code
270 @unnumberedsubsec Using lily-git to download the source code
271
272 @enumerate
273 @item
274 Type the following command into a Terminal:
275
276 @example
277 lily-git.tcl
278 @end example
279
280 @noindent
281 You will be prompted to enter a name and email address into the lily-git
282 UI.  This information is used to label any patches you create (using the
283 lily-git UI or git via the command line) and can be changed later if
284 required.  See @ref{Configuring Git}.
285
286 @item
287 Click on the @emph{Submit} button to update lily-git with the
288 information.
289
290 @item
291 Click on the @qq{Get source} button.
292
293 A directory called @file{lilypond-git} is created within your home
294 directory and the entire source code will start to be downloaded into
295 it.
296
297 @warning{Be patient! There is no progress bar in the lily-git UI but the
298 complete source is around 180@tie{}MB.}
299
300 @noindent
301 When the source code has been downloaded, the @qq{command output} window
302 in the lily-git UI will update and display @qq{Done} on the very last
303 line and the button label will change to say @qq{Update source}.
304
305 @warning{Some contributors have reported that occasionally nothing
306 happens at this step at all.  If this occurs, then try again in a few
307 minutes -- it could be an intermittant network problem.  If the
308 problem persists, please ask for help.}
309
310 @item
311 Close the lily-git GUI and navigate to the @file{lilypond-git}
312 directory to view and edit the source files.
313
314 @end enumerate
315
316 @noindent
317 If this is the first time you will be attempting to compile LilyPond,
318 please see the section @ref{Compiling with LilyDev} before continuing.
319
320
321 @node How to use lily-git
322 @unnumberedsubsec How to use lily-git
323
324 Here is a brief description of what each button does in the lily-git UI.
325
326 @advanced{Throughout the rest of this manual, most command-line
327 input should be entered from within the top level of the
328 @file{~/lilypond-git/} directory.  This is known as the
329 @emph{top of the source directory} and is also referred to as
330 @var{$LILYPOND_GIT} as a convention for those users who may have
331 configured their own locations of the LilyPond source code.}
332
333 @warning{For those less experienced contributors using lily-git, we
334 recommend that you only work on one set of changes at a time and not
335 start on any new changes until your first set has been accepted.}
336
337 @subsubheading 1. Update source
338
339 Click the @qq{Update source} button to get any recent changes to the
340 source code that have been added by other contributors since your last
341 session.
342
343 @warning{If another contributor has updated files in the source code
344 that you had been working on then updating your own copy of the source
345 code may result in what is known as a @emph{merge conflict}.  If this
346 occurs, follow the instructions to @qq{Abort changes}, below.  Note that
347 your work will not be lost.}
348
349
350 @subsubheading 2a. New local commit
351
352 A single commit typically represents one logical set of related
353 changes (such as a bug-fix), and may incorporate changes to
354 multiple files at the same time.
355
356 When you're finished making the changes for a commit, click the
357 @qq{New local commit} button.  This will open the @qq{Git Commit
358 Message} window.  The message header is required, and the message
359 body is optional.
360
361 After entering a commit message, click @qq{OK} to finalize the
362 commit.
363
364 @advanced{for more information regarding commits and commit
365 messages, see @ref{Commits}.}
366
367
368 @subsubheading 2b. Amend previous commit
369
370 You can go back and make changes to the most recent commit with
371 the @qq{Amend previous commit} button.  This is useful if a
372 mistake is found after you have clicked the @qq{New local commit}
373 button.
374
375 To amend the most recent commit, re-edit the source files as
376 needed and then click the @qq{Amend previous commit} button.  The
377 earlier version of the commit is not saved, but is replaced by the
378 new one.
379
380 @warning{This does not update the patch @strong{files}; if you
381 have a patch file from an earlier version of the commit, you will
382 need to make another patch set when using this feature.  The old
383 patch file will not be saved, but will be replaced by the new one
384 after you click on @qq{Make patch set}.}
385
386
387 @subsubheading 3. Make patch set
388
389 Before making a patch set from any commits, you should click the
390 @qq{Update source} button to make sure the commits are based on
391 the most recent remote snapshot.
392
393 When you click the @qq{Make patch set} button,
394 @command{lily-git.tcl} will produce patch files for any new
395 commits, saving them to the current directory.  The command output
396 will display the name of the new patch files near the end of the
397 output:
398
399 @example
400 0001-CG-add-lily-git-instructions.patch
401 Done.
402 @end example
403
404 Send patch files to the appropriate place:
405
406 @itemize
407 @item
408 If you have a mentor, send it to them via email.
409
410 @item
411 Translators should send patches to
412 @email{translations@@lilynet.net}.
413
414 @item
415 More experienced contributors should upload the patch for
416 web-based review.  This requires additional software and use of
417 the command-line; see @ref{Uploading a patch for review}.
418
419 @item
420 If you have trouble uploading the patch for review,
421 ask for help on @email{lilypond-devel@@gnu.org}.
422
423 @end itemize
424
425
426 @subsubheading The @qq{Abort changes -- Reset to origin} button
427
428 @warning{Only use this if your local commit history gets
429 hopelessly confused!}
430
431 The button labeled @qq{Abort changes -- Reset to origin} will copy
432 all changed files to a subdirectory of @file{$LILYPOND_GIT} named
433 @file{aborted_edits/}, and will reset the repository to the
434 current state of the remote repository (at @code{git.sv.gnu.org}).
435
436
437 @node git-cl
438 @section git-cl
439
440 @menu
441 * Installing git-cl::
442 * Updating git-cl::
443 * Configuring git-cl::
444 @end menu
445
446 Git-cl is a @q{helper script} that uploads patches to Google's Rietveld
447 Code Review Tool -- used by the developers for patch review -- and, at
448 the same time, updates LilyPond's issue tracker.
449
450
451 @node Installing git-cl
452 @unnumberedsubsec Installing @code{git-cl}
453
454 @warning{LilyDev users can jump straight to the next section on updating
455 @command{git-cl} as it will already be installed in your home
456 directory.}
457
458 @enumerate
459
460 @item
461 Download @command{git-cl} by running the command:
462
463 @example
464 git clone https://github.com/gperciva/git-cl.git
465 @end example
466
467 @noindent
468 or, if that command fails for any reason, try:
469
470 @example
471 git clone git://github.com/gperciva/git-cl.git
472 @end example
473
474 @item
475 Add the @file{git-cl/} directory to your @var{PATH} or create a symbolic
476 link to the @command{git-cl} and @command{upload.py} scripts in one of
477 your @var{PATH} directories (e.g. @file{$HOME/bin}).
478
479 In GNU/Linux you can add directories to @var{PATH} by adding this line
480 to your @file{.bashrc} file located in your home directory:
481
482 @example
483 PATH=~/directory_containing_git-cl:"$@{PATH@}"
484 @end example
485
486 @end enumerate
487
488
489 @node Updating git-cl
490 @unnumberedsubsec Updating @code{git-cl}
491
492 LilyDev users should make sure that they always have the latest
493 version of git-cl installed.  It is possible that changes have been
494 made to git-cl that are not (yet) included in the version of LilyDev
495 that you are using.
496
497 @noindent
498 Using a terminal run the following commands:
499
500 @example
501 cd ~/git-cl/
502 git pull
503 @end example
504
505 This will download and update you to the lastest version of git-cl.
506
507
508 @node Configuring git-cl
509 @unnumberedsubsec Configuring @code{git-cl}
510
511 Because @code{git-cl} updates two separate websites (Google's Rietveld
512 Code Review Tool and LilyPond's issue tracker) you @emph{must} have a
513 valid user account (login and password) for both sites.
514
515 @subsubheading Set up a login account for Rietveld Code Review Tool
516
517 @noindent
518 For the Rietveld Code Review Tool you will need a Google account but
519 this does @emph{not} require @q{Google} email address; i.e. @emph{any}
520 email address for your Google account can be used.  Just select the
521 option @qq{I prefer to use my current email address} when you sign up
522 with Google.
523
524 @warning{In order for @code{git-cl} to work correctly with this Google
525 account, your Google Account Settings must have the
526 @q{Access for less secure apps} set to @q{Allowed} -- this is normally
527 the default setting.}
528
529 @subsubheading Set up a login account for LilyPond's Issue Tracker
530
531 @noindent
532 Please register a user account at
533 @code{https://sourceforge.net/user/registration} preferably using the
534 same email address that you want to use LilyPond Developer mailing list
535 login.
536
537 @noindent
538 Once you have created this Sourceforge user account, send an email to
539 the LilyPond Developer's mailing list (@code{lilypond-devel@@gnu.org})
540 asking for write access to the issue tracker along with your Sourceforce
541 @emph{Username} (not email address) and someone will then be able to set
542 this up for you.
543
544 @subsubheading Authorizing git-cl for the LilyPond issue tracker
545
546 The @code{git-cl} command itself also needs to be @q{authorized} so that
547 it can access the LilyPond issue tracker.
548
549 @enumerate
550 @item
551 Once you have been given a valid login for the LilyPond issue tracker,
552 go to the @q{Account settings} and select the @q{OAuth} tab.
553
554 @item
555 Locate the @q{Register New Application} section and enter @code{git-cl}
556 in the @q{Application Name:} field.
557
558 @item
559 Click on the @q{Register new application} button.  You should now see
560 @q{git-cl} listed under the @q{My Applications} section.
561
562 @item
563 Click on the @q{Generate Bearer Token} button.  You should now see
564 @q{git-cl} listed under the @q{Authorized Applications} section along
565 with a value for the @q{Bearer Token} entry.  This value is used, in the
566 next steps, to allow git-cl to access and update the LilyPond issue
567 tracker.
568
569 @end enumerate
570
571 @subsubheading Installing ca-certificates
572
573 In order to have @code{git-cl} properly update issues on the SourceForge
574 Allura issue tracker, you must have the package @code{ca-certificates}
575 installed.  You can check to see if the package is installed with
576
577 @example
578 apt --installed list | grep ca-certificates
579 @end example
580
581 If @code{ca-certificates} is installed, you will get a result that shows
582 the version that is installed.  If it is not installed, there will be
583 no version displayed.
584
585 Install @code{ca-certificates} with the following:
586
587 @example
588 sudo apt-get install ca-certificates
589 @end example
590
591
592 @subsubheading Running git-cl for the first time
593
594 @enumerate
595 @item
596 Using a terminal, move to the top level of the @code{$LILYPOND_GIT}
597 directory and then run @code{git-cl} with the @code{config} option:
598
599 @example
600 cd $LILYPOND_GIT
601 git-cl config
602 @end example
603
604 @noindent
605 You will see a series of prompts.  For most of them you can simply
606 accept the default value by responding with a newline (i.e. by pressing
607 return or enter).
608
609 @item
610 The prompt for the @code{Rietveld server} (the patch review tool), which
611 defaults to @code{codereview.appspot.com}
612
613 @example
614 Rietveld server (host[:port]) [codereview.appspot.com]:
615 @end example
616
617 @item
618 The prompt for the @code{Allura server} (the issue tracker), which
619 defaults to @code{https://sourceforge.net/p/testlilyissues/issues/}
620
621 @example
622 Allura server [https://sourceforge.net/p/testlilyissues/issues/]:
623 @end example
624
625 @item
626 When prompted for the @code{Allura bearer token} copy/paste the value
627 generated in the previous steps for
628 @emph{Authorising git-cl for the LilyPond issue tracker}
629
630 @smallexample
631 Allura bearer token (see https://sourceforge.net/auth/oauth/): fdbfca60801533465480
632 @end smallexample
633
634 @warning{The above is a @q{fake} bearer token used just for
635 illustration. Do not use this value.}
636
637 @item
638 Finally, the prompt for the @code{CC list}, which defaults to
639 @code{lilypond-devel@@gnu.org}, the LilyPond Developer's email list.
640
641 @example
642 CC list ("x" to clear) [lilypond-devel@@gnu.org]:
643 @end example
644
645 @end enumerate
646
647 The @code{git-cl} script should now be correctly configured for use.
648
649
650 @node Compiling with LilyDev
651 @section Compiling with LilyDev
652
653 LilyDev is our @q{remix} of Debian which contains all the
654 necessary dependencies to do LilyPond development; for more
655 information, see @ref{LilyDev}.
656
657 @subsubheading Preparing the build
658
659 To prepare the build directory, enter (or copy&paste) the below
660 text.  This should take less than a minute.
661
662 @c we heavily recommend the out-of-tree build; do not change this!
663
664 @example
665 cd $LILYPOND_GIT
666 sh autogen.sh --noconfigure
667 mkdir -p build/
668 cd build/
669 ../configure
670 @end example
671
672 @subsubheading Building @code{lilypond}
673
674 Compiling LilyPond will take anywhere between 1 and 15 minutes on most
675 @q{modern} computers -- depending on CPU and available RAM.  We also
676 recommend that you minimize the terminal window while it is building;
677 this can help speed up on compilation times.
678
679 @example
680 cd $LILYPOND_GIT/build/
681 make
682 @end example
683
684 @noindent
685 It is possible to run @code{make} with the @code{-j} option to help
686 speed up compilation times even more.  See @ref{Compiling LilyPond}
687
688 You may run the compiled @code{lilypond} with:
689
690 @example
691 cd $LILYPOND_GIT/build/
692 out/bin/lilypond my-file.ly
693 @end example
694
695 @subsubheading Building the documentation
696
697 Compiling the documentation is a much more involved process, and
698 will likely take 2 to 10 hours.
699
700 @example
701 cd $LILYPOND_GIT/build/
702 make
703 make doc
704 @end example
705
706 The documentation is put in @file{out-www/offline-root/}.  You may
707 view the html files by entering the below text; we recommend that
708 you bookmark the resulting page:
709
710 @example
711 firefox $LILYPOND_GIT/build/out-www/offline-root/index.html
712 @end example
713
714 @subsubheading Installing
715
716 Don't.  There is no reason to install LilyPond within LilyDev.
717 All development work can (and should) stay within the
718 @file{$LILYPOND_GIT} directory, and any personal composition
719 or typesetting work should be done with an official GUB release.
720
721
722 @subsubheading Problems and other options
723
724 To select different build options, or isolate certain parts of the
725 build, or to use multiple CPUs while building, read
726 @ref{Compiling}.
727
728 In particular, contributors working on the documentation should be
729 aware of some bugs in the build system, and should read the
730 workarounds in @ref{Generating documentation}.
731
732
733 @node Now start work!
734 @section Now start work!
735
736 LilyDev users may now skip to the chapter which is aimed at
737 their intended contributions:
738
739 @itemize
740 @item @ref{Documentation work}
741 @item @ref{Translating the documentation}
742 @item @ref{Website work}
743 @item @ref{Regression tests}
744 @item @ref{Programming work}
745 @end itemize
746
747 These chapters are mainly intended for people not using LilyDev,
748 but they contain extra information about the
749 @qq{behind-the-scenes} activities.  We recommend that you read
750 these at your leisure, a few weeks after beginning work with
751 LilyDev.
752
753 @itemize
754 @item @ref{Working with source code}
755 @item @ref{Compiling}
756 @end itemize
757
758
759