You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "vyasr (via GitHub)" <gi...@apache.org> on 2026/04/10 17:10:35 UTC

[I] BUILD_SHARED_LIBS in the config should be set at build time [arrow-nanoarrow]

vyasr opened a new issue, #875:
URL: https://github.com/apache/arrow-nanoarrow/issues/875

   Currently the CMake config uses the value of `BUILD_SHARED_LIBS` whenever the config is executed, which means it is the value from other builds. However, what we really want here is to use the value of `BUILD_SHARED_LIBS` when nanoarrow itself was built since that controls which libraries are actually present. What we probably want is to add some logic [after the `configure_file`](https://github.com/apache/arrow-nanoarrow/blob/3306ac6e884392c8f7303d9dd3355af546276b65/CMakeLists.txt#L846) to write an explicit target alias to the generated file based on the value of `BUILD_SHARED_LIBS` during the nanoarrow build.


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

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


Re: [I] BUILD_SHARED_LIBS in the config should be set at build time [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on issue #875:
URL: https://github.com/apache/arrow-nanoarrow/issues/875#issuecomment-4225835624

   Hi again and thanks for opening! I trust you and I'm happy to update that.


-- 
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


Re: [I] BUILD_SHARED_LIBS in the config should be set at build time [arrow-nanoarrow]

Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot closed issue #875: BUILD_SHARED_LIBS in the config should be set at build time
URL: https://github.com/apache/arrow-nanoarrow/issues/875


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

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


Re: [I] BUILD_SHARED_LIBS in the config should be set at build time [arrow-nanoarrow]

Posted by "vyasr (via GitHub)" <gi...@apache.org>.
vyasr commented on issue #875:
URL: https://github.com/apache/arrow-nanoarrow/issues/875#issuecomment-4271209347

   Thanks Dewey! And hi 😃 
   
   The justification for this change is that say I build my nanoarrow package with `BUILD_SHARED_LIBS=OFF` so I produce a static llibrary. Then, I install that into some environment where I then try to build my own package foo as a dynamic library with `BUILD_SHARED_LIBS=ON`. With the current approach, what will happen is that the [nanoarrow config will make `nanoarrow::nanoarrow` an alias for `nanoarrow::nanoarrow_shared`](https://github.com/apache/arrow-nanoarrow/blob/3306ac6e884392c8f7303d9dd3355af546276b65/cmake/config.cmake.in#L29), which will then fail right after configuring because the `libnanoarrow.so` library that `nanoarrow_shared`  references doesn't exist. That error will look something like
   
   ```
   ninja: error: '... libnanoarrow_shared.so', needed by libfoo.so, missing and no known rule to make it
   ```
   
   Note that `libnanoarrow_shared.so` isn't even the real library name, it shows up because if CMake doesn't have a real library associated with the `nanoarrow_shared` target that name winds up being passed to the underlying compiler command as a raw `-l ${target}` argument. 
   
   With the proposed change, `nanoarrow::nanoarrow` will correct reference the `nanoarrow.a` archive that was actually built into the nanoarrow package at build time. If the consumer actually has a hard requirement for either the shared or static library, then they can request the `nanoarrow::nanoarrow_shared` or `nanoarrow::nanoarrow_static`.


-- 
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