client/container: root: refactor common namespace, add tests for common #243

Merged
AaronFiore merged 0 commits from refs/pull/243/head into master 2025-11-19 21:42:53 +00:00
AaronFiore commented 2025-11-19 05:24:55 +00:00 (Migrated from gitea.com)

Description

  • Factor out respective common from macro and apply to all scopes

    • dfi::common
    • dfi::macro::common
    • dfi::plugin::common
  • Add deprecation warnings in dfi::macro::common

    • Common functionality (not macro specific) is now in dfi::common
  • Add convenience wrappers to inner common impl, where appropriate

    • Allows for backwards compatibility
  • Add/update/clarify code docs and Doxygen definitions

  • Related refactoring

  • Add tests for common

NOTE: all changes are backward compatible (no need to bump major).

Agreement

### Description - Factor out respective common from macro and apply to all scopes * `dfi::common` * `dfi::macro::common` * `dfi::plugin::common` - Add deprecation warnings in `dfi::macro::common` * Common functionality (not macro specific) is now in `dfi::common` - Add convenience wrappers to inner common impl, where appropriate * Allows for backwards compatibility - Add/update/clarify code docs and Doxygen definitions - Related refactoring - Add tests for common NOTE: all changes are backward compatible (no need to bump major). ### Agreement - [x] I have read and understood the [Development](https://gitea.com/EvergreenCrypto/docker-finance#development) and [License](https://gitea.com/EvergreenCrypto/docker-finance#license-and-disclaimer) documentation
AaronFiore commented 2025-11-19 21:36:31 +00:00 (Migrated from gitea.com)

All tests pass. Do note though that test output will show intentional interpreter build errors:

[----------] 2 tests from CommonRawFiles                                                                                                                                   
[ RUN      ] CommonRawFiles.RawLoadSingle                                                                                                                                  
input_line_22:2:2: error: unknown type name 'my_foo'                                                                                                                       
 my_foo foo;                                                                                                                                                               
 ^                                                                                                                                                                         
Interpreting: '.L /tmp/fileEGsKci'                                                                                                                                         
[       OK ] CommonRawFiles.RawLoadSingle (4 ms)                                                                                                                           
[ RUN      ] CommonRawFiles.RawLoadMultiple                                                                                                                                
input_line_25:2:2: error: unknown type name 'my_bar'                                                                                                                       
 my_bar bar;                                                                         
 ^                                                                                                                                                                         
Interpreting: '.L /tmp/fileI2qOxX'                                                                                                                                         
Interpreting: '.L /tmp/file0z5qfQ'                                                                                                                                         
[       OK ] CommonRawFiles.RawLoadMultiple (1 ms)                                                                                                                         
[----------] 2 tests from CommonRawFiles (5 ms total)                                                                                                                      
                                                                                     
[----------] 2 tests from CommonRepoFiles                                            
[ RUN      ] CommonRepoFiles.MacroLoad                                               
input_line_29:2:22: error: 'crypto' is not a class, namespace, or enumeration        
 dfi::macro::common::crypto::botan::Hash h;                          
                     ^                                                               
input_line_29:2:22: note: 'crypto' declared here                     
Interpreting: '.L crypto/hash.C'                                                     
[       OK ] CommonRepoFiles.MacroLoad (91 ms)                                     
[ RUN      ] CommonRepoFiles.PluginLoad                                                                                                                                    
input_line_32:2:15: error: 'my_plugin_namespace' is not a class, namespace, or enumeration                                                                                 
 dfi::plugin::my_plugin_namespace::example2();                                                                                                                             
              ^                                                                                                                                                            
input_line_32:2:15: note: 'my_plugin_namespace' declared here                                                                                                              
Interpreting: '.L /home/business/docker-finance/plugins/root/example.cc'
All tests pass. Do note though that test output will show **intentional** interpreter build errors: ```bash [----------] 2 tests from CommonRawFiles [ RUN ] CommonRawFiles.RawLoadSingle input_line_22:2:2: error: unknown type name 'my_foo' my_foo foo; ^ Interpreting: '.L /tmp/fileEGsKci' [ OK ] CommonRawFiles.RawLoadSingle (4 ms) [ RUN ] CommonRawFiles.RawLoadMultiple input_line_25:2:2: error: unknown type name 'my_bar' my_bar bar; ^ Interpreting: '.L /tmp/fileI2qOxX' Interpreting: '.L /tmp/file0z5qfQ' [ OK ] CommonRawFiles.RawLoadMultiple (1 ms) [----------] 2 tests from CommonRawFiles (5 ms total) [----------] 2 tests from CommonRepoFiles [ RUN ] CommonRepoFiles.MacroLoad input_line_29:2:22: error: 'crypto' is not a class, namespace, or enumeration dfi::macro::common::crypto::botan::Hash h; ^ input_line_29:2:22: note: 'crypto' declared here Interpreting: '.L crypto/hash.C' [ OK ] CommonRepoFiles.MacroLoad (91 ms) [ RUN ] CommonRepoFiles.PluginLoad input_line_32:2:15: error: 'my_plugin_namespace' is not a class, namespace, or enumeration dfi::plugin::my_plugin_namespace::example2(); ^ input_line_32:2:15: note: 'my_plugin_namespace' declared here Interpreting: '.L /home/business/docker-finance/plugins/root/example.cc' ```
AaronFiore commented 2025-11-19 21:41:33 +00:00 (Migrated from gitea.com)

Also note that dfi::plugin::load("...") will still tab complete to the current directory and not repo/ or custom/ at this time.

Is it possible to change interpreter environment for this edge-case? I don't know, TBD.

Also note that `dfi::plugin::load("...")` will still tab complete to the current directory and not `repo/` or `custom/` at this time. Is it possible to change interpreter environment for this edge-case? I don't know, TBD.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Reference: EvergreenCrypto/docker-finance#243