Write out manifest.in entries deterministically

Currently, the order of the entries in `manifest.in` depends on the
iteration order of `copy_with_callback`, which in turn depends on
`WalkDir`, which explicitly says iteration order is unspecified. It's
possible to call `WalkDir::sort_by` to give an iteration order for each
directory's entries, but it felt better to accumulate the lines and then
sort them to a) make it more evident that this is happening, and b)
enable the copying to be parallelized in the future.
1 file changed
tree: d45a0696337881689c1e7adaaad22a5a4f664ec4
  1. .github/
  2. src/
  3. test/
  4. .gitignore
  5. .gitmodules
  6. Cargo.toml
  7. combine-installers.sh
  8. gen-install-script.sh
  9. gen-installer.sh
  10. install-template.sh
  11. LICENSE-APACHE
  12. LICENSE-MIT
  13. make-tarballs.sh
  14. README.md
  15. rust-installer-version
  16. test.sh
  17. triagebot.toml
README.md

Build Status

A generator for the install.sh script commonly used to install Rust in Unix environments. It is used By Rust, Cargo, and is intended to be used by a future combined installer of Rust + Cargo.

Usage

./gen-installer.sh --product-name=Rust \
                   --rel-manifest-dir=rustlib \
                   --success-message=Rust-is-ready-to-roll. \
                   --image-dir=./install-image \
                   --work-dir=./temp \
                   --output-dir=./dist \
                   --non-installed-overlay=./overlay \
                   --package-name=rustc-nightly-i686-apple-darwin \
                   --component-name=rustc \
                   --legacy-manifest-dirs=rustlib \
                   --bulk-dirs=share/doc

Or, to just generate the script.

./gen-install-script.sh --product-name=Rust \
                        --rel-manifest-dir=rustlib \
                        --success-message=Rust-is-ready-to-roll. \
                        --output-script=install.sh \
                        --legacy-manifest-dirs=rustlib

Note: the dashes in success-message are converted to spaces. The script's argument handling is broken with spaces.

To combine installers.

./combine-installers.sh --product-name=Rust \
                        --rel-manifest-dir=rustlib \
                        --success-message=Rust-is-ready-to-roll. \
                        --work-dir=./temp \
                        --output-dir=./dist \
                        --non-installed-overlay=./overlay \
                        --package-name=rustc-nightly-i686-apple-darwin \
                        --legacy-manifest-dirs=rustlib \
                        --input-tarballs=./rustc.tar.gz,cargo.tar.gz

Future work

  • Make install.sh not have to be customized, pull it's data from a config file.
  • Be more resiliant to installation failures, particularly if the disk is full.
  • Pre-install and post-uninstall scripts.
  • Allow components to depend on or contradict other components.
  • Sanity check that expected destination dirs (bin, lib, share exist)?
  • Add --docdir flag. Is there a standard name for this?
  • Remove empty directories on uninstall.
  • Detect mismatches in --prefix, --mandir, etc. in follow-on installs/uninstalls.
  • Fix argument handling for spaces.
  • Add --bindir.

License

This software is distributed under the terms of both the MIT license and/or the Apache License (Version 2.0), at your option.

See LICENSE-APACHE, LICENSE-MIT for details.