profile
viewpoint

issue closedmirage/mirage

[RFC] building the solo5/MirageOS's runtime

This issue discuss the best way to organise and build the C code which forms the (C) runtime of MirageOS on solo5.

Current Status: MirageOS 3

The C runtime for solo5/MirageOS 3.* is composed of 3 components:

The other device packages just contain pure OCaml code or externals calling the solo5 runtime (e.g. all the mirage-<device>-solo5 package) or the freestanding runtime (e.g. the mirage-<device>-freestanding).

There are some extra packages defining new C code (for instance gmp) which need to be cross-compiled - it's a special-case in mirage3 : they are usually called (<pkg>-freestanding) and they contain custom build rules.

Current build strategy

  • solo5 bindings are packaged with pkg-config, every bindings has a solo5-bindings-<bindings>.pc file installed.
  • solo5 bindings have conflicting opam packages - there is only one "current" bindings in a given switch
  • freestanding queries the current solo5 bindings (with pkg-config) and use the result to set its C flags ; this means that there is only one freestanding package, compiled for the current solo5 bindings ; e.g. freestanding archves cannot be co-built (and co-installed) for different solo5 bindings.
  • the OCaml runtime is built using the same flags as the freestanding archives and also includes to the local freestandings headers ; so there only one runtime can be built (and installed) at the same time, using the "current" solo5 bindings.
  • freestanding archives and the OCaml runtime are also installed using pkg-config. Which means that C bindings can query these (like gmp-freestanding) but which also mean that these are built only using the "current" solo5 bindings too.

Next: MirageOS 4.0

The goal is to allow the compilation (and co-installation) of multiple MirageOS runtime in the same build environment. It is not clear to me that the current split is the right one for MirageOS 4.0, but I am not sure what is the best way forward.

One possible (but maybe extreme) way to do this -- that I've prototyped the new dune integration -- is to create a new ocaml-solo5 repository where all the C runtime is vendored in one place and where all the C archives are built and installed for all the existing bindings. I'm now trying to split that prototype to submit upstream patches such as https://github.com/Solo5/solo5/pull/472 but the resulting PR are a bit noisy (as dune requires packages to list all of their installed files) and might get difficult to maintain.

So I'm wondering if it makes sense to keep a very simple (probably Makefile-based) build system in solo5, ocaml-freestanding and ocaml-runtime and just use ocaml-solo5 to store the (more complex) build runes which allow all of these packages to be co-installable and x-compiled.

I'm open to better/simpler ideas so please add your feedback :-)

closed time in 41 minutes

samoht

issue commentmirage/mirage

[RFC] building the solo5/MirageOS's runtime

I'm closing this since @TheLortex is now tracking this on #1195

samoht

comment created time in 41 minutes

issue commentraphw/byte-buddy

about compile

You want to transform classes without a build tool? Yes, this is possible using the Plugin.Build.Engine. The Byte Buddy jar even defines a manifest that allows you to run a transformation using it.

SoftSquirrel

comment created time in 16 hours

issue commentraphw/byte-buddy

Gradle plugin fails on incomplete classpath

You should define an EntryPoint that does not do as much as you know you do not match any methods anyways. You can do so in the transformation closure. Try new ByteBuddy().with(MethodGraph.Compiler.ForDeclaredMethods.INSTANCE.

bsideup

comment created time in 17 hours

issue closedralfbiedert/cheats.rs

Weaknesses: embedded

Is it accurate? As someone who is just starting to look into Rust, I wonder about this myself and found a conflict:

This was added as a weakness on June 7.

https://github.com/ralfbiedert/cheats.rs/commit/ab76da5b2659ffc5d23fe25c0e11447edf65ea42#diff-200abda264c3530e9cdb5d895e25d50bc3ed567079b39fe2ee3c1d1b5d661e09R170

This seems contrary to Rust, which has a full page on the benefits of using Rust in embedded settings:

https://www.rust-lang.org/what/embedded

closed time in a day

avindra

fork santosoide/pagedraw

a UI builder for React web apps

https://pagedraw.io/

fork in a day

startedPagedraw/pagedraw

started time in a day

issue commentosl/jcute

Unable to run jcutegui.bat file

If you all tried to clone from github and run jcutegui, I think you might have missed building the dependencies like me. The binary distribution from their website (http://osl.cs.illinois.edu/software/jcute/index.html) works out of the box for me.

sunilmethuku

comment created time in 2 days

issue openedraphw/byte-buddy

Gradle plugin fails on incomplete classpath

Hi! I am trying to use the Gradle plugin to apply some post transformations on a shadowed jar. Coincidentally enough, the project shades ByteBuddy :)

Since ByteBuddy agent has optional dependencies (JNA), the plugin seems to fail to handle it and fails with:

Caused by: java.lang.IllegalStateException: Cannot resolve type description for com.sun.jna.Library
        at net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:157)
        at net.bytebuddy.pool.TypePool$Default$WithLazyResolution$LazyTypeDescription.delegate(TypePool.java:912)
        at net.bytebuddy.description.type.TypeDescription$AbstractBase$OfSimpleType$WithDelegation.getTypeVariables(TypeDescription.java:8376)
        at net.bytebuddy.description.type.TypeDescription$AbstractBase.isGenerified(TypeDescription.java:8009)
        at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Reifying.onNonGenericType(TypeDescription.java:1678)
        at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Reifying$1.onNonGenericType(TypeDescription.java:1634)
        at net.bytebuddy.description.type.TypeDescription$Generic$OfNonGenericType.accept(TypeDescription.java:3783)
        at net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection.accept(TypeDescription.java:6301)
        at net.bytebuddy.dynamic.scaffold.MethodGraph$Compiler$Default.doAnalyze(MethodGraph.java:632)
        at net.bytebuddy.dynamic.scaffold.MethodGraph$Compiler$Default.compile(MethodGraph.java:567)
        at net.bytebuddy.dynamic.scaffold.MethodGraph$Compiler$AbstractBase.compile(MethodGraph.java:465)
        at net.bytebuddy.dynamic.scaffold.MethodRegistry$Default.prepare(MethodRegistry.java:471)
        at net.bytebuddy.dynamic.scaffold.inline.RebaseDynamicTypeBuilder.make(RebaseDynamicTypeBuilder.java:224)
        at net.bytebuddy.build.Plugin$Engine$Default$Preprocessor$Resolved.call(Plugin.java:4498)
        at net.bytebuddy.build.Plugin$Engine$Default$Preprocessor$Resolved.call(Plugin.java:4455)
        at net.bytebuddy.build.Plugin$Engine$Dispatcher$ForSerialTransformation.accept(Plugin.java:3538)
        at net.bytebuddy.build.Plugin$Engine$Default.apply(Plugin.java:4302)

Reproducer:

import net.bytebuddy.build.gradle.ByteBuddyJarTask
import net.bytebuddy.description.type.TypeDescription
import net.bytebuddy.dynamic.ClassFileLocator
import net.bytebuddy.dynamic.DynamicType

plugins {
    id 'java'
    id "com.github.johnrengelman.shadow" version "4.0.2"
    id 'net.bytebuddy.byte-buddy-gradle-plugin' version '1.10.18'
}

repositories {
    jcenter()
}

shadowJar {
    dependsOn(project.tasks.jar)
}
project.tasks.build.dependsOn(shadowJar)

class DummyPlugin implements net.bytebuddy.build.Plugin {

    @Override
    boolean matches(TypeDescription target) {
        return true;
    }

    @Override
    DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator) {
        System.out.println("Transforming " + typeDescription);
        return builder;
    }

    @Override
    void close() throws IOException {

    }
}

task pp(type: ByteBuddyJarTask) {
    dependsOn(tasks.shadowJar)
    source = tasks.shadowJar.outputs.files.singleFile
    target = new File(tasks.shadowJar.outputs.files.singleFile.toString() + ".pp.jar")
    classPath = configurations.shaded

    transformation {
        plugin = DummyPlugin.class
    }
}

dependencies {
    compile 'net.bytebuddy:byte-buddy-agent:1.10.9'
}

Since all I needed was to add an annotation, I was hoping I can do that without having to provide the full classpath (which is kinda hard to do given that it is unknown to me when I think about all shaded dependencies)

created time in 2 days

issue closeddspinellis/UMLGraph

I can't get UMLGraph to work in Java 1.8

I can't get UMLGraph to work in Java 1.8.

No right CSS files generated to Javadocs with UML.

closed time in 2 days

foghorn-hash

issue commentdspinellis/UMLGraph

I can't get UMLGraph to work in Java 1.8

Actually I possible haves error in source code of my Maven 3 project because an another project generates the correctly made Javadocs with UML with Jenkins.

foghorn-hash

comment created time in 2 days

issue commentdspinellis/UMLGraph

I can't get UMLGraph to work in Java 1.8

Thank you for the report! Did it work in your environment with previous Java versions? Does the problem only affect CSS files? What other files are generated?

foghorn-hash

comment created time in 2 days

issue commentralfbiedert/cheats.rs

Weaknesses: embedded

Thanks for the report. Our site currently reads:

Points you might run into:

  • missing Rust-native libs in some domains, target platforms (esp. embedded), IDE features

The page you link mentions as embedded strengths:

  • Powerful static analysis
  • Flexible memory
  • Fearless concurrency
  • Interoperability
  • Portability
  • Community driven

I don't think there is a conflict. If Rust runs on your device you get all these benefits.

Unfortunately, Rust only runs on a "relatively small" subset of all possible hardware. Platforms with no or only very limited Rust support, but good C support include:

  • most gaming consoles
  • GPUs
  • most hardware outside the 32-64 bit range
avindra

comment created time in 2 days

issue openedralfbiedert/cheats.rs

Weaknesses: embedded

Is it accurate? As someone who is just starting to look into Rust, I wonder about this myself and found a conflict:

This was added as a weakness on June 7.

https://github.com/ralfbiedert/cheats.rs/commit/ab76da5b2659ffc5d23fe25c0e11447edf65ea42#diff-200abda264c3530e9cdb5d895e25d50bc3ed567079b39fe2ee3c1d1b5d661e09R170

This seems contrary to Rust, which has a full page on the benefits of using Rust in embedded settings:

https://www.rust-lang.org/what/embedded

created time in 2 days

issue openedraphw/byte-buddy

Error transforming FacesServlet

Our Jetty 9.4 tests started failing recently, apparently following the latest 9.4 release. Reproducing it locally, I got the following retransformation-related error:

[jetty] 2020-11-23 06:33:15,578 [Attach Listener] DEBUG co.elastic.apm.agent.bci.ElasticApmAgent - Error invoking java.lang.instrument.Instrumentation#retransformClasses
[jetty] java.lang.IllegalStateException: Error invoking java.lang.instrument.Instrumentation#retransformClasses
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Dispatcher$ForJava6CapableVm.retransformClasses(AgentBuilder.java:6916) ~[?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector$ForRetransformation.doApply(AgentBuilder.java:7187) ~[?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Collector.apply(AgentBuilder.java:7032) [?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy.apply(AgentBuilder.java:4868) [?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$Default.doInstall(AgentBuilder.java:9502) [?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$Default.installOn(AgentBuilder.java:9423) [?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$Default$Delegator.installOn(AgentBuilder.java:11025) [?:?]
[jetty] at co.elastic.apm.agent.bci.ElasticApmAgent.initInstrumentation(ElasticApmAgent.java:261) [?:?]
[jetty] at co.elastic.apm.agent.bci.ElasticApmAgent.initInstrumentation(ElasticApmAgent.java:164) [?:?]
[jetty] at co.elastic.apm.agent.bci.ElasticApmAgent.initialize(ElasticApmAgent.java:150) [?:?]
[jetty] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
[jetty] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?]
[jetty] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
[jetty] at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
[jetty] at co.elastic.apm.agent.bci.AgentMain.init(AgentMain.java:119) [elastic-apm-agent-b41211a1ba26a466d8245d6f0fdbe7fa.jar:?]
[jetty] at co.elastic.apm.agent.bci.AgentMain.agentmain(AgentMain.java:69) [elastic-apm-agent-b41211a1ba26a466d8245d6f0fdbe7fa.jar:?]
[jetty] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
[jetty] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?]
[jetty] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
[jetty] at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
[jetty] at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513) [?:?]
[jetty] at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:535) [?:?]
[jetty] Caused by: java.lang.InternalError
[jetty] at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method) ~[?:?]
[jetty] at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:167) ~[?:?]
[jetty] at jdk.internal.reflect.GeneratedMethodAccessor46.invoke(Unknown Source) ~[?:?]
[jetty] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
[jetty] at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
[jetty] at net.bytebuddy.agent.builder.AgentBuilder$RedefinitionStrategy$Dispatcher$ForJava6CapableVm.retransformClasses(AgentBuilder.java:6908) ~[?:?]
[jetty] ... 21 more

After some investigation, it seemed that this error occurs in the attempt to retransform the javax.faces.webapp.FacesServlet class that comes from the myfaces 2.2.12 jar. Upgrading to 2.3.2 seems to solve the issue, so I am not digging further into it at the moment, although the retransformation error remains.

The original and transformed bytecode can be found in FacesServlet_bytecode.zip. A quick look didn't reveal anything to me. We are applying this advice as well as these two.

I hope this provides enough info in order to find the problem.

created time in 2 days

issue closedraphw/byte-buddy

How to mock a loaded class?

` public class Tester{

public static void test2() {

    ByteBuddyAgent.install();
    AgentBuilder.Transformer transformer = new AgentBuilder.Transformer() {
        @Override
        public DynamicType.Builder<?> transform(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassLoader classLoader, JavaModule javaModule) {
            return builder.method(ElementMatchers.any()).intercept(MethodDelegation.to(MockInterceptor.class)); 
        }
    };

    new AgentBuilder
            .Default()
            .type(ElementMatchers.any())
            .transform(transformer)
            .with(new AgentListener())
            .installOnByteBuddyAgent();
}

public static void test1() {
    Man man = new Man();
    man.doNothing();
}
public static void main(String[] args) 
    Tester.test1();
    Tester.test2();
    Tester.test1();
}

} `

if Tester.test1() run before Tester.test2(), can't delegate the man.doNothing().
I want to delegate the method in dynamic for mocking method. (not in premain, target class may be loaded.) if I use advice, I can't find the way to mock a result and skip the @method. how to do ? Thanks.

closed time in 2 days

lwsbox

issue commentraphw/byte-buddy

How to mock a loaded class?

Yes!

Thanks a lot. I have done what I need with your help.

lwsbox

comment created time in 2 days

issue openeddspinellis/UMLGraph

I can't get UMLGraph to work in Java 1.8

I can't get UMLGraph to work in Java 1.8.

No right CSS files generated to Javadocs with UML.

created time in 3 days

push eventralfbiedert/cheats.rs

Ralf Biedert

commit sha 4bc24bfc5bfbbc8ee9a975e9357ecd6a0bd0e7d1

Removed 2 broken links.

view details

push time in 3 days

push eventralfbiedert/cheats.rs

Ralf Biedert

commit sha 08870b8a1f6915888402e1bd89f7872df07ca95c

Document new documentation features; const generics MVP; use hellip.

view details

push time in 3 days

fork santosoide/ecommerce

ECommerce application built with Gatsby, React, Tailwind, Netlify and Netlify CMS

fork in 3 days

startedgustavomonjardim/ecommerce

started time in 3 days

startedjamstack-cms/jamstack-cms

started time in 3 days

issue openedraphw/byte-buddy

about compile

How to compile jar file without gradle or maven? Can I compile the jar file using only source code ?

created time in 3 days

startedopencv/opencv

started time in 4 days

startedhumanwhocodes/momoa

started time in 4 days

startedJoviDeCroock/hoofd

started time in 4 days

MemberEvent

created repositorywhite105/my-website

the best website ever

created time in 4 days

startedAzure/fetch-event-source

started time in 5 days

more