Contents
Try Server
The try server is an easy way to test a patch without actually checking the patch into the core repository. Your code will go through the same tests as a mozilla-central push, and you'll be able to download builds if you wish.
Getting access to the Try Server
To use the try server, you'll need Level 1 Commit Access. You can learn more about Mozilla's commit access policies and start the process of signing up for an account here: Becoming a Mozilla Contributor
After you have level 1 commit access, you'll need to do a bit of setup before you'll be able to push. See this guide for instructions.
Configuration
Before using try, there is some recommended configuration you should set up. This can be accomplished by running:
$ ./mach vcs-setup
Be sure to at least enable the firefoxtree extension and the push-to-try extension. The push-to-try extension is required if you wish to use the |mach try| command (see below). Firefoxtree will give you a handy 'try' alias you can use for pushing, and prevent you from accidentally pushing multiple heads. If for some reason you prefer not to use firefoxtree, you can set the same alias up manually in your hgrc:
[paths] try = ssh://hg.mozilla.org/try
Note: Never pull the whole try repo. You'll end up with hundreds of heads containing everyone's half baked and broken pushes.
For more information, see mercurial for mozillians.
How to push to try
There are a few ways to schedule jobs on try.
Attach new jobs from the review
For every patch submitted for review in Phabricator, a new Try run is automatically created. This run is created for static analysis, linting and other tasks. As described below, attaching new jobs to the run is easy and doesn't require more actions from the developer. Just click on the Treeherder Jobs.
For more details, see: https://firefox-source-docs.mozilla.org/tools/try/index.html#attaching-new-jobs-from-a-review
Scheduling jobs with Mach Try
The recommended way to interact with try is via the command line tool |mach try|. Since try can be used for a wide range of use cases, by developers with varying levels of experience, there is no one size fits all solution when it comes to selecting which tasks to run. Therefore |mach try| offers a range of subcommands called "selectors" for a variety of purposes. To see a list of available selectors, run:
$ mach try --help
For deeper information on a given selector, run:
$ mach try <selector> --help
If you don't specify a selector/subcommand to try, it will default to using the `syntax` selector. You can change which selector gets used by default by creating ~/.mozbuild/machrc and adding:
[try] default=<selector>
See this documentation for more information on all the available selectors, and this document for a list of available presets (derived from try_presets.yml).
Scheduling jobs with Treeherder
You can push to try with:
$ ./mach try empty
Once the push succeeds, you can open it in Treeherder and then sign in to schedule jobs manually.
Select the drop-down arrow at the top right of your push, and choose "Add new Jobs". It might take several seconds for the jobs to load (bug 1288028) :
If it helps, you can use the filter box in the site header to restrict the list of runnable jobs being displayed. Click the job symbols you wish to schedule.
If you select a test job, the required build will automatically be scheduled:
Finally, click "Trigger New Jobs" near the top right of your push.
NOTE: An action task gets scheduled which will schedule all the tasks you chose.
Scheduling jobs with Treeherder (Search)
Similar to the above method, there is now an additional way to add jobs to an existing push via Treeherder. Open the push in Treeherder and then choose "Add New Jobs (Search)" from the push's menu:
Treeherder will then fetch the list of runnable jobs in the background, then pop up a dialog window listing those jobs:
At the top of the dialog, there is a search bar. Type part of your desired job name into the search bar and press 'Enter' to filter the list of jobs. (This uses a fuzzy search library, so some minimal typos are allowed). From the filtered list of jobs, select as many of the results as you want (ctrl/shift modifiers work on this list for selecting multiple jobs):
Then click the green "Add Selected" button to add the selected jobs to the list of jobs to be run (or click the green "Add All" button to add the entire list of jobs currently in view.
Repeat the filter and selection process until you have all of your desired jobs added to the list. You can remove jobs from the list to be run using the red buttons lower on the dialog if you selected them in error:
When you are happy with your selection, click the blue "Trigger (X) Selected Jobs" button at the bottom of the dialog. Treeherder will send out a request for those jobs to be run, and an action task will be spawned to do all of the behind the scenes magic to make that happen.
Pushing Directly
It's also possible to push to try directly from hg (for now). This might be required if you're using mercurial queues. In this case, the only way to select tasks is by manually adding try syntax to your commit message:
$ hg commit -m "try: -b o -p linux64 -u mochitest" $ hg push -f try
Using |mach try| is recommended as that will automatically create and cleanup a temporary commit no your behalf, whereas with this method you are responsible for cleaning up any extra commits you make or commit messages you modify.
Viewing the results
You can see the results of your tryserver build in a number of ways:
- You'll get an email on a successful push with a link to treeherder for your revision as well as optional emails on any non-successful build/test/talos results
- You can have the results of your try run posted to bug(s) automatically at the completion of the run using the --post-to-bugzilla flag in your try syntax
- The link to treeherder will be printed on the command line.
- Look for your changeset on Treeherder. You can add &author=YOUR.EMAIL to only see your pushes.
- Download your completed builds from firefox/tryserver-builds on ftp.m.o.
Using a custom mozconfig
The mozconfigs for recent mozilla-central clones are located in the browser/config/mozconfigs directory. Edit those as you please.
If you want to apply the same mozconfig changes to multiple platforms, you can edit build/mozconfig.common.override instead. This file is included at the end of each of the in-tree mozconfig files.
Android mozconfigs are in mobile/android/config/mozconfigs.
If you modify a mozconfig file named nightly, please make sure you also change any mozconfig file named beta and/or release in the same directory, otherwise the test_compare_mozconfigs test will fail.
Note:
- TryServer purpose is to tell what will happen on Tinderbox, not to check every possible build option/configuration.
- Any non-standard feature is implicitly unsupported. You may try them, but don't complain if they break.
Re-running tasks with custom parameters from Treeherder
It is possible to run a task again, with certain types of changes to its run time environment and parameters. This feature is commonly used to enable debug logging, or run a test repeatedly to reproduce test failures.
In treeherder, select the job you want to re-run (Note: it currently only works for some jobs). The details panel should open. Look for the 3 dots icon ("Other job details") and select "Custom actions...".
The retrigger-custom action is the one selected in the drop-down menu. Modify the task parameters as desired and select "Trigger".
This will schedule the task with your specified parameters. The new task will be labeled as custom-<original_task_name>.
Some of the parameters that you can change are (see screenshot above):
- Environment variables (e.g. MOZ_LOG)
- Modify Python's logging level
- Path of the test to execute
- Gecko preferences (think of about:config)
- Run a test repeatedly
- Run until the test fails
Common problems:
- By default the entire task is re-run, running all the tests in the original task. If repeat/runUntilFailure is specified, it may take a long time to repeat all the tests, and the log file may be huge. Consider using the path: parameter to limit the run to the test(s) of interest.
Getting debug symbols
NOTE: You might be able to accomplish this by re-running a build task from Treeherder by adding the env variable to the new task.
By default native debug symbols are not uploaded for Try server builds because of their size. If you want to debug your builds locally you must add MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS=1 to the in-tree mozconfigs. You can do this for all platforms by importing this patch into your mq and pushing it along with your changes to Try. This will cause a ...crashreporter-symbols-full.zip package to be uploaded to the builds directory for each platform built.
Adding new jobs
It's possible to create new jobs (or modify existing ones) directly *in* your try push, provided you use taskcluster. Just edit the relevant configuration in testing/taskcluster. For more information on creating jobs, see the taskcluster docs.
Desktop l10n jobs
You can use the steps in Scheduling jobs with Treeherder to add localized desktop builds to your try push, regardless of whether you used try syntax at first. Filtering with 'l10n' helps to find the jobs amongst the many possibilities.
The jobs can be customized by modifying files prior to pushing:
- reducing the number of locales by limiting browser/locales/all-locales (eg top-locales like de fr ja ja-JP-mac ru zh-TW). Leaving a full list of locales is likely to hit a timeout on Mac and Windows
- use a different en-US build by modifying en_us_binary_url, but note that the building en-US and then l10n in one push is not a tested scenario
The resulting builds are uploaded to the same sub-directory as en-US builds, eg try-linux/ for 32bit linux.
Desktop l10n jobs (on Taskcluster)
To get Desktop l10n jobs on taskcluster on try, simply pass `-b o -p linux64-l10n,linux-l10n` with your try push. You'll also get these jobs automatically with `-p linux64,linux` if you are touching one of the files known to be heavily involved in l10n jobs. (Taskcluster support for other platforms is not yet available)
You can also use the steps in Scheduling jobs with Treeherder to add localized desktop builds to your try push, regardless of whether you used try syntax at first. Filtering with 'l10n' helps to find the jobs amongst the many possibilities.
The jobs can be customized by modifying files prior to pushing:
- reducing the number of locales by limiting browser/locales/all-locales (eg top-locales like de fr ja ja-JP-mac ru zh-TW).
- use a different en-US build by modifying en_us_binary_url, but note that the building en-US and then l10n in one push is not a tested scenario
The resulting builds are uploaded as a task artifact, and are not yet signed.
Android Single-Locale l10n jobs (on Taskcluster)
(NOTE: Only supported on Gecko 51a1 and above)
To get Android l10n jobs on taskcluster on try, simply pass `-p android-api-15-l10n` with your try push. You'll also get these jobs automatically with `-p android-api-15` if you are touching one of the files known to be heavily involved in l10n jobs.
You can also use the steps in Scheduling jobs with Treeherder to add localized desktop builds to your try push, regardless of whether you used try syntax at first. Filtering with 'l10n' helps to find the jobs amongst the many possibilities.
The jobs can be customized by modifying files prior to pushing:
- reducing the number of locales by limiting mobile/android/locales/all-locales (eg top-locales like de fr ru zh-TW).
- use a different en-US build by modifying en_us_binary_url, but note that the building en-US and then l10n in one push is not a tested scenario
The resulting builds are uploaded as a task artifact, and are not yet signed.
Server Status
- Pending builds by revision are at https://secure.pub.build.mozilla.org/buildapi/pending
- In-progress builds by revision are are https://secure.pub.build.mozilla.org/buildapi/running
Other Notes
- Finished builds will live in http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/<your_ldap_email>-<revision> for 14 days before deletion
- Treeherder data is purged after 4 months.
- If you have any problems please file a bug
- Suggestions for the future can be made here or file a blocking bug against bug try_enhancements
Other Mozilla Try Servers
- Thunderbird Try Server for the comm-central repository
Problem Diagnosis
Can not access try server
Test your account & configuration
-
ssh hg.mozilla.org
, response: "No Interactive shells allowed here!" -
ssh hg.mozilla.org clone invalid_sandbox
, response: menu display and interactive prompting.
Pushes to try take a very long time
Note: if a fellow developer cancelled their try push, they have saddled you with the cost of rebuilding the cache. (See caching details.)
If you're experiencing excessive wait times (> 45min) pushing to try, please file a bug asking IT to reset the try repository using this template (please include specifics of your experience). They will coordinate with sheriffs and release engineering as needed.
Waiting for Lock
If you get a message similar to:
remote: waiting for lock on repository /repo/hg/mozilla/try/ held by 'hgssh1.dmz.scl3.mozilla.com:23974' remote: abort: repository /repo/hg/mozilla/try/: timed out waiting for lock held by hgssh1.dmz.scl3.mozilla.com:30549
It means several developers are trying to push to try at the same time. In the case above, nothing appears to be wrong, as the PID changes between the messages.
Waiting for Lock multiple times with the same pid
Similar to the above case, but with the same pid when you retry over and over again.
Please retry your push. If you see messages indicating the same process has been pushing for more than 15 minutes, treat as above.
CiDuty issues
How do I trigger additional talos/test runs for a given try build?
If your syntax included the tests you'd like more of, then select the job you want on Treeherder and use the + button. For test suites you didn't request originally you can use the "Add New Jobs" interface in Treeherder.
How do I cancel existing jobs?
For individual jobs, select the relevant one on Treeherder and use the cancel button. To cancel all jobs, use the menu arrow shown on the header row for each push, and then the "Cancel all" option.