[GitHub] [arrow] nealrichardson commented on a change in pull request #7245: ARROW-8885: [R] Don't include everything everywhere

2020-05-22 Thread GitBox


nealrichardson commented on a change in pull request #7245:
URL: https://github.com/apache/arrow/pull/7245#discussion_r429433084



##
File path: r/src/arrow_exports.h
##
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// This gets included in arrowExports.cpp
+
+#pragma once
+
+#include "arrow_rcpp.h"
+
+#if defined(ARROW_R_WITH_ARROW)
+#include 
+#include 

Review comment:
   Are you sure? IIUC (which I may very well not) arrowExports.cpp itself 
doesn't call the constructors etc., it just wraps, so you just need to have the 
types in the signature declared somewhere. See e.g. 
https://github.com/apache/arrow/blob/master/r/src/arrowExports.cpp#L1534-L1547





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




[GitHub] [arrow] nealrichardson commented on a change in pull request #7245: ARROW-8885: [R] Don't include everything everywhere

2020-05-22 Thread GitBox


nealrichardson commented on a change in pull request #7245:
URL: https://github.com/apache/arrow/pull/7245#discussion_r429431625



##
File path: r/src/arrow_types.h
##
@@ -176,64 +37,21 @@ inline constexpr Rbyte default_value() {
 
 }  // namespace Rcpp
 
-namespace arrow {
-namespace r {
-
-template 
-inline std::shared_ptr extract(SEXP x) {
-  return Rcpp::ConstReferenceSmartPtrInputParameter>(x);
-}
-
-}  // namespace r
-}  // namespace arrow
-
 #if defined(ARROW_R_WITH_ARROW)
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include   // for RBuffer definition below

Review comment:
   đź‘Ť I don't have great instincts about what drives compile time and how to 
optimize 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




[GitHub] [arrow] nealrichardson commented on a change in pull request #7245: ARROW-8885: [R] Don't include everything everywhere

2020-05-22 Thread GitBox


nealrichardson commented on a change in pull request #7245:
URL: https://github.com/apache/arrow/pull/7245#discussion_r429388011



##
File path: r/src/arrow_types.h
##
@@ -176,64 +37,21 @@ inline constexpr Rbyte default_value() {
 
 }  // namespace Rcpp
 
-namespace arrow {
-namespace r {
-
-template 
-inline std::shared_ptr extract(SEXP x) {
-  return Rcpp::ConstReferenceSmartPtrInputParameter>(x);
-}
-
-}  // namespace r
-}  // namespace arrow
-
 #if defined(ARROW_R_WITH_ARROW)
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include   // for RBuffer definition below

Review comment:
   Right but only 2 cpp files need RBuffer, so we wouldn’t have to include 
it for the other 20 files. So does that help?





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




[GitHub] [arrow] nealrichardson commented on a change in pull request #7245: ARROW-8885: [R] Don't include everything everywhere

2020-05-22 Thread GitBox


nealrichardson commented on a change in pull request #7245:
URL: https://github.com/apache/arrow/pull/7245#discussion_r429303750



##
File path: r/src/arrow_types.h
##
@@ -176,64 +37,21 @@ inline constexpr Rbyte default_value() {
 
 }  // namespace Rcpp
 
-namespace arrow {
-namespace r {
-
-template 
-inline std::shared_ptr extract(SEXP x) {
-  return Rcpp::ConstReferenceSmartPtrInputParameter>(x);
-}
-
-}  // namespace r
-}  // namespace arrow
-
 #if defined(ARROW_R_WITH_ARROW)
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include   // for RBuffer definition below
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
+// Do we need ubsan always there?

Review comment:
   question

##
File path: r/src/array_from_vector.cpp
##
@@ -20,6 +20,11 @@
 #include "./arrow_types.h"
 
 #if defined(ARROW_R_WITH_ARROW)
+#include 
+#include 
+#include 
+// This says "Private header, not to be exported"

Review comment:
   Is this ok?

##
File path: r/src/arrow_types.h
##
@@ -176,64 +37,21 @@ inline constexpr Rbyte default_value() {
 
 }  // namespace Rcpp
 
-namespace arrow {
-namespace r {
-
-template 
-inline std::shared_ptr extract(SEXP x) {
-  return Rcpp::ConstReferenceSmartPtrInputParameter>(x);
-}
-
-}  // namespace r
-}  // namespace arrow
-
 #if defined(ARROW_R_WITH_ARROW)
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include   // for RBuffer definition below

Review comment:
   The RBuffer class definition should probably be moved to buffer.cpp but 
I didn't work out how to register it in the namespace in this file.

##
File path: r/src/arrow_exports.h
##
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// This gets included in arrowExports.cpp
+
+#pragma once
+
+#include "arrow_rcpp.h"
+
+#if defined(ARROW_R_WITH_ARROW)
+#include 
+#include 

Review comment:
   I suspect if there were more type_fwd.h files (like for dataset), we 
could trim this file back further and shave off some more seconds. 





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