[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-11-14 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17443322#comment-17443322
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek merged pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.19.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-11-14 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17443321#comment-17443321
 ] 

ASF subversion and git services commented on DISPATCH-836:
--

Commit 138d084d7a0d9dbeed2991ac8f669563be68 in qpid-dispatch's branch 
refs/heads/main from Jiri Daněk
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=138d084 ]

DISPATCH-836 Add a .c file for every (non-private) include file (#1211)



> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.19.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-11-14 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17443316#comment-17443316
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on a change in pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211#discussion_r748840934



##
File path: include/qpid/dispatch/address_lookup_utils.h
##
@@ -1,5 +1,5 @@
-#ifndef router_core_address_lookup_server_h
-#define router_core_address_lookup__server_h 1

Review comment:
   I haven't noticed the typo in include guard before




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.19.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-11-14 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17443315#comment-17443315
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on a change in pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211#discussion_r748840850



##
File path: src/CMakeLists.txt
##
@@ -101,25 +111,28 @@ set(qpid_dispatch_SOURCES
   router_core/terminus.c
   router_core/transfer.c
   router_core/core_timer.c
+  router_core/module.c
   router_core/modules/edge_router/module.c
   router_core/modules/edge_router/addr_proxy.c
   router_core/modules/edge_router/connection_manager.c
   router_core/modules/edge_router/link_route_proxy.c
   router_core/modules/edge_router/edge_mgmt.c
   router_core/modules/test_hooks/core_test_hooks.c
   router_core/modules/edge_addr_tracking/edge_addr_tracking.c
-  router_core/modules/address_lookup_server/address_lookup_server.c
+  router_core/modules/address_lookup_server/address_lookup_utils.c

Review comment:
   Sounds sensible, but it is not directly related to the "create .c file 
for every .h file" PR I have here. I'll fix the immediate problems and fill a 
Jira for the additional improvement. 
https://issues.apache.org/jira/browse/DISPATCH-2285




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.19.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-05-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17343870#comment-17343870
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

kgiusti commented on a change in pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211#discussion_r631820969



##
File path: src/CMakeLists.txt
##
@@ -101,25 +111,28 @@ set(qpid_dispatch_SOURCES
   router_core/terminus.c
   router_core/transfer.c
   router_core/core_timer.c
+  router_core/module.c
   router_core/modules/edge_router/module.c
   router_core/modules/edge_router/addr_proxy.c
   router_core/modules/edge_router/connection_manager.c
   router_core/modules/edge_router/link_route_proxy.c
   router_core/modules/edge_router/edge_mgmt.c
   router_core/modules/test_hooks/core_test_hooks.c
   router_core/modules/edge_addr_tracking/edge_addr_tracking.c
-  router_core/modules/address_lookup_server/address_lookup_server.c
+  router_core/modules/address_lookup_server/address_lookup_utils.c

Review comment:
   My $0.02:
   
   The address lookup stuff is only used by router-core module.  It's not used 
by I/O threads, for example.  This means that we should probably "hide" the API 
defined in address_lookup_utils.c by moving that file into 
router_core/modules/address_lookup_server directory.
   
   Then I would move the address_lookup_server.h file out of the general 
include/qpid/dispatch directory and put it in src/router_core/ directory.
   
   These changes would result in making the address lookup stuff private to the 
router_core module, which seems better to me since the address lookup 
functionality is only to be used by the router_core.
   
   Warning: totally not tested - may result in extra work :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.17.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-05-13 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17343868#comment-17343868
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

kgiusti commented on a change in pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211#discussion_r631820969



##
File path: src/CMakeLists.txt
##
@@ -101,25 +111,28 @@ set(qpid_dispatch_SOURCES
   router_core/terminus.c
   router_core/transfer.c
   router_core/core_timer.c
+  router_core/module.c
   router_core/modules/edge_router/module.c
   router_core/modules/edge_router/addr_proxy.c
   router_core/modules/edge_router/connection_manager.c
   router_core/modules/edge_router/link_route_proxy.c
   router_core/modules/edge_router/edge_mgmt.c
   router_core/modules/test_hooks/core_test_hooks.c
   router_core/modules/edge_addr_tracking/edge_addr_tracking.c
-  router_core/modules/address_lookup_server/address_lookup_server.c
+  router_core/modules/address_lookup_server/address_lookup_utils.c

Review comment:
   My $0.02:
   
   The address lookup stuff is only used by router-core modules.  It's not used 
by I/O threads, for example.  This means that we should probably "hide" the 
functions that are in address_lookup_utils.c by moving that file into 
router_core/modules/address_lookup_server directory.
   
   Then I would move the address_lookup_server.h file out of the general 
include/qpid/dispatch directory and put it in src/router_core/ directory.
   
   These changes would result in moving the address lookup stuff into the 
router_core module, which seems better to me since the address lookup 
functionality is only to be used by the router_core.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.17.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-05-11 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17342854#comment-17342854
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on a change in pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211#discussion_r630524658



##
File path: src/CMakeLists.txt
##
@@ -101,25 +111,28 @@ set(qpid_dispatch_SOURCES
   router_core/terminus.c
   router_core/transfer.c
   router_core/core_timer.c
+  router_core/module.c
   router_core/modules/edge_router/module.c
   router_core/modules/edge_router/addr_proxy.c
   router_core/modules/edge_router/connection_manager.c
   router_core/modules/edge_router/link_route_proxy.c
   router_core/modules/edge_router/edge_mgmt.c
   router_core/modules/test_hooks/core_test_hooks.c
   router_core/modules/edge_addr_tracking/edge_addr_tracking.c
-  router_core/modules/address_lookup_server/address_lookup_server.c
+  router_core/modules/address_lookup_server/address_lookup_utils.c

Review comment:
   Yeah, I did not handle this well. At least, I need to change the include 
guard in the header file. Not sure what's the appropriate name, only know that 
the name of c and h files should match.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.17.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-05-11 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17342844#comment-17342844
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek opened a new pull request #1211:
URL: https://github.com/apache/qpid-dispatch/pull/1211


   @ChugR Do you think that `_private.h` need their own .c file too? I thought 
not, so I did not do it here. I dislike how the empty .c files pollute the src 
directory. But there is some value in having this even for private headers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.17.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-26 Thread Jira


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17331905#comment-17331905
 ] 

Jiri Daněk commented on DISPATCH-836:
-

One thing missing: some header files don't have a corresponding implementation 
file, so they aren't checked for independent compilation.

Another thing missing: some unused includes in header files are still present.

I don't want to touch this so soon before 1.16 freeze, so I will replan it for 
1.17.

> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.17.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-18 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324438#comment-17324438
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek merged pull request #:
URL: https://github.com/apache/qpid-dispatch/pull/


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-18 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17324437#comment-17324437
 ] 

ASF subversion and git services commented on DISPATCH-836:
--

Commit 02e99cd371bf7ee186ddeb28332dc6dd9c0fb53e in qpid-dispatch's branch 
refs/heads/main from Jiri Daněk
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=02e99cd ]

DISPATCH-836 Remove unused #include s (#)



> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17322473#comment-17322473
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek edited a comment on pull request #:
URL: https://github.com/apache/qpid-dispatch/pull/#issuecomment-820660096


   I think that if it compiles, then it means I did not break it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-15 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17322414#comment-17322414
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on pull request #:
URL: https://github.com/apache/qpid-dispatch/pull/#issuecomment-820660096


   I think that if it compiles, then it means I did not broke it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-11 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17318921#comment-17318921
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek opened a new pull request #:
URL: https://github.com/apache/qpid-dispatch/pull/


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315096#comment-17315096
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek merged pull request #1105:
URL: https://github.com/apache/qpid-dispatch/pull/1105


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315095#comment-17315095
 ] 

ASF subversion and git services commented on DISPATCH-836:
--

Commit f2589bb3577de4b02693ac3f32022504d92562fc in qpid-dispatch's branch 
refs/heads/main from Jiri Daněk
[ https://gitbox.apache.org/repos/asf?p=qpid-dispatch.git;h=f2589bb ]

DISPATCH-836 Standardize #include order (#1105)



> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread Jira


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315058#comment-17315058
 ] 

Jiri Daněk commented on DISPATCH-836:
-

bq. Proton includes should be delimited with angle brackets. In the /src 
directory all the includes already use the angle brackets so there is no change 
needed there. In the /tests directory there are many instances of proton 
inclusions with quoted file names and these should be changed.

I think quotes should be used in case of Proton, too. That's because the user 
has the option to configure Proton location during {{cmake ..}} configure, 
using {{-DProton_DIR}}. If user specifies a custom location, but then includes 
from the system location are used instead, that's an error, too. Same for all 
the other dependencies, libwebsockets, libnghttp2, ...

IMO the only includes that should use angle brackets are cstdlib ones.

(In the PR, I am changing Dispatch includes to use quotes; I am not changing 
any other includes.)

> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315052#comment-17315052
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on a change in pull request #1105:
URL: https://github.com/apache/qpid-dispatch/pull/1105#discussion_r607287597



##
File path: src/router_core/modules/address_lookup_server/address_lookup_server.c
##
@@ -17,13 +17,14 @@
  * under the License.
  */
 
-#include 
-#include 
-#include "module.h"
+#include "qpid/dispatch/address_lookup_server.h"
+
 #include "core_link_endpoint.h"
+#include "module.h"
 
-#include "inttypes.h"

Review comment:
   oh yeah, this was the second issue this uncovered




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315048#comment-17315048
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on a change in pull request #1105:
URL: https://github.com/apache/qpid-dispatch/pull/1105#discussion_r607278251



##
File path: src/router_core/exchange_bindings.c
##
@@ -16,14 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include 
-#include 
-#include 
-#include "router_core_private.h"
-#include "forwarder.h"
 #include "exchange_bindings.h"

Review comment:
   Here's the only issue the reordering found. `exchange_bindings.h` 
depended on being included after `"router_core_private.h"`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315046#comment-17315046
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek commented on pull request #1105:
URL: https://github.com/apache/qpid-dispatch/pull/1105#issuecomment-813588422


   This is way too big to ask anyone to review. I'll read though this few more 
times and go with CI result.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17315044#comment-17315044
 ] 

ASF GitHub Bot commented on DISPATCH-836:
-

jiridanek opened a new pull request #1105:
URL: https://github.com/apache/qpid-dispatch/pull/1105


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-05 Thread Charles E. Rolke (Jira)


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17314914#comment-17314914
 ] 

Charles E. Rolke commented on DISPATCH-836:
---

"_Dispatch likes the <> imports way too much"._

Indeed this is true to the point of being possibly behaving incorrectly. If 
qpid-disptach is installed via an rpm package then one might reasonably expect
{code:java}
#include 
{code}
to include the source alloc.h from the installed package. On the other hand one 
might expect
{code:java}
#include "qpid/dispatch/alloc.h"
{code}
to include the source alloc.h from the current source tree.

In this case including the source file from the installed package is an error. 
The source must be included from the current source tree or else the build 
cannot be trusted.

Quoting the include file names instead of using angle brackets for files that 
are part of the dispatch source would be a worthy addition to this jira.

Proton includes should be delimited with angle brackets. In the /src directory 
all the includes already use the angle brackets so there is no change needed 
there. In the /tests directory there are many instances of proton inclusions 
with quoted file names and these should be changed.

 

> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-02 Thread Jira


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17313972#comment-17313972
 ] 

Jiri Daněk commented on DISPATCH-836:
-

clang-format actually does not work all that well, because it only recognizes 
the main header if it is imported as "header.h" and not . Dispatch 
likes the <> imports way too much, even for files that are part of Dispatch 
itself :(

{code}
bool IncludeCategoryManager::isMainHeader(StringRef IncludeName) const {
  if (!IncludeName.startswith("\""))
return false;
{code}

https://github.com/llvm/llvm-project/blob/2c4548e18e09686659bddad617b8c42a47714540/clang/lib/Tooling/Inclusions/HeaderIncludes.cpp#L235-L237

> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Assignee: Jiri Daněk
>Priority: Minor
> Fix For: 1.16.0
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-02 Thread Jira


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17313951#comment-17313951
 ] 

Jiri Daněk commented on DISPATCH-836:
-

[~chug] What do you think about this? The example does not have a header file 
for this .c file, but if it was there, it would be directly below #include 
Python in the After section.
h3. Before
{noformat}
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include "entity.h"
#include "entity_cache.h"
#include "config.h"

#ifdef QD_MEMORY_DEBUG
#include 
#include "log_private.h"
#endif
{noformat}
h3. After
{noformat}
#include 

#include 
#include 
#include 

#include 
#include 
#include 

#include "config.h"
#include "entity.h"
#include "entity_cache.h"

#ifdef QD_MEMORY_DEBUG
#include 

#include "log_private.h"
#endif
{noformat}
It is produced by the following config
{noformat}
BasedOnStyle: Google
[...]
IncludeCategories:
  - Regex: '^$'
Priority: -1
  - Regex: '^'
Priority: 3
  - Regex: '^<.*\.h>'
Priority: 1
  - Regex: '^<.*'
Priority: 2
  - Regex: '.*'
Priority: 4
{noformat}

> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Priority: Minor
> Fix For: Backlog
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org



[jira] [Commented] (DISPATCH-836) Source file organization suffers from include hell

2021-04-02 Thread Jira


[ 
https://issues.apache.org/jira/browse/DISPATCH-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17313819#comment-17313819
 ] 

Jiri Daněk commented on DISPATCH-836:
-

So in other words, it's the Google ordering, 
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes

It should be possible to automate the reordering, 
https://clang.llvm.org/docs/ClangFormatStyleOptions.html, option 
IncludeCategories

> Source file organization suffers from include hell
> --
>
> Key: DISPATCH-836
> URL: https://issues.apache.org/jira/browse/DISPATCH-836
> Project: Qpid Dispatch
>  Issue Type: Improvement
>  Components: Container, Router Node, Routing Engine
>Affects Versions: 0.8.0
>Reporter: Charles E. Rolke
>Priority: Minor
> Fix For: Backlog
>
>
> Adding an innocent looking #include to some module may unleash a barrage of 
> errors instead of simply defining the header's interface. Reordering and/or 
> adding more #include statements is required to get it right.
> A good way to address this is to make certain that each module.h file 
> compiles cleanly on its own. It is tedious and pretty unrewarding to check 
> each file. One strategy to address this problem is for each module to 
> _#include module.h_ as the first include\[1\]. Then every compile checks that 
> the module.h files compiles cleanly. This strategy is recommended by 
> astitcher and used by qpid-cpp with great results.
> \[1\] One exception to this rule is including the #include Python.h ahead of 
> all others. This is a requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org