wiki:SummerOfCode

Version 210 (modified by raimue (Rainer Müller), 8 years ago) (diff)

Add new idea for improving portfile-gen

Google Summer of Code 2013

We have been accepted for GSoC 2013. Further contributions and enhancement proposals are welcome! Please see the guide and subscribe to the MailingLists!

This is the MacPorts Project’s page for Google Summer of Code.

http://3.bp.blogspot.com/-couzpJZp3j0/URAgWOuBZ6I/AAAAAAAAAI8/CnlGEuPIL9M/s1600/GSoC+2013+logo.jpg

Information about the past years can be found at SummerOfCodeArchive.

Applications for GSoC

General info

For future reference you may check the Google SoC website. You will find more information on their page on Advice for Students. The official timeline should be consulted for the other dates.

There are several things to consider. We are willing to support and mentor students who want to gain an experience by working on the MacPorts Project. We have many ideas for potential internship subjects, yet we are open to anything that is both interesting and relevant to MacPorts. Motivated students do not necessarily need to know Tcl language beforehand, especially if they already know several scripting languages such as Python, Ruby, PHP or Perl.

For the MacPorts Project

The best way to apply is to first make contact with us, either by sending a mail to the MacPorts developer mailing list, to the potential mentors listed below, or to IRC members on #macports on FreeNode.

What we expect from students for their applications:

  • Write your own abstract and proposal, copying text from this idea page is not enough.
  • Show us that you fully understand your task and know what you want to do over the summer.
  • At best, include a short weekly roadmap covering how you would work on the task.

What you should do before handing in an application:

  • Get familiar with the MacPorts Project resources. Especially check out the code and read the guide.
  • Read the Tcl Tutorial
  • Subscribe to the mailing lists macports-dev and macports-users if you do not already read them. Don't be too shy to post.
  • Get in contact! Most important is to discuss your ideas with potential mentors via private e-mail, the MacPorts development list, or the IRC channel before applying.

Mentors

The following committers have agreed to be mentors for GSoC 2013 (append @macports.org for e-mail)

Name Email Area
Jeremy Lavergne snc Administrator
Clemens Lang cal Backup Admin, Mentoring if needed (especially for base)
Rainer Müller raimue Mentoring for base, port groups, ports, ...
Lawrence Velázquez larryv Backup to the backup admin; mentoring for port[group]s, documentation, website

Tasks

This is a list of some potential tasks that student GSoC members could undertake. These are just ideas, and while they express our current concerns, we are open to blue-sky projects related to MacPorts.

Please note that this list is absolutely not exclusive! If you have any idea about what you want to see improved in MacPorts, you are free to propose this as your own project. In any case, we recommend you talk to mentors before writing your application.

Core tasks

Binaries

MacPorts provides binaries but needs several enhancements. This task would include updating the chroot mechanism (ceased being functional with Snow Leopard) and adding support for variants. (See also MacPorts AutoBuild.)

  • Difficulty: Relatively challenging to challenging
  • Languages: Tcl
  • Potential mentors: TBD

Dependency calculation using SAT solving

This task consists of implementing a new dependency engine for MacPorts. The current dependency engine properly deals with installing packages, but it does not deal satisfactorily with dependencies on variants and versions, uninstalling and upgrading. This task requires understanding the dependency relations (required for fetching, building, configuring; static and dynamic linking; dependence at runtime).

Instead of re-inventing the wheel it might be helpful to use software available to solve the problem of dependency calculation, e.g. by implementing an interface to a Common Upgradeability Description Format-based SAT solver. Such a solver could generate an execution plan we could propose to the user and finally execute when confirmed. For this task, the MacPorts concept of variants needs to be transformed into a representation the SAT solvers will be able to optimize. If time permits, rolling back on failed updates can also be implemented. There is also a libCUDF port that might be helpful to look at.

  • Difficulty: Challenging
  • Languages: Tcl, C
  • Potential mentors: cal

Remove dependency on Xcode

MacPorts currently requires a full Xcode installation, even if the user only wishes to install prepackaged binaries or compile ports that do not use Xcode projects for building. This task be as simple as allowing MacPorts to install binary packages without Xcode present, or as complex as enabling MacPorts to be completely self-sufficient (not requiring Xcode or the Command Line Tools at all).

  • Difficulty: Medium to very challenging
  • Languages: Tcl, C
  • Potential mentors: TBD

MacPorts port for self-management

The MacPorts port should be the source for updating a user’s MacPorts installation.

Currently the MacPorts port is used to build the .dmg installer for MacPorts that is used for the initial installation of MacPorts, and port uses the “selfupdate” mechanism for maintaining the MacPorts installation. The selfupdate mechanism is (at least not documented as such) not accessible through the MacPorts API and does not use the MacPorts mechanisms for maintaining ports.

  • Difficulty: Challenging
  • Languages: Tcl, C
  • Potential mentors: TBD

Generating Portfiles

There are multiple tasks related to the generation of Portfiles. Some of these may not be enough work for a full summer project, so they could be combined for proposals freely when the applying student wants to.

Perl modules integration from CPAN

There has been an attempt to write a script for automatic generation of Portfiles from CPAN. This would simplify the maintenance of Perl modules in MacPorts. Revive this project and finish the script or rewrite it.

Resources:

  • Difficulty: Easy to medium
  • Languages: Perl, probably Tcl
  • Potential mentors: TBD
Read packages from Python's PIP (pip2port)

MacPorts should be able to more readily install python packages from pip. We don't want to integrate the build/installation process of PIP, simply parse information or eggs it provides for various packages. This information will then be used to generate a Portfile, akin to cpan2port.

There may be instances where MacPorts package names don't match up with pip’s. In this case, pip should be the authority and all improperly named MacPorts packages should be replaced by a renamed copy. Verbose automation of this step, akin to the portcheckup script, is ideal.

The portfile generator might be helpful.

  • Difficulty: Medium
  • Languages: Tcl, Python, C
  • Potential mentors: snc
Read packages from other various package managers

As above with the pip2port proposal, except with other package managers, such as opam for ocaml packages, cabal for haskell, luarocks for lua, npm for node.js, and so on.

  • Classification: Medium
  • Languages: Tcl, C, OCaml, Haskell, Lua, Node.js, etc.
  • Potential mentors: TBD
Generate Portfiles with auto-detection of build toolchain

To ease creation of new ports, the helper script portfile-gen is able to generated a Portfile stub by taking the name, version and possible a port group as input. This should be extended to handle more things automatically. Lots of options in a Portfile need to be figured out by the maintainer, although they could be extracted automatically from the source.

With just a URL to the tarball of a software, portfile-gen can usually automatically extract the name and the version from the filename. Furthermore, the master_sites and distfiles can be derived from the URL, with special handling for sites like sourceforge/gnu/etc. However, it should also be possible to specify this later and start portfile-gen with a pre-downloaded tarball. The checksums for the distfiles can be generated after fetching the tarball (portfile authors should be warned to verify these with upstream!) and even more information can be collected when extracting the tarball.

Different build systems usually have a unique way to be detected. For example, if a configure.ac or configure.in exists, but no configure, we need to run autoconf. If there is also a Makefile.am, but no Makefile.in this is using automake and we should better use autoreconf instead. If there is a CMakeLists.txt, we should include the cmake port group. If there is just a Makefile, but no configure, chances are high we can skip the configure phase with use_configure no.

There are a lot more of such heuristics similar the examples above. This tasks includes implementing a framework where more of these indicators and the resulting actions can be added.

The goal of this task is to create an easy-to-use Portfile generator that derives the basic information of a Portfile automatically. This should lower the amount of lines to be written by Portfile authors and lower the barrier for writing the first Portfile. If this is implemented with Tcl modules in mind, this could probably even go into base as a port new or port create command.

  • Classification: Medium
  • Languages: Tcl
  • Potential mentors: raimue

Increase test coverage

MacPorts currently includes a test framework to test features of the infrastructure. However, the tests do not cover all the code. This task consists of extending the test framework and could be broadened to develop a code coverage technology for MacPorts to make the infrastructure more robust to future changes.

  • Difficulty: Relatively easy to very challenging
  • Languages: Tcl, C
  • Potential mentor: raimue

Configuration and environment selftest

Add a command to check current setup for common pitfalls (e.g. stuff in /usr/local), inspired by Homebrew’s brew doctor functionality.

  • Difficulty: Easy
  • Languages: Tcl
  • Potential mentors: larryv

Improve Trace mode

Improve trace mode to the point where developers (and the build server) could run with it always turned on. This currently requires fixing some (minor) remaining bugs in the trace code itself, adjust the build system to always build the tracing library as universal binary and improving the Tcl backend of trace mode (e.g. by adding more features like a list of accessed files, speeding up the lookup by using better data structures).

  • Difficulty: Medium to Easy
  • Programming languages: Tcl, C
  • Potential mentors: cal

Improve startupitem code

MacPorts has the ability to automatically generate startup items for the current platform. For OS X, these are plist files for launchd which will be installed as /Library/LaunchDaemons/org.macports.*.plist. The current code would need a little care and could make use of options which have been added in recent releases of launchd.

Features that could be useful include (but are not limited to):

  • Not using daemondo if the daemon works fine under launchd without it
  • Ability to install multiple plists
  • Support for LaunchAgents as well as LaunchDaemons
  • Installing plists in ~/Library for non-root installs if the user wants
  • only modify specific XML tags to avoid clobbering additions by user
  • Difficulty: Easy
  • Languages: Tcl, C
  • Potential mentors: larryv

Reclaim disk space

Improve port clean to be able to delete distfiles for a specified version, and all distfiles not needed by currently installed versions of ports. In general, add an action for reclaiming disk space, which would delete old distfiles and archives and uninstall inactive ports (and anything else that would help).

  • Difficulty: Easy
  • Languages: Tcl, C
  • Potential mentors: larryv

Parallel execution

When an action will run targets on multiple ports, run them in parallel when possible and sensible (requires tracking dependencies between both targets and ports and figuring out the maximum reasonable parallelism, e.g. several ports can fetch at once on a fast connection but you only want one 'make -j8' at a time).

  • Difficulty: Very challenging
  • Languages: Tcl, C
  • Potential mentors: TBD

Migrate muniversal into base (lipo merging)

Integrate the muniversal portgroup into base. Not just a direct copy-and-paste, but in a way that makes sense and preserves the way portfiles are expected to behave (which the current portgroup doesn't).

  • Difficulty: Medium
  • Languages: Tcl, C
  • Potential mentors: TBD

Improve fetching from version control

Make cvs/svn/git/hg/bzr fetch types checkout into the distfiles dir and then export into the work dir, to avoid having to re-fetch after cleaning the work directory.

  • Difficulty: Easy
  • Languages: Tcl, C
  • Potential mentors: larryv

Interactive port command

Write an interactive command-line tool that can be used instead of the non-interactive port(1). (The existing "interactive mode" of port(1) is actually just batch mode reading from stdin, and is not really interactive.) Factor out code used by both tools into a shared module.

An interactive tool would ask for user input to resolve many situations that cause port(1) to simply error out. For example, if you try to install a port and one of its dependencies conflicts with something already installed, it could ask if you want to deactivate the installed one and its dependents.

  • Difficulty: Medium
  • Languages: Tcl, C
  • Potential mentors: TBD

Secondary tasks

Portfiles

Sweep through all Portfiles and look for useful opportunities to add more built-in Tcl functions that make Portfiles more (usefully) terse, powerful, flexible or easier to write. I'm sure there is an entirely family of helper functions yet to be written here. This might also include porting additional packages to MacPorts and cleaning up or removing obsolete ports.

  • Classification: Medium
  • Language: Tcl
  • Potential mentors: larryv

Documentation and website

Improve MacPorts documentation, website and Trac system. Note that pure documentation proposals are not allowed by Google.

  • Difficulty: Easy to difficult
  • Languages: PHP, Python
  • Potential mentors: larryv

Shell environment

Add support for providing basic and port-provided environmental services to users in the ~/.profile, ~/.cshrc, and ~/.xinitrc files, so that instead of manipulating the user's .profile to modify certain paths, the installer could append "source /opt/local/etc/bash.rc" to the end of a user's .profile file and that bash.rc would source all the files in /opt/local/etc/bash.d.

This task alone is most probably not enough for the whole Summer Of Code.

  • Difficulty: Easy
  • Potential mentors: raimue