-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exported constant management process is cumbersome #313
Comments
There's also additional requirement introduced by OpenSSL 3.0.0: the return values of SSL_CTX_set_options family of functions now return an The help script now uses |
Exported libssl/libcrypto constants are currently managed using helper_script/regen_openssl_constants.pl, which still involves following a lot of cumbersome and error-prone manual steps. See radiator-software#313 for a detailed discussion of the problems with this script. Fully automate the constant management process with a new script, helper_script/update-exported-constants, which reads a list of libssl/libcrypto constants from constants.txt and automatically generates or updates the necessary files in the repository. Make the following changes to accommodate the new script: * Remove invocations of regen_openssl_constants.pl from the Makefile, but don't replace them with invocations of update-exported-constants: the new script is intended to be run as part of a commit that adds or removes constants, and should not need to be run by end users of the module. * In lib/Net/SSLeay.pm, split the list of exportable symbols into two categories, defined in separate arrays: one for constants (which is automatically updated when update-exported-constants runs), and one for functions (which will continue to be managed manually). * In lib/Net/SSLeay.pod, signpost the location of the code block containing the constants list by surrounding it with Pod comments; the Pod between these comments is automatically updated when update-exported-constants runs. Closes radiator-software#313.
This is definitely something we need to think about. Since we won't be in a worse position than we already are by having a helper script that assumes all constants are doubles, I've opened another issue (#315) so we can fix this separately. |
Since 2012, the list of libssl/libcrypto constants exported by Net::SSLeay has been managed using
helper_script/regen_openssl_constants.pl
. There are numerous problems with this approach:-gen-t
option involves writing the generated test tot/local/20_autoload.t
, which historically didn't exhaustively test constant loading and has since been overwritten (this presumably directly led to t/local/20_autoload.t doesn't perform any unique autoloading tests #311).const_list_3columns
to get it to do this).@EXPORT_OK
inlib/Net/SSLeay.pm
makes it almost impossible to tell which constants have been added or removed in a commit, because every line changes. It also leads to an overall larger file size forlib/Net/SSLeay.pm
than having one constant per line, because formatting each constant requires on average more than the 5 bytes it would take to indent each constant individually.constants.c
, the test file and the list of constants forlib/Net/SSLeay.pod
, and the script prompts the user to manually edit@EXPORT_OK
inlib/Net/SSLeay.pm
(which also contains non-constant exports). This has led to inconsistencies between the four files because of the lack of clarity in the instructions; e.g., inlib/Net/SSLeay.pm
the OCSP constants are listed separately from the rest of the constants for no apparent reason.We'd benefit from a script that does for constant management what
helper_script/generate-test-pki
does for the PKI used by the test suite: something that consumes an exported constants list from a separate file, and automatically generates or updates all files in the repository that need to be changed as a result of that file changing. The Net::SSLeay code and documentation will be clearer, the purpose of commits will be more obvious, and there'll be fewer opportunities to make mistakes when adding or removing constants.The text was updated successfully, but these errors were encountered: