-
Notifications
You must be signed in to change notification settings - Fork 110
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
Upgrade to Composer 2 #73
Comments
I think seperate builds is a bit overkill. |
Ok, I've started working on this. Turns out having both This wouldn't be a problem if we didn't ship Composer 1 with The "cleanest" solution I came up with was to wrap a custom executable around Composer 1 which sets the # Install Composer.
ENV PATH=$PATH:/root/composer2/vendor/bin:/root/composer1/vendor/bin \
COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME=/root/composer2 \
COMPOSER1_HOME=/root/composer1
RUN cd /opt \
# Download installer and check for its integrity.
&& curl -sSL https://getcomposer.org/installer > composer-setup.php \
&& curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \
&& sha384sum --check composer-setup.sha384sum \
# Install Composer 2 and expose `composer` as a symlink to it.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer2 --2 \
&& ln -s /usr/local/bin/composer2 /usr/local/bin/composer \
# Install Composer 1, make it point to a different `$COMPOSER_HOME` directory than Composer 2, install `hirak/prestissimo` plugin.
&& php composer-setup.php --install-dir=/usr/local/bin --filename=.composer1 --1 \
&& printf "#!/bin/sh\nCOMPOSER_HOME=\$COMPOSER1_HOME\nexec /usr/local/bin/.composer1 \$@" > /usr/local/bin/composer1 \
&& chmod 755 /usr/local/bin/composer1 \
&& composer1 global require hirak/prestissimo \
# Remove installer files.
&& rm /opt/composer-setup.php /opt/composer-setup.sha384sum Not actually something I would be proud of in 10 years from now, but sorta works. What do you think? |
LGTM |
Yep, but that's nice to add in any case, even if we would proceed with separate builds, as they would need to change the base image they build upon, and choose the one with Composer 1 instead. |
We could've kept the current tags for Composer 1 images and introduce new tags for Composer 2, but that would probably have required more work and the solution you submitted makes more sense to me. I'll add a note in the README. |
Composer 2 was released last week, this issue is for discussion about its adoption. See here for Composer 2 upgrade guide and possible breaking changes.
Current proposals (see #72 (comment)):
composer1
andcomposer2
, and create acomposer
symlink to the latterEither way, builds are currently failing because
hirak/prestissimo
is not compatible with composer 2, nor it is needed with it.The text was updated successfully, but these errors were encountered: