Open JP-Ellis opened 2 months ago
Looks good to me. I assume for most implementors of client languages, this will be handled by the FFI, and other consumers would be the rust and ruby suite of CLI tools?
Updated the RFC with a few changes:
When updating these, I also identified a gap in the way the TOML configuration ought to handle paths. So I have added a subsection to the configuration section to make this clear.
This RFC has been open for a while, and has received little additional feedback for a while, with the general consensus so far being in favour of this change.
I have a partial implementation working privately, which I will spin out into a dedicated Rust crate once this RFC is merged.
I am making some suggestions below, and therefore would like to leave this open for at least another 2-3 weeks to give everyone the opportunity to give more feedback.
I would like to take this opportunity to add a standard location for the Pact library (should we use dynamic linking). Some discussion was started in this conversation.
I think this RFC should be amended with the following change:
A new optional section will be added to the config containing two values:
[pact.ffi]
include_path = "..."
lib_path = "..."
These values can also be set through the environment variables
PACT_FFI_INCLUDE_PATH
PACT_FFI_LIBRARY_PATH
Should they be unset, they should default to:
$PACT_DATA_HOME/include
and $PACT_DATA_HOME/lib
C_INCLUDE_PATH
and LIBRARY_PATH
and/or LD_LIBRARY_PATH
respectively).Support for multiple paths is allowed by using a colon-separated environment variable, or using a list in TOML. If multiple paths are specified, then each path is tried in order.
One last thing while re-reading the RFC that I noticed is that there is little consistency between _path
or _home
or _dir
; or using _file
or not.
The only precedent we have at the moment in the Pact ecosystem is the PACT_PLUGIN_DIR
environment variable.
Here are my thoughts:
_FILE
to avoid confusion with a directory or an option._DIR
or _DIRECTORY
to avoid confusion with a file or an option_PATH
This follows my experience with environment variables from using other tools on Linux/Unix. This change would change the PACT_DATA_HOME
environment variable to PACT_DATA_DIR
for example.
Please let me know if you think this is something worth adding to the RFC, or whether this is an unnecessary complication.
RFC proposal to try and standardise the way we configure and share files across the Pact ecosystem.
Rendered view can be found here.
Excerpt from the RFC: