You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "danepitkin (via GitHub)" <gi...@apache.org> on 2023/02/02 17:42:59 UTC

[GitHub] [arrow-nanoarrow] danepitkin commented on a diff in pull request #102: docs(examples/vendored-ipc): Create vendored IPC extension example

danepitkin commented on code in PR #102:
URL: https://github.com/apache/arrow-nanoarrow/pull/102#discussion_r1094864154


##########
examples/vendored-ipc/README.md:
##########
@@ -0,0 +1,89 @@
+<!---
+  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.
+-->
+
+# IPC Extension Vendored Example
+
+This folder contains a project that uses the bundled nanarrow and nanoarrow_ipc.c
+files included in the dist/ directory of this repository (or that can be generated
+using `cmake -DNANOARROW_BUNDLE=ON` from the root CMake project). Like the CMake
+example, you must be careful to not expose nanoarrow's headers outside your project
+and make use of `#define NANOARROW_NAMESPACE MyProject` to prefix nanoarrow's symbol
+names to ensure they do not collide with another copy of nanoarrow potentially linked
+to by another project.
+
+The nanoarrow/ files included in this example are stubs to illustrate
+how these files could fit in to a library and/or command-line application project.
+The easiest way is to use the pre-generated versions in the dist/ folder of this
+repository:
+
+```bash
+git clone https://github.com/apache/arrow-nanoarrow.git
+cd arrow-nanoarrow/examples/vendored-ipc
+mkdir -p src/nanoarrow
+cp ../../dist/nanoarrow.h src/nanoarrow/nanoarrow.h
+cp ../../dist/nanoarrow.c src/nanoarrow/nanoarrow.c
+cp ../../dist/nanoarrow_ipc.h src/nanoarrow/nanoarrow_ipc.h
+cp ../../dist/nanoarrow_ipc.c src/nanoarrow/nanoarrow_ipc.c
+cp ../../dist/flatcc.c src/nanoarrow/flatcc.c
+cp -r ../../dist/flatcc src/nanoarrow/flatcc

Review Comment:
   yes, definitely! This is what I thought of at first, but what if we extend the `dist/` folder with more extensions? I figured this is a clear documentation of what "vendored nanoarrow_ipc" actually is without digging into the code. I'm happy to switch it still if you prefer.
   
   Also thought of 
   ```
   cc -c library.c $(find nanoarrow -name '*.c' -maxdepth 1) $(find nanoarrow -type d -maxdepth 1 | awk '{print "-I" $0}')
   ```
   instead of
   ```
   cc -c library.c nanoarrow/nanoarrow.c nanoarrow/flatcc.c nanoarrow/nanoarrow_ipc.c -I./nanoarrow -I./nanoarrow/flatcc
   ```
   .. but thought that was too opaque/confusing. The only benefit is that the commands could continue to work with updating them if the file names or relevant file list changes. 



-- 
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: github-unsubscribe@arrow.apache.org

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