Re: Bootstrap recipe for symfony/php-twig

2021-06-03 Thread Utkarsh Gupta
Hi Bryce,

This is awesome, very comprehensive. Whilst following it in the
container, I'm adding the missing bits so the third person can just
follow w/o running into any problems like I did.

On Thu, Jun 3, 2021 at 7:22 AM Bryce Harrington
 wrote:
>   - Step 0: Prerequisites
> + Enable proposed
> + sudo apt-get remove php*
>
>   - Step 1: Interim php-symfony-contracts
> dget -x 
> https://snapshot.debian.org/archive/debian/20191114T152956Z/pool/main/p/php-symfony-contracts/php-symfony-contracts_2.0.0-1.dsc
> cd php-symfony-contracts-2.0.0/
> install-build-deps
> DEB_BUILD_OPTIONS=nocheck debuild

Here, you need to ensure you have the right versions of
php-psr-{cache,container}.
sudo apt remove php-psr-cache php-psr-container
sudo apt install php-psr-container=1.0.0-2
sudo apt install php-psr-cache=1.0.1-2

Then the installation below will go smoothly.

> sudo dpkg -i ../php-symfony-cache-contracts_2.0.0-1_all.deb \
>  ../php-symfony-translation-contracts_2.0.0-1_all.deb

Make sure to install all the .debs produced, that is, the above two +
other 4, needed in step 2 below because symfony B-D on
php-symfony-contracts. If you don't install now, it'll run into
uninstallability issues. At the very least, you'll need
php-symfony-service-contracts, so at least have that for now.

>   - Step 2: Interim symfony
> 
> https://snapshot.debian.org/archive/debian/20191225T031557Z/pool/main/s/symfony/symfony_5.0.2-1.dsc

cd symfony-5.0.2/
sudo apt install php-symfony-event-dispatcher-contracts=1.1.10-2

> DEB_BUILD_OPTIONS=nocheck debuild

Ugh, you'll anyway run into a lot of dependency resolution problems
here. Simply skip that via:
DEB_BUILD_OPTIONS=nocheck debuild -d

> # 2a.  Get basic php-symfony bits in place
> sudo dpkg -i ../php-symfony-security-core_5.0.2-1_all.deb \
>  ../php-symfony-console_5.0.2-1_all.deb \
>  ../php-symfony-css-selector_5.0.2-1_all.deb \
>  ../php-symfony-mime_5.0.2-1_all.deb \
>  ../php-symfony-intl_5.0.2-1_all.deb \
>  ../php-symfony-yaml_5.0.2-1_all.deb \
>  ../php-symfony-http-foundation_5.0.2-1_all.deb \
>  ../php-symfony-phpunit-bridge_5.0.2-1_all.deb
> sudo dpkg -i ../php-symfony-event-dispatcher_5.0.2-1_all.deb

Bah, you'll run into dependency problems; simply run:
sudo apt --fix-broken install
This will upgrade only 1 of the php-symfony-cache's deb
(php-symfony-event-dispatcher-contracts) to 2.4.0-1ubuntu2 (in
-proposed).

> # 2b.  Install the symfony kernel
> sudo apt-get install php-psr-log
> sudo dpkg -i ../php-symfony-error-handler_5.0.2-1_all.deb \
>  ../php-symfony-var-dumper_5.0.2-1_all.deb \
>  ../php-symfony-http-kernel_5.0.2-1_all.deb
>
> # 2c.  Install symfony cache
> sudo dpkg -i ../php-symfony-var-exporter_5.0.2-1_all.deb \
>  ../php-symfony-cache_5.0.2-1_all.deb
>
> # 2d.  Install the symfony framework bundle
> sudo apt-get install php-psr-container=1.0.0-2 \
>  php-psr-cache=1.0.1-2 \
>  php-symfony-service-contracts=1.1.10-2
> sudo dpkg -i ../php-symfony-config_5.0.2-1_all.deb \
>  ../php-symfony-dependency-injection_5.0.2-1_all.deb \
>  ../php-symfony-filesystem_5.0.2-1_all.deb \
>  ../php-symfony-finder_5.0.2-1_all.deb \
>  ../php-symfony-routing_5.0.2-1_all.deb \
>  ../php-symfony-framework-bundle_5.0.2-1_all.deb
>
> # 2e.  Install php-twig's prereq's
> sudo apt-get install php-twig=2.14.3-1
> sudo dpkg -i ../php-symfony-twig-bundle_5.0.2-1_all.deb

Also needs its sister deb, ../php-symfony-twig-bridge_5.0.2-1_all.deb.
They go together.

>   - Step 3: Interim php-twig
> (Has already been uploaded to -proposed with needed changes, just needs 
> rebuilt)
> apt-get source php-twig

Was lazy to enable deb-src URIs in sources.list so:
dget -x 
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/php-twig/3.3.2-1ubuntu1/php-twig_3.3.2-1ubuntu1.dsc

> cd php-twig-3.3.2
> sudo apt-get install php-league-commonmark \
>  php-league-html-to-markdown \
>  php-lorenzo-pinky php-parsedown \
>  php-tijsverkoyen-css-to-inline-styles

sudo apt build-dep .

> debuild
> sudo dpkg -i ../php-twig_3.3.2-1ubuntu1_all.deb \
>  ../php-twig-inky-extra_3.3.2-1ubuntu1_all.deb \
>  ../php-twig-markdown-extra_3.3.2-1ubuntu1_all.deb \
>  ../php-twig-cssinliner-extra_3.3.2-1ubuntu1_all.deb
>
>   - Step 4: Interim php-doctrine-persistence
> dget -x 
> https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/php-doctrine-persistence/1.3.8-1/php-doctrine-persistence_1.3.8-1.dsc
> cd php-doctrine-persistence-1.3.8/
> sudo apt-get install php-doctrine-reflection

sudo apt b

Bootstrap recipe for symfony/php-twig

2021-06-02 Thread Bryce Harrington
Hi Utkarsh,

I've found a bootstrap path for resolving the circular build dependency
between php-twig and symfony.  Unfortunately, and as we suspected,
there's yet another build entanglement between symfony and doctrine.

Brace yourself.

Below is the steps I worked out today.  I had to go back and forth a
bunch to trial-and-error my way through, and likely have left some
errors in these directions.  Please run through the, correct my errors,
and see if you can press on ahead further than I got.


  - Step 0: Prerequisites
+ Enable proposed
+ sudo apt-get remove php*

  - Step 1: Interim php-symfony-contracts
dget -x 
https://snapshot.debian.org/archive/debian/20191114T152956Z/pool/main/p/php-symfony-contracts/php-symfony-contracts_2.0.0-1.dsc
cd php-symfony-contracts-2.0.0/
install-build-deps
DEB_BUILD_OPTIONS=nocheck debuild
sudo dpkg -i ../php-symfony-cache-contracts_2.0.0-1_all.deb \
 ../php-symfony-translation-contracts_2.0.0-1_all.deb

  - Step 2: Interim symfony

https://snapshot.debian.org/archive/debian/20191225T031557Z/pool/main/s/symfony/symfony_5.0.2-1.dsc
DEB_BUILD_OPTIONS=nocheck debuild
# 2a.  Get basic php-symfony bits in place
sudo dpkg -i ../php-symfony-security-core_5.0.2-1_all.deb \
 ../php-symfony-console_5.0.2-1_all.deb \
 ../php-symfony-css-selector_5.0.2-1_all.deb \
 ../php-symfony-mime_5.0.2-1_all.deb \
 ../php-symfony-intl_5.0.2-1_all.deb \
 ../php-symfony-yaml_5.0.2-1_all.deb \
 ../php-symfony-http-foundation_5.0.2-1_all.deb \
 ../php-symfony-phpunit-bridge_5.0.2-1_all.deb
sudo dpkg -i ../php-symfony-event-dispatcher_5.0.2-1_all.deb

# 2b.  Install the symfony kernel
sudo apt-get install php-psr-log
sudo dpkg -i ../php-symfony-error-handler_5.0.2-1_all.deb \
 ../php-symfony-var-dumper_5.0.2-1_all.deb \
 ../php-symfony-http-kernel_5.0.2-1_all.deb

# 2c.  Install symfony cache
sudo dpkg -i ../php-symfony-var-exporter_5.0.2-1_all.deb \
 ../php-symfony-cache_5.0.2-1_all.deb

# 2d.  Install the symfony framework bundle
sudo apt-get install php-psr-container=1.0.0-2 \
 php-psr-cache=1.0.1-2 \
 php-symfony-service-contracts=1.1.10-2
sudo dpkg -i ../php-symfony-config_5.0.2-1_all.deb \
 ../php-symfony-dependency-injection_5.0.2-1_all.deb \
 ../php-symfony-filesystem_5.0.2-1_all.deb \
 ../php-symfony-finder_5.0.2-1_all.deb \
 ../php-symfony-routing_5.0.2-1_all.deb \
 ../php-symfony-framework-bundle_5.0.2-1_all.deb

# 2e.  Install php-twig's prereq's
sudo apt-get install php-twig=2.14.3-1
sudo dpkg -i ../php-symfony-twig-bundle_5.0.2-1_all.deb

  - Step 3: Interim php-twig
(Has already been uploaded to -proposed with needed changes, just needs 
rebuilt)
apt-get source php-twig
cd php-twig-3.3.2
sudo apt-get install php-league-commonmark \
 php-league-html-to-markdown \
 php-lorenzo-pinky php-parsedown \
 php-tijsverkoyen-css-to-inline-styles
debuild
sudo dpkg -i ../php-twig_3.3.2-1ubuntu1_all.deb \
 ../php-twig-inky-extra_3.3.2-1ubuntu1_all.deb \
 ../php-twig-markdown-extra_3.3.2-1ubuntu1_all.deb \
 ../php-twig-cssinliner-extra_3.3.2-1ubuntu1_all.deb

  - Step 4: Interim php-doctrine-persistence
dget -x 
https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/php-doctrine-persistence/1.3.8-1/php-doctrine-persistence_1.3.8-1.dsc
cd php-doctrine-persistence-1.3.8/
sudo apt-get install php-doctrine-reflection
DEB_BUILD_OPTIONS=nocheck debuild
sudo dpkg -i ../php-doctrine-persistence_1.3.8-1_all.deb



### HERE BELOW BE YE DRAGONS ###


  - Step TBD: Maybe build more interim versions of symfony??
+ e.g. symfony (5.2.1+dfsg-1) or symfony (5.2.5+dfsg-1)
+ I don't see anything in the changelog that makes me feel that's a
  viable path, but if we can't get Step x (below) to work then it
  might be worth trying.

  - Step x: Build symfony 5.2.6
apt-get source symfony
cd symfony-5.2.6+dfsg/

# Install more prereqs from the interim symfony
sudo apt-get install php-doctrine-event-manager=1.1.1-1

sudo apt-get install \
 php-amqp php-apcu php-apcu-bc php-uuid php-gd \
 php-cache-integration-tests php-curl \
 php-guzzlehttp-promises php-http-httplug php-ldap \
 php-psr-http-client php-psr-link php-psr-simple-cache \
 php-masterminds-html5 php-memcached php-monolog php-nrk-predis \
 php-nyholm-psr7 php-pda-pheanstalk php-phpdbg \
 php-sqlite3

sudo apt-get install  php-symfony-polyfill-php80 \
 php-email-valida