Coder Social home page Coder Social logo

Comments (12)

jedla97 avatar jedla97 commented on August 17, 2024 2

Just a note. This is also happening on baremetal. You can check it with provided reproducer by running mvn clean verify -Dnative

  1. mvn install -Dnative
  2. ./target/reproducer-with-quarkus-1.0.0-SNAPSHOT-runner
  3. Go to http://127.0.0.1:8080/compression/text and see quarkus log

from quarkus.

Karm avatar Karm commented on August 17, 2024 2

@jcarranzan

Here is a working example, tested with Quarkus 3.10.0 on Linux aarch64 (see README.md) and Linux amd64, using Mandrel native-image, Mandrel-23.1.3.1-Final (JDK 21.0.3+9-LTS).

See:
https://github.com/Karm/dev-null/tree/main/brotli4j-native

The example is heavily simplified version of your original reproducer, because the issue has nothing to do with either OpenShift or some other dependencies you had there.

You don't need to do anything in the Java code, you just need to mark Brotli4jLoader.java for runtime init and you need to specify resource config so as libbrotli.so gets bundled in the final executable file as a resource.

See application.properties.

from quarkus.

Karm avatar Karm commented on August 17, 2024 1

Hello @jcarranzan,

I have your reproducer working properly in native. Let me polish the how-to and share it with you.

This is neither Quarkus nor GraalVM issue per se. It's just that AOT requires some more config work to get it working.
Quarkus extensions shield users from this complexity, but since there is none for this specific library usage (or none I know of), you need to add some manual configs.

from quarkus.

quarkus-bot avatar quarkus-bot commented on August 17, 2024

/cc @Karm (mandrel), @galderz (mandrel), @geoand (openshift), @iocanel (openshift), @zakkak (mandrel,native-image)

from quarkus.

gsmet avatar gsmet commented on August 17, 2024

Is this usage widespread? Would it make sense to develop a small extension similar to what I did here: https://github.com/quarkiverse/quarkus-opencv/ ?

from quarkus.

Karm avatar Karm commented on August 17, 2024

@gsmet https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Webserver.20compression/near/438350071

I'd say yes. Unless I misunderstood and it's already a part of e.g. Vert.x.

from quarkus.

cescoffier avatar cescoffier commented on August 17, 2024

I would not say 'widespread'. It's starting to be used. Vert.x already has the support (via netty), and due to some ugly substitution business, we have it on the classpath.

@Karm Based on your exploration, I would do the same thing I did for RocksDB, Snappy... If a built-time property enables Brotli, we include the appropriate native library into the native executable and mark Broli4Loarder as runtime init.

from quarkus.

melloware avatar melloware commented on August 17, 2024

Should we re-open this ticket then?

from quarkus.

Karm avatar Karm commented on August 17, 2024

@melloware @cescoffier

Should we re-open this ticket then?

I don't know. Not a bug... it's a missing feature :)

I will work on the seamless integration regardless of this particular issue being open or not.

from quarkus.

cescoffier avatar cescoffier commented on August 17, 2024

I guess the next to be PR should be enough. This ticket provides the workaround (correct instructions).

from quarkus.

melloware avatar melloware commented on August 17, 2024

@Karm thanks i will monitor for PR's!

from quarkus.

michalvavrik avatar michalvavrik commented on August 17, 2024

@Karm thanks i will monitor for PR's!

yeah, we also need to know to change our tests, so let's all monitor instead of having a tracker that will notify us

from quarkus.

Related Issues (20)

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.