GithubHelp home page GithubHelp logo

cross-language-cpp / djinni Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dropbox/djinni

29.0 29.0 2.0 3.8 MB

A tool for generating cross-language type declarations and interface bindings.

Home Page: https://djinni.xlcpp.dev

djinni's People

Contributors

4brunu avatar a4z avatar artwyman avatar choiip avatar ddeville avatar forderud avatar gnichola avatar greatcall-kayek avatar izacus avatar j4cbo avatar jaetzold avatar jfirebaugh avatar jonmcclung avatar jothepro avatar konovalov-aleks avatar marcinkaszynski avatar mbrgm avatar mjmacleod avatar mknejp avatar msjarrett avatar nachosoto avatar pwais avatar skabbes avatar sschuberth avatar steipete avatar stephenwspann avatar tiwoc avatar vmaks avatar wpurdy2 avatar yageek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

a4z cmst0us

djinni's Issues

How to get started with this new structure?

Hello!

I've been trying to learn how to use djinni but I only found tutorials for the "old" structure.
How would I go about to use this new one instead?

The minimal steps to get a hello world to run properly/easily would be brilliant!

Split repo into multiple projects?

Inspired by @a4z's thoughts I'd like to propose splitting the single repo up into multiple sub-projects to separate the different components into self-contained codebases. This helps clean up the repo structure.

When analysing the current repo I could isolate the following self-contained components:

  • djinni parser/generator commandline tool
  • support lib & integration-tests (depends on djinni parser/generator)
  • android example (depends on djinni parser/generator)
  • ios example (depends on djinni parser/generator)

The main benefits would be:

  • ✅ The generator/parser repo would be a lot cleaner & just contain the sbt project + documentation on how to use the cli
  • ✅ The support-lib repo just contains cpp/obj gluecode sources & could easily be published to dependency-managers like conan, hunter.
  • ✅ The iOS/Android examples would be closer to reality as they have to include the djinni-cli binary as external utility like any other project has to. They could easily serve as templates for a new project (just fork and modify to your needs).
  • ✅ More examples (e.g. CMake-based iOS/Android projects) could easily be added in separate repos without having to open PRs in the 'main' repo everytime.

Downsides & things that need further discussion:

  • ❌ The generator/parser & the support-lib have separate lifecycles, that may (theoretically) lead to incompatibilities ("upsidaisy I am using the generator in version X but it has features that are not supported in support-lib version Y"). In reality I don't expect changes that are big enough to often cause this kind of trouble.
  • ❌ The documentation is split up: The generator usage-instructions are in one repo, the support-lib instructions in the other repo. -- A github-page that provides a general-purpose documentation for all djinni stuff may be a solution for this.
  • ❌ ❌ ❌ The parser/generator repo looses tests for QA: Currently there is only integration-testing going on, no unit-tests for the generator itself. This means that all integration tests depend on the support-lib and therefore will have to be executed in the support-lib repo. To have any kind of QA we would have to write entirely new unit- or integration-tests for the parser/generator.

I am looking forward to your thoughts on this wall of text ☺️

Set up CI with Github-Actions

I as a code-owner want to automate testing of the codebase to avoid merging code with bugs or errors into the master branch.
For that I want to utilize Github-Actions to automatically run the existing tests (make test) on every pull-request to the repository.

What about the python-branch?

There is a branch that brings experimental python-support. I do understand why dropbox kept this in a feature-branch, because it never was in their personal interest & scope to support python.

Has anyone used the python branch? How do you think about it? Should we continue to focus on Java & ObjC or should we also be open to other languages?

My opinion:
I'd prefer merging python support into master (if it's feature-complete & works) and mark it as experimental in the documentation. Personally I have no interest in python support, but I think maintenance of the project will be easier if changes don't have to be ported over to the python-branch manually.
If we should find out that the python branch is not feature complete (it seems like it lacks any documentation, wich is a warning sign to me), I'd prefer dumping the branch instead of having to somehow maintaint it.

support lib needs a make install target

For being able to use the support lib system wide,
or package it with conan or vcpkg,
there should be a make install command
so that the installation of the needed files into the correct locations simply happens.

IntelliJ Plugin does not support `flags`

Summary

The IntelliJ Djinni Plugin published on the Jetbrains Marketplace does not support flags:

Bildschirmfoto 2020-10-10 um 18 40 59

How to reproduce:

Install the Plugin in IntelliJ IDEA and create a .djinni file. Define a flags-datatype like so:

my_flags = flags {
  flag1;
}

The IDE will now hint you that it does not know about the flags keyword.

Unable to find dependencies of com.eed3si9n:sbt-assembly:0.15.0 on clean repo

For some reason I'm unable to find dependencies of sbt on a fresh instance of this repo. I'm unable to reproduce this issue on another computer that I ran the make command last week, so this must be a new issue with the maven repo.

How to reproduce:

My Environment

  • I'm on Ubuntu 18.04 (yeah it's old)
  • sbt version: 1.4.6
  • $HOME/.ivy2/ is non-existent
  • ensured repo is clear
  • JDK: 11.ut0.9.1

I had to run to produce the error:

make djinni_standalone

Output:

cd src && sbt assembly
[info] welcome to sbt 1.3.13 (Ubuntu Java 11.0.9.1)
[info] loading settings for project src-build from plugins.sbt ...
[info] loading project definition from /home/epicstar/git/djinni/src/project
[warn] 
[warn] 	Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn] 		com.eed3si9n:sbt-assembly:0.15.0 (sbtVersion=1.0, scalaVersion=2.12)
[warn] 
[warn] 	Note: Unresolved dependencies path:
[error] sbt.librarymanagement.ResolveException: Error downloading com.eed3si9n:sbt-assembly;sbtVersion=1.0;scalaVersion=2.12:0.15.0
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly_2.12_1.0/0.15.0/sbt-assembly-0.15.0.pom
[error]   not found: /home/epicstar/.ivy2/local/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.15.0/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.15.0/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.15.0/ivys/ivy.xml
[error] 	at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:249)
[error] 	at lmcoursier.CoursierDependencyResolution.$anonfun$update$35(CoursierDependencyResolution.scala:218)
[error] 	at scala.util.Either$LeftProjection.map(Either.scala:573)
[error] 	at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:218)
[error] 	at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
[error] 	at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:52)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:102)
[error] 	at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:69)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:115)
[error] 	at scala.util.control.Exception$Catch.apply(Exception.scala:228)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:115)
[error] 	at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:96)
[error] 	at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:150)
[error] 	at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:129)
[error] 	at sbt.Classpaths$.$anonfun$updateTask0$5(Defaults.scala:2950)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] 	at sbt.Execute.work(Execute.scala:290)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:834)
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.eed3si9n:sbt-assembly;sbtVersion=1.0;scalaVersion=2.12:0.15.0
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly_2.12_1.0/0.15.0/sbt-assembly-0.15.0.pom
[error]   not found: /home/epicstar/.ivy2/local/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.15.0/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.15.0/ivys/ivy.xml
[error]   download error: Caught javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target) while downloading https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/scala_2.12/sbt_1.0/0.15.0/ivys/ivy.xml
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

The Fix

I had to add this to the [src/projects/plugins.sbt] on line 1:

resolvers += Resolver.url("bintray-sbt-plugins", url("https://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

This fixed my issue. I guess maven.org deleted sbt-assembly 2.12? I'll make a PR for this.

CMake function wrapper for djinni

As a CMake user I would like to call djinni by simply calling a CMake function that I imported from djinni. The call should look something like this:

# calls djinni on given IDL.
# calls `message(FATAL_ERROR ...)` and aborts configuration when something goes wrong during generation
djinni(path/to/idl.djinni
   JAVA_OUT ${JAVA_OUTPUT_FOLDER} # expose all djinni options as cmake function parameters
   JAVA_PACKAGE com.example.jnigenpackage
   IDENT_JAVA_FIELD mFooBar
   CPP_OUT ${CPP_OUTPUT_FOLDER}
   # ... more djinni arguments
)

This makes my CMake code cleaner and more readable because I don't have to call djinni myself with execute_process and I don't need to implement error handling (what to do in case djinni generation fails?) myself.

automatically publish djinni as jar with each release

As a user I want to easily download the latest djinni release as a binary without messing around with building it, because it is faster and easier than running the makefile myself.

This could be achieved by extending the pipeline to build and publish the jar resulting from make djinni_jar on each release tag.

Add code of conduct

As a project maintainer I want everybody participating in this repository to commit to a code of conduct that promotes a open and diverse community and protects it from getting unhealthy.

I would prefer to just copy and modify someone elses COC, like for example the one from apache

Dockerized tests fail

When I tried to automatically run all available tests in the test-suite-folder for #3, I realized that the dockerized tests (make linux_docker) do always fail on centos with:

[java] There was 1 failure:
[java] 1) test(com.dropbox.djinni.test.WcharTest)
[java] junit.framework.ComparisonFailure: expected:<...string with unicode [�], ?, ? symbols> but was:<...string with unicode [], ?, ? symbols>

Full log: https://github.com/jothepro/djinni/runs/851151937?check_suite_focus=true

I did not investigate any further yet.
Additionally I have concerns to how useful these tests are, since they only test the java-bridging on a few distribution/compiler configurations. Instead I think it might be more useful to run more extensive matrix-tests with github-actions.

Logo/Icon for djinni?

This may be a bit off-topic but while refreshing the intellij plugin I realized that I wanted to update the file icon for djinni files + I want to include a logo for the plugin.

So I wasted my time by making this new logo design for djinni:
djinni_logo_idea_2

It's pretty basic but I made it from scratch, so no copyright/licensing issues! 😎
The font is Overpass, should be free to use.
I know I will hate it in a few days, but I love it right now!

What do you think?

Convert Djinni Source to C++

Benefits:

  • Current project owners know C++
  • Speed (might be negligable?)

cons:

  • Pretty heavy time sync?
  • rewrite of source requires rewrite of many scripts across the project as well

@a4z @jothepro thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.