Skip to content

Symlink not created #82

@Arcesilas

Description

@Arcesilas

Hi,

Note: between each try, I've cleared composer cache.

Here's what I have done:

Ran studio load ../dot-array:

$ cat studio.json
{
    "version": 2,
    "paths": [
        "../dot-array/"
    ]
}

In my composer.json, I have:

    "require": {
        "arcesilas/dot-array": "^1.0"
    }

Which is ok with the package in ../dot-array (excerpt):

$ cat ../dot-array/composer.json
{
    "name": "arcesilas/dot-array",
    "description": "Dot notation for arrays",
    "type": "library",

Then, run installing dependencies:

$ composer update
[Studio] Loading path ../dot-array/
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing arcesilas/dot-array (v1.0.0): Downloading (100%)         
Writing lock file
Generating autoload files

The package is downloaded from packagist, since it's published on it.

Running composer with debug verbose (with relevant information):

[Studio] Loading path ../dot-array/
Loading composer repositories with package information
Executing command (/home/olivier/dev/arcesilas/dot-array/): git branch --no-color --no-abbrev -v
Executing command (/home/olivier/dev/arcesilas/dot-array/): git log -n1 --pretty=%H
Downloading https://packagist.org/packages.json

If I run the git commands in the ../dot-array directory:

✔ [dot-array] [master L|✔] 
13:04 $ git branch --no-color --no-abbrev -v
  develop 9883fcd487798648cb995ec503d0167fa0742f11 First release
* master  9883fcd487798648cb995ec503d0167fa0742f11 First release
✔ [dot-array] [master L|✔] 
13:04 $ git log -n1 --pretty=%H
9883fcd487798648cb995ec503d0167fa0742f11

I understand it's not really a Studio problem: Composer does not try to find the tag I require (1.0.0), which yet exists:

✔ [dot-array] [master L|✔] 
13:04 $ git tag
v1.0.0

If I change my composer.json configuration:

    "require": {
        "arcesilas/dot-array": "dev-master"
    },
    "minimum-stability": "dev",
    "prefer-stable": true

Then it works:

Installs: arcesilas/dot-array:dev-master
  - Installing arcesilas/dot-array (dev-master): Symlinking from ../dot-array
    REASON: Required by the root package: Install command rule (install arcesilas/dot-array dev-master|install arcesilas/dot-array dev-master)

Is there a bug in Studio that make it no hook where it should? Why is my package symlinked only if I specify a dev version? Btw, the dev version is also available through Composer/Packagist, therefore, I don't understand the difference Composer does between a stable and a dev version...

I've also tried to specify the directory as a path repository in composer.json:

    "repositories": [
        {
            "type": "path",
            "url": "/path/to/dot-array"
        }
    ]

Also tried with

options: {
    "symlink": true
}

Symlink is created only when specifying a dev version.

I understand the problem may not be related to Studio (I'm not sure). Is there a way Studio can make Composer actually use the local path and symlink even when we don't specify a dev version?

EDIT: I've opened an issue on Composer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions