Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dev-master in composer.json, is this madness? [closed]

I'm using composer (in Symfony2 projects) and often get errors updating libraries.

Many libraries (most to my experience) use dev-master as version for their dependencies (or worse they use * ).

Whenever something is committed to the master branch you get to update the library, and the chances of an API change are higher as time goes by. What today in master is version 1.2.1 tomorrow could be 1.2.7, with no harm, and become later 1.7 or 2.x with sure incompatibilities.

My questions are

  1. how did we get to this point? Is it a practice suggested from high profile sources?
  2. what can I/we do to sensibilize the authors to this subject?

or am I mad?

like image 567
Riccardo Galli Avatar asked Jan 09 '13 17:01

Riccardo Galli


People also ask

What is Dev master in Composer?

The dev-master branch is one in your main VCS repo. It is rather common that someone will want the latest master dev version. Thus, Composer allows you to alias your dev-master branch to a 1.0.x-dev version.

How does Composer json work?

Composer allows developers to specify project dependencies in a composer. json file and then Composer automatically handles the rest. Composer makes it easier to keep vendor libraries out of your repo, meaning that only application code goes in the git repository.

Where does the Composer JSON file go?

To start using Composer in your project, all you need is a composer. json file. This file describes the dependencies of your project and may contain other metadata as well. It typically should go in the top-most directory of your project/VCS repository.

What is require Dev in Composer?

The package will not be installed unless those requirements can be met. require-dev (root-only) Lists packages required for developing this package (1), or running tests, etc. The dev requirements of the root package only will be installed if install is run with --dev or if update is run without --no-dev .


1 Answers

You are not mad.

  1. It's a chicken and egg issue, until people tag more, others can not require tagged releases.
  2. Nag everyone that has no tag or did not tag anything in six months (if the project is actively developed that is). I made an effort to tag all our bundles earlier this week, because I read a similar rant and I got reminded we still had only dev-master versions on most of them.

The solution really is education, and I will try to help a bit by pushing for best practices in composer docs. Not everyone has much experience with package management and many people don't realize how problematic this approach can be (until it's too late), so it's everyone's job to help by reminding them.

like image 153
Seldaek Avatar answered Oct 09 '22 17:10

Seldaek