CSC/ECE 517 Spring 2016/M1704 Servo Dependency Tool: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
The '''[https://github.com/chbrown13/servo-dependency-tool Servo Dependency Tool]''' is a set of python scripts that automatically upgrades Cargo dependencies for the [https://servo.org/ Servo] web browser engine.
The '''[https://github.com/chbrown13/servo-dependency-tool Servo Dependency Tool]''' is a set of python scripts that automatically upgrades Cargo dependencies for the [https://servo.org/ Servo] web browser engine.


== Background ==
== Background ==
Line 5: Line 6:


'''The goal of the Servo Dependency Tool is to automatically upgrade Servo's dependencies whenever new versions are released.'''
'''The goal of the Servo Dependency Tool is to automatically upgrade Servo's dependencies whenever new versions are released.'''


== Requirements[https://github.com/servo/servo/wiki/Cargo-upgrade-service-project] ==
== Requirements[https://github.com/servo/servo/wiki/Cargo-upgrade-service-project] ==
Line 14: Line 16:
* Update the packages by running the cargo-update command using Servo's Mach tool
* Update the packages by running the cargo-update command using Servo's Mach tool
* Interact with GitHub to create a branch for the updates and then open a pull request on the main Servo repo
* Interact with GitHub to create a branch for the updates and then open a pull request on the main Servo repo
== Tool Workflow Overview ==
# Perform a pull to ensure the servo fork is up-to-date
# Create a new branch on the servo fork to contain the changes performed by the tool
# Parse the Cargo.lock file to determine all the packages within Servo and their current versions
# Make a local clone of the crates.io index and compare the current versions of each package to the most recent version in the crates.io index
# Iterate through all the Cargo.toml files in the Servo project and update all listed versions to the most recent version found in the previous step


== Project Structure ==
== Project Structure ==
=== servo_dependency_tool.py ===
=== servo_dependency_tool.py ===
Text
servo_dependency_tool.py is the main driver file of our tool. This file imports all of the other files and controls the overall flow of the tool from start to finish.
 


=== cargo_lock_parser.py ===
=== cargo_lock_parser.py ===
Line 33: Line 45:
=== repo_management.py ===
=== repo_management.py ===
Text
Text
== Running the Tool ==
The Servo Dependency Tool has been designed to be easy to setup and use. Detailed information can be found in the README on [https://github.com/chbrown13/servo-dependency-tool GitHub].
=== Prerequisites ===
The tool runs using Python3 and requires two python libraries in order to run: GitPython and github3.py. In addition, it is expected that the machine running the tool has a local copy of the forked Servo repo.
=== Installation and Execution ===
Installing the tool requires cloning the Servo Dependency Tool into the root folder of the local copy of Servo:
<code>git clone https://github.com/chbrown13/servo-dependency-tool</code>


== Project Links ==
== Project Links ==

Revision as of 14:53, 23 March 2017

The Servo Dependency Tool is a set of python scripts that automatically upgrades Cargo dependencies for the Servo web browser engine.


Background

Servo is a prototype web browser engine created by Mozilla Research and written in the Rust programming language. It is currently developed on 64-bit OS X, 64-bit Linux, and Android platforms. Servo depends on numerous other Rust libraries that are published on the package manager crates.io. There are no notifications for when packages are updated so it's up to developers to keep track of when they need to upgrade the dependencies within their projects.

The goal of the Servo Dependency Tool is to automatically upgrade Servo's dependencies whenever new versions are released.


Requirements[1]

  • Use Python, Node.js, or Ruby to develop the tool
  • Tool must be easily ran on hosted services (Heroku, Amazon AWS, etc)
  • Parse a Cargo.lock file to determine the list of dependencies and their current versions
  • Compare the list of dependencies and their current versions to a local clone of the crates.io index to find out the latest versions available
  • Edit all Cargo.toml files within Servo with the latest versions
  • Update the packages by running the cargo-update command using Servo's Mach tool
  • Interact with GitHub to create a branch for the updates and then open a pull request on the main Servo repo


Tool Workflow Overview

  1. Perform a pull to ensure the servo fork is up-to-date
  2. Create a new branch on the servo fork to contain the changes performed by the tool
  3. Parse the Cargo.lock file to determine all the packages within Servo and their current versions
  4. Make a local clone of the crates.io index and compare the current versions of each package to the most recent version in the crates.io index
  5. Iterate through all the Cargo.toml files in the Servo project and update all listed versions to the most recent version found in the previous step


Project Structure

servo_dependency_tool.py

servo_dependency_tool.py is the main driver file of our tool. This file imports all of the other files and controls the overall flow of the tool from start to finish.


cargo_lock_parser.py

Text

crates_io_checker.py

Text

cargo_toml_updater

Text

run_cargo_update.py

Text

repo_management.py

Text


Running the Tool

The Servo Dependency Tool has been designed to be easy to setup and use. Detailed information can be found in the README on GitHub.

Prerequisites

The tool runs using Python3 and requires two python libraries in order to run: GitPython and github3.py. In addition, it is expected that the machine running the tool has a local copy of the forked Servo repo.

Installation and Execution

Installing the tool requires cloning the Servo Dependency Tool into the root folder of the local copy of Servo: git clone https://github.com/chbrown13/servo-dependency-tool


Project Links