Hi Guix!
I've just managed to bootstrap the node-tape package using some of the
helpers I introduced in 68941 (WIP).

I want to use and reproduce the method I applied for phpunit in 67092,
but it's a long method and I haven't had any input on it before now, so
I'd like to at least validate the method before reproducing it.

It consists in the following :
- defining packages in an alphabetical order, in their final form (so
  using native-inputs that might not exist yet).
- defining those potentially missing native inputs in a recursive way
  using package inheritance, by disabling tests and emptying
  native-inputs for all inputs. In the case of PHP, this only includes
  the PHPunit package, in patch 95 of 67092. In the case of node, I'll
  probably need to do that on several packages (tape, tap, typescript at
  least).

There are some upsides compared to an approach where we explicitely
define ...-bootstrap packages :
- way less code
- way more clarity about how the package is actually being bootstrapped.
- we don't have to define packages twice, and that matters for
PHP/Rust/JS where we have hundreds of packages for bootstrapping basic
test native-inputs.

But there are also big downsides :
- stability in time : I don't have much worry due to centralization
  logic in PHP, not too much either for Rust, but in JS, bootstrapped
  packages for tape might gain typescript as an input, making regular
  headaches about how to bootstrap from there, if not using pinned
  versions.
- computationally more intensive : updating a package could often mean
  rebuilding the whole bootstrap chain. This is also the case for
  unpinned inheriting ...-bootstrap packages.

I've actually done a lot of bootstrapping with a more traditionnal
approach with ...-bootstrap packages while working on the
antioxidant/rust build-system and that is quite cumbersome.

WDYT? Are there guidelines somewhere about how to do proper
bootstrapping in these cases where hundreds of packages are involved?

The actual inputs for PHPunit (patch 95 of 67092) :

(inputs
 (letrec* ((package-list
            (list php-sebastian-version
                  php-sebastian-type
                  php-sebastian-cli-parser
                  php-sebastian-recursion-context
                  php-sebastian-resource-operations
                  php-sebastian-object-enumerator
                  php-sebastian-global-state
                  php-sebastian-exporter
                  php-sebastian-environment
                  php-sebastian-diff
                  php-sebastian-comparator
                  php-sebastian-code-unit
                  php-phpunit-php-timer
                  php-phpunit-php-text-template
                  php-phpunit-php-invoker
                  php-phpunit-php-file-iterator
                  php-phpunit-php-code-coverage
                  php-phpspec-prophecy
                  php-phar-io-version
                  php-phar-io-manifest
                  php-myclabs-deep-copy
                  php-doctrine-instantiator))
           (rewrite
            (lambda (p)
              (package
                (inherit p)
                (arguments '(#:tests? #f))
                (native-inputs '())
                (inputs (map (compose rewrite cadr) (package-inputs p)))))))
   (map rewrite package-list)))


-- 
Best regards,
Nicolas Graves

  • Guidelines for bo... Development of GNU Guix and the GNU System distribution.

Reply via email to