If that is produced in one place, its easy for HomeBrew / Scoop and our scripted installed to provide a ruby-standalone or full-fat cli experience.
Ideally we could use Rust going forward as a way to provide a directory to install all the cli tooling, the pact-plugin-cli provides a nice template for that.
Could a pact-cli command in Rust, abstract away the rubyisms behind, so a pact-cli broker command feels natural and the fact it is ruby or rust in the backend is a moot point.
For tools there are duplicated in rust/ruby, we could provide an abstraction through a single command (rather than having two) and use a switch --legacy or PACT_USE_LEGACY=1 env var to switch between either the rust or the ruby impl.
augmentations, which seek to trim out as much as possible from the ruby runtime.
Note:- the slim versions may not work and need throughly testing, cursory testing has been
done so far.
The overall aim is provide users with a single bundled distribution called pact-cli
which contains every single pact executable so the users can get all the pact goodness at their
fingertips.
This will have benefits for packaging with HomeBrew/Scoop/Choco and our own install script.
In the future it would be nice to extend pact-plugin-cli which can discover and install plugins
to discover all of the pact tooling (official and community provided) and provide a mechanism to install
to a shared location such as PACT_HOME_DIR which would default to $HOME/.pact
This pattern is already in use in the pact-plugin-cli
Could we further this, so users only need the standalone in a single location, and the ffi libs in a single location, and our various client libraries to point to the relevant home folder, and not require the packages to contain the host libraries themselves. This may not be practical for some libs which need to build from source, but if the source was already on their machine, via our installer, maybe that makes it less of an issue.
The tree of all tools would currently look like this
Initial thoughts
Looking at the size of the pact-plugin-cli executable (11mb) I am inclined to suggest we seperate out and publish two sets of packages
If that is produced in one place, its easy for HomeBrew / Scoop and our scripted installed to provide a ruby-standalone or full-fat cli experience.
Ideally we could use Rust going forward as a way to provide a directory to install all the cli tooling, the
pact-plugin-cli
provides a nice template for that.Could a
pact-cli
command in Rust, abstract away the rubyisms behind, so apact-cli broker
command feels natural and the fact it is ruby or rust in the backend is a moot point.For tools there are duplicated in rust/ruby, we could provide an abstraction through a single command (rather than having two) and use a switch
--legacy
orPACT_USE_LEGACY=1
env var to switch between either the rust or the ruby impl.Brain dump
The pact-ruby-standalone project recently added the pact-plugin-cli to the bundle
This weighs in at 12Mb and hugely inflates our bundle.
This proposal suggests a couple of different packages
for any of the combinations above, they can have
augmentations, which seek to trim out as much as possible from the ruby runtime.
Note:- the slim versions may not work and need throughly testing, cursory testing has been done so far.
The overall aim is provide users with a single bundled distribution called pact-cli
which contains every single pact executable so the users can get all the pact goodness at their fingertips.
This will have benefits for packaging with HomeBrew/Scoop/Choco and our own install script.
In the future it would be nice to extend pact-plugin-cli which can discover and install plugins
to discover all of the pact tooling (official and community provided) and provide a mechanism to install
to a shared location such as PACT_HOME_DIR which would default to $HOME/.pact
This pattern is already in use in the pact-plugin-cli
Could we further this, so users only need the standalone in a single location, and the ffi libs in a single location, and our various client libraries to point to the relevant home folder, and not require the packages to contain the host libraries themselves. This may not be practical for some libs which need to build from source, but if the source was already on their machine, via our installer, maybe that makes it less of an issue.
The tree of all tools would currently look like this
Users would be able to interact with the FFI by
Package sizes
Full Ruby Bundle - with pact-plugin-cli
As per todays release.
Full Ruby (only) Bundle
Trimmed Ruby (only) Bundle
TRIM_PACKAGE_FULL=true bundle exec rake package
Full Ruby Bundle + Pact Rust Tools
PACKAGE_PACT_RUST_TOOLS=true bundle exec rake package
Ruby (only) + Pact-Ffi Gem (and pact_ffi libs) Bundle
PACKAGE_PACT_FFI=true bundle exec rake package
Full Ruby Bundle + Pact Rust Tools + Pact-Ffi Gem (and pact_ffi libs)
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true bundle exec rake package
Building & Testing.
You can easily run through the testing by passing the same env vars.
The following scenario will
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true bundle exec rake package:osx:arm64
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true PACKAGE_NAME=pact-cli ./script/unpack-and-test.sh
You can run the smoke tests anyway, your standalone directory lives.
/script/test.sh
PATH_TO_BIN=pkg/pact-cli/bin/
default is$PACKAGE_NAME/bin/
ensure it has a trailing /
\
PACKAGE_NAME
default ispact
Example scenario
PACKAGE_PACT_RUST_TOOLS=true PACKAGE_PACT_FFI=true PACKAGE_NAME=pact-cli PATH_TO_BIN=pkg/pact-cli/bin/ ./script/test.sh