Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Travis Build #29

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Working Travis Build #29

wants to merge 11 commits into from

Conversation

Paxanator
Copy link
Collaborator

Making this mostly for commenting and help rather then testing the build. I'm in the process of testing the travis build on my forked repository, but it continues to fail R CMD CHECK, but passes on osx. It has to do with dynamic loading of the library

Error: package or namespace load failed for ‘fRanz’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/pboueri/fRanz.Rcheck/fRanz/libs/fRanz.so':
  librdkafka++.so.1: cannot open shared object file: No such file or directory```

This has lead me down the path of correctly building multi-platform R packages and have been overwhelmed with the choice/can't get one to work. I have . opened #28 as a result


language: r
r:
- release
cache: packages

os:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osx doesn't work w/ docker compose

@@ -1,6 +1,6 @@
Package: fRanz
Type: Package
Title: An R Kafka Client
Title: An R Kafka Client.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a funny R CMD CHECK note that says this should be a full sentence

@@ -25,7 +28,8 @@ KafkaConsumer <- R6::R6Class(
}

, consume = function(topic, numResults=100) {
Filter(function(msg) !is.null(msg), KafkaConsume(private$consumerPtr, numResults))
results <- Filter(function(msg) !is.null(msg), KafkaConsume(private$consumerPtr, numResults))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoot my other PR of serializers bled into this

.travis.yml Outdated
@@ -2,14 +2,14 @@ services:
- docker

before_install:
- mkdir dest
- make librdkafka LIBRDKAFKA_CONF=--prefix=dest
- export LD_LIBRARY_PATH=LD_LIBRARY_PATH:dest/lib
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled this locally and am testing. what is the purpose of the dest directory? I'm finding it empty after I run make librdkafka

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got this to populate by changing it to --prefix=../dest, will see if that makes any difference

#' @description Consume a fixed number of results from whatever topic(s)
#' the provided consumer is subscribed to.
=======
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh i screwed up the merge

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lesson learned. Making changes in VS Code w/o saving is bad for biz

@Paxanator
Copy link
Collaborator Author

Paxanator commented May 27, 2019

For posterity i think the reason it installs on mac and not linux is because

gcc  -shared -dynamiclib -Wl,-install_name,/Users/pboueri/Repos/oss/fRanz/fRanz/inst/librdkafka/lib/librdkafka++.1.dylib RdKafka.o ConfImpl.o HandleImpl.o ConsumerImpl.o ProducerImpl.o KafkaConsumerImpl.o TopicImpl.o TopicPartitionImpl.o MessageImpl.o HeadersImpl.o QueueImpl.o MetadataImpl.o -o librdkafka++.1.dylib -L../src -lrdkafka -lstdc++

of the librdkafka compilation
-install_name I think tells fRanz.so where librdfkaka++/.dylib is so when fRanz.so moves as part of the installation process , it still can reference it

Current options are in my mind:

  1. Figure out how to compile fRanz.so with librdkafka.a as part of it by overriding SHLIB like this: https://stackoverflow.com/a/31754107
  2. Put compiled librdkafka stuff in /inst and then figure out how to make a relative link against it in fRanz.so. thing to note here is that inst/ stuff is moved one level up when being installed
  3. Figure out if there’s a way to override install.packages.R to move both fRanz.so and librdfkafka.a/dylib/so to the installed libs dir and link locally
  4. Do the system level library linking thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants