Giter Site home page Giter Site logo

Comments (15)

glensc avatar glensc commented on June 29, 2024

Here are more packages that just disappear from the namespace map:

--- vendor1/composer/autoload_namespaces.php    2019-12-17 12:19:33.000000000 +0200
+++ vendor/composer/autoload_namespaces.php    2019-12-17 12:45:50.000000000 +0200
@@ -6,24 +6,16 @@
 $baseDir = dirname($vendorDir);

 return array(
-    'phpDocumentor' => array($vendorDir . '/phpdocumentor/reflection-docblock/src'),
     'cogpowered\\FineDiff' => array($vendorDir . '/cogpowered/finediff/src'),
-    'Zend_Xml' => array($vendorDir . '/zf1s/zend-xml/library'),
     'Zend_Wildfire' => array($vendorDir . '/zf1s/zend-wildfire/library'),
     'Zend_View' => array($vendorDir . '/zf1s/zend-view/library'),
-    'Zend_Version' => array($vendorDir . '/zf1s/zend-version/library'),
     'Zend_Validate' => array($vendorDir . '/zf1s/zend-validate/library'),
-    'Zend_Uri' => array($vendorDir . '/zf1s/zend-uri/library'),
     'Zend_Soap' => array($vendorDir . '/zf1s/zend-soap/library'),
     'Zend_Session' => array($vendorDir . '/zf1s/zend-session/library'),
-    'Zend_Server' => array($vendorDir . '/zf1s/zend-server/library'),
     'Zend_Registry' => array($vendorDir . '/zf1s/zend-registry/library'),
     'Zend_Paginator' => array($vendorDir . '/zf1s/zend-paginator/library'),
-    'Zend_Mime' => array($vendorDir . '/zf1s/zend-mime/library'),
     'Zend_Mail' => array($vendorDir . '/zf1s/zend-mail/library'),
     'Zend_Log' => array($vendorDir . '/zf1s/zend-log/library'),
-    'Zend_Locale' => array($vendorDir . '/zf1s/zend-locale/library'),
-    'Zend_Loader' => array($vendorDir . '/zf1s/zend-loader/library'),
     'Zend_Layout' => array($vendorDir . '/zf1s/zend-layout/library'),
     'Zend_Json' => array($vendorDir . '/zf1s/zend-json/library'),
     'Zend_Http' => array($vendorDir . '/zf1s/zend-http/library'),
@@ -33,10 +25,8 @@
     'Zend_Feed' => array($vendorDir . '/zf1s/zend-feed/library'),
     'Zend_Exception' => array($vendorDir . '/zf1s/zend-exception/library'),
     'Zend_Db' => array($vendorDir . '/zf1s/zend-db/library'),
-    'Zend_Crypt' => array($vendorDir . '/zf1s/zend-crypt/library'),
     'Zend_Controller' => array($vendorDir . '/zf1s/zend-controller/library'),
     'Zend_Config' => array($vendorDir . '/zf1s/zend-config/library'),
-    'Zend_Cache' => array($vendorDir . '/zf1s/zend-cache/library'),
     'Zend_Acl' => array($vendorDir . '/zf1s/zend-acl/library'),
     'Xhgui_' => array($vendorDir . '/perftools/xhgui-collector/src'),
     'Pimple' => array($vendorDir . '/pimple/pimple/src'),
(END)

from zf1.

glensc avatar glensc commented on June 29, 2024

downgrading to 1.13.0 fixes this.

I'm pretty sure it's from any of the strict string comparisons changes from
#16

cc @Megatherium @falkenhawk

from zf1.

falkenhawk avatar falkenhawk commented on June 29, 2024

I wonder how upgrading the zf1s vendors would remove that big bunch of dependencies from your autoloader (even including phpDocumentor thing) - interdependencies of packages have not changed between 1.13.0 and 1.13.1. Also I can't see how string comparisons would affect composer's autoloader... Could you share what steps you performed to update your project's zf1s deps to 1.13.1, please?

from zf1.

glensc avatar glensc commented on June 29, 2024

I'm very puzzled myself too, but it's reproducible in a proprietary project.

my upgrade process was just updating all dependencies and commit lock, skipping package.json changes.

composer show --format json  > deps2.json
cat deps2.json | jq -r '.installed[].name + ":1.13.1" '| grep zf1 | xargs composer require

I'm trying to build gist with reproducer, so far no success.

from zf1.

glensc avatar glensc commented on June 29, 2024

phpDocumenter gone missing is expected, it's require-dev dependency

from zf1.

glensc avatar glensc commented on June 29, 2024

FWIW, I have zf1 namespace in root package.json, and also in one dependant package dependencies.

I've double-checked and vendor/zf1 is empty, i.e no zf1 packages present.

from zf1.

falkenhawk avatar falkenhawk commented on June 29, 2024

I suspect you might have seen a lot of errors while composer tried to require a pinpointed 1.13.1 version of a package while having others still at 1.13.0 - and could not install both versions at the same time. Wouldn't switching to ^1.13 in your composer.json, then running simply composer update "zf1s/*" work just fine?

from zf1.

glensc avatar glensc commented on June 29, 2024

alright, reproduced:

git clone -b v1 https://gist.github.com/glensc/3bcf4c1a4406ac730ea574e3fb2ebc68 zf1s-17
cd zf1s-17
composer install --no-dev
php test.php

from zf1.

glensc avatar glensc commented on June 29, 2024

I have all packages installed from zf1s 1.13.1 in vendor dir, verified that, and no packages from zf1 namespace.

and if composer.lock is present, then composer install will use only that, no matter what is in composer.json.

it does print a warning if it detects out of sync, but that's only printed to screen, no actions.

from zf1.

glensc avatar glensc commented on June 29, 2024

update: it's broken with 1.13.0 as well, tested incorrectly with --dev previously

from zf1.

glensc avatar glensc commented on June 29, 2024

I think it's a composer bug, or we're using "replaces" incorrectly in this project.

I can work around the broken autoloader with:

composer install --no-dev
composer dump

@falkenhawk: were you able to reproduce yourself using my gist?

from zf1.

falkenhawk avatar falkenhawk commented on June 29, 2024

@glensc I am not sure what exactly you are trying to accomplish here. Your composer.lock is not in sync with what's in composer.json (did you somehow force it to be generated that way?). I think I've already pointed you in a different thread that you should either switch to zf1s in composer.json if you want to use it, or just stick with zf1 if you prefer, but that is out of scope of this repo. The latest release version of zf1 packages is 1.12.20. (and I am still not sure if you expect the zf1 or zf1s in your vendor dir)
Take a look what happens if you rm -rf ./composer.lock ./vendor and composer install --no-dev.

Package operations: 25 installs, 0 updates, 0 removals
  - Installing zf1/zend-exception (1.12.20): Downloading (100%)
  - Installing zf1/zend-acl (1.12.20): Downloading (100%)
  - Installing zf1/zend-loader (1.12.20): Downloading (100%)
  - Installing zf1/zend-xml (1.12.20): Downloading (100%)
  - Installing zf1/zend-server (1.12.20): Downloading (100%)
  - Installing zf1/zend-json (1.12.20): Downloading (100%)
  - Installing zf1/zend-registry (1.12.20): Downloading (100%)
  - Installing zf1/zend-cache (1.12.20): Downloading (100%)
  - Installing zf1/zend-locale (1.12.20): Downloading (100%)
  - Installing zf1/zend-controller (1.12.20): Downloading (100%)
  - Installing zf1/zend-view (1.12.20): Downloading (100%)
  - Installing zf1/zend-validate (1.12.20): Downloading (100%)
  - Installing zf1/zend-uri (1.12.20): Downloading (100%)
  - Installing zf1/zend-config (1.12.20): Downloading (100%)
  - Installing zf1/zend-wildfire (1.12.20): Downloading (100%)
  - Installing zf1/zend-soap (1.12.20): Downloading (100%)
  - Installing zf1/zend-session (1.12.20): Downloading (100%)
  - Installing zf1/zend-paginator (1.12.20): Downloading (100%)
  - Installing zf1/zend-log (1.12.20): Downloading (100%)
  - Installing zf1/zend-layout (1.12.20): Downloading (100%)
  - Installing zf1/zend-http (1.12.20): Downloading (100%)
  - Installing zf1/zend-filter (1.12.20): Downloading (100%)
  - Installing zf1/zend-file-transfer (1.12.20): Downloading (100%)
  - Installing zf1/zend-db (1.12.20): Downloading (100%)
  - Installing zf1/zend-file (1.12.20): Downloading (100%)
Writing lock file
Generating autoload files

Then replace your composer.json with

{
    "name": "glen/t",
    "require": {
        "zf1s/zend-acl": "^1.13",
        "zf1s/zend-config": "^1.13",
        "zf1s/zend-controller": "^1.13",
        "zf1s/zend-db": "^1.13",
        "zf1s/zend-file": "^1.13",
        "zf1s/zend-file-transfer": "^1.13",
        "zf1s/zend-filter": "^1.13",
        "zf1s/zend-http": "^1.13",
        "zf1s/zend-json": "^1.13",
        "zf1s/zend-layout": "^1.13",
        "zf1s/zend-log": "^1.13",
        "zf1s/zend-paginator": "^1.13",
        "zf1s/zend-registry": "^1.13",
        "zf1s/zend-session": "^1.13",
        "zf1s/zend-soap": "^1.13",
        "zf1s/zend-view": "^1.13",
        "zf1s/zend-wildfire": "^1.13"
    }
}

and try rm -rf ./composer.lock ./vendor && composer install --no-dev and compare the results.

from zf1.

glensc avatar glensc commented on June 29, 2024

@falkenhawk I'm trying to use zf1s packages via composer.lock.

vendor/zf1s exists, vendor/zf1 is missing, that part works fine.

can't switch (yet) to zf1 namespace in package.json, as too many projects need updating which have not yet switched to the new namespace. and replace is supposed to work here.

from zf1.

falkenhawk avatar falkenhawk commented on June 29, 2024

I'm afraid composer's replace feature does not work the way you expect. Even if you replaced all your requires with "zf1/zend-acl": "~1.13" then composer would not know that it should look for zf1s instead:

  Problem 1
    - The requested package zf1/zend-acl ~1.13 exists as zf1/zend-acl[1.12.10, 1.12.11, 1.12.12, 1.12.13, 1.12.14, 1.12.15, 1.12.16, 1.12.17, 1.12.18, 1.12.19, 1.12.20, 1.12.3, 1.12.4, 1.12.5, 1.12.6, 1.12.7, 1.12.8, 1.12.9, dev-master] but these are rejected by your constraint.

which is fine, otherwise it would be trivial to "take over" any package by anyone on packagist, don't you think... but on the other hand if you updated your deps to zf1s then it would be all fine.

replace only means that if you already have zf1 in your vendors, new zf1s would take precedence for installation, but only if it can find compatible versions. Since zf1s require the same versions of each own interdependencies, composer won't be able to resolve an installable set of packages from zf1 1.12.20 and zf1s 1.13+ anyway.

I am afraid I don't have enough insight to understand your use case where you cannot update your package.json for zf1s, and I am not able support you further in this.

from zf1.

glensc avatar glensc commented on June 29, 2024

@falkenhawk I'm looking at this way (with the given gist): no zf1 package is present in vendor/, every package that comes via zf1 namespace (root or dependent package) is replaced with matching zf1s package that is recorded in vendor lock.

I've created issue in composer repository, I believe the problem is there:

from zf1.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.