Shipwri...ngFlags(3)

πŸ“¦
version 2.4.42 Β· 2 versions
, in fedora 43

✨ NAME ✨

Shipwri...ngFlags β€” it's the Shipwright::Manual::UsingFlags page bestie, aka the one where we talk about using flags πŸ’… (yes it's a perl manual page, section 3, user-contributed perl docs, we're fancy like that πŸŽ€)


🌸 DESCRIPTION 🌸

okay so Shipwright flags is a whole method for making one single shipyard support multiple variants of vessels. one yard, many girlies. iconic. πŸ‘‘

imagine you wanna create a project that needs a database. you want to support several database types in the same shipyard, but you also want each built vessel to only support one type. (sometimes you literally have to pick just one because some dists get confused if you hand them more than one type β€” like for RT, you have to supply the database type when running ./configure.) no cap.

this is exactly the task you can use Shipwright flags for. slay.

say you want to support both mysql and postgresql, and you've already imported mysql, DBD::mysql, postgresql and DBD::Pg into the repository. step one: done, queen.

next step is marking dists with flags β€” let's use "mysql" and "postgresql" for this example:

$ shipwright flags -r ... mysql --set mysql
$ shipwright flags -r ... cpan-DBD-mysql --set mysql
$ shipwright flags -r ... postgresql --set postgresql
$ shipwright flags -r ... cpan-DBD-Pg --set postgresql
$ shipwright flags -r ... --mandatory --set mysql,postgresql db

flags data gets stored in shipwright/flags.yml πŸ’Ύ

when you're building, you can set --flags to mysql or postgresql and it'll install support for that database only. vibe check passed. βœ…

if a dist needs this info to configure itself (RT, looking at you πŸ‘€), you'll need to customize the build script β€” go read Shipwright::Manual::CustomizeBuild for how to do that, iykyk.

if no flags are specified during build, then both mysql and postgresql get installed to the vessel. which one RT picks to configure for? that's between RT and its build script honestly. 😭

and if necessary, you can also specify certain flags as mandatory. for example, you can say a database flag is mandatory β€” so if no flag labelled "db" is specified when you invoke the build script, the first one gets used as a default (mysql in this case) rather than the repository being built with no flags at all. this lets shipyards support different variants or versions of a program. very main character of them. πŸ¦‹

Note: 🫢 Shipwright will automatically add "default" to --flags, and if a dist has no flags set (i.e. it doesn't appear in shipwright/flags.yml), it gets given the "default" flag and will be installed by default. periodt.

🌈 SEE ALSO 🌈

  • Shipwright
  • Shipwright::Manual

πŸ’– AUTHORS πŸ’–

  • sunnavy <sunnavy@bestpractical.com> β€” the icon, the legend πŸ’…

Shipwright is Copyright 2007-2015 Best Practical Solutions, LLC. 🏒✨

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. πŸͺ


and that's the whole page bestie!! this little cutie lives in perl v5.42.0 and got its last glow-up on 2025-07-25 πŸ’– mwah, go build something gorgeous 🫢🌸

πŸ“¦ where this page comes from