Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bin/bldr update removes all composer dependencies - composer.json not found? #149

Closed
lastzero opened this issue Feb 17, 2016 · 8 comments
Closed

Comments

@lastzero
Copy link
Contributor

Bldr comes with predefined install and update commands that can not be overwritten in .bldr.yml.dist. Those commands execute composer install / composer update, but don't seem to find composer.json:

# bin/bldr update
Loading composer repositories with package information
Updating dependencies                                 
  - Removing bldr-io/bldr (8.4.0)
  - Removing bldr-io/composer-plugin (1.0.6)
  - Removing dflydev/embedded-composer (dev-master)
  - Removing composer/composer (dev-master)
  - Removing composer/spdx-licenses (1.1.2)
  - Removing composer/semver (1.2.0)
...

Basically, Bldr removes itself, which doesn't seem to be the intended behaviour. It probably looks for composer.json in bin instead of the main directory?

My composer.json looks like this (only the important parts):

{
  "autoload": {
    "psr-0": {
      "": "src/"
    }
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "symfony/symfony": "2.8.*"
  },
  "require-dev": {
    "bldr-io/bldr": "@stable"
  },
  "config": {
    "bin-dir": "bin"
  }
}
@cryptiklemur
Copy link
Member

Those two arent supposed to be used for running your own composer install. Those are for installing third party blocks for bldr.

@lastzero
Copy link
Contributor Author

But right now they uninstall existing project dependencies without asking. Are you sure, this is what you want?

@cryptiklemur
Copy link
Member

Its not actually bldr code: https://github.com/bldr-io/bldr/blob/master/src/Application.php#L118

Its embedded composer

@lastzero
Copy link
Contributor Author

Maybe you want to rename the arguments to install-blocks and update-blocks then, as a quick fix? We're using Bldr as a task runner / automation tool. If bin/bldr build works and executes a project build, any sane person would expect bin/bldr update to execute a project update!? (Most devs don't read the docs, when they are in a hurry.)

@cryptiklemur
Copy link
Member

I can't change that command. It's not my command to change.

And i have to disagree. A developer should know what executable they are executing.

@lastzero
Copy link
Contributor Author

I understand, but it worries me a bit. Bldr seems like a hack to me now. Bldr is not just a random executable, but a configurable task runner. Nothing you want to be surprised of. Think of Murphy’s Law.

@k-k
Copy link

k-k commented Feb 18, 2016

@aequasi You can change the command names. The argument you pass to the constructor on those commands sets the prefix for the command name, which you're setting as empty ('').

Maybe blocks-install and blocks-update would be a good compromise.

@lastzero
Copy link
Contributor Author

While all build profiles work without using "run", update still doesn't work as expected:

# bin/bldr update

  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "run" is not defined.                                   

Might be due to

$nonContainerCommands = ['install', 'update', 'dumpautoload', 'help'];

in src/Application.php?

lastzero pushed a commit to lastzero/bldr that referenced this issue Feb 19, 2016
…ed for block install, update and autoload dump for issue bldr-io#149
cryptiklemur added a commit that referenced this issue Apr 13, 2016
* 'master' of github.com:bldr-io/bldr:
  Fixed bug introduced in PR #150 - the prefix "blocks-" was added for block install, update and autoload dump for issue #149
  Delete PostExecuteEventTest.php
  Update PreExecuteEventTest.php
  Update ParallelTask.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants