Coder Social home page Coder Social logo

Comments (6)

sigurdm avatar sigurdm commented on July 28, 2024 1

And I'm thinking, it's probably cleanest to already invoke the build hook to produce the native assets during dart pub global activate and not during dart pub global run. (But we don't precompile the Dart code on activate judging from shell script in bin/.)

We do precompile - except for when the package is global activated from path.

We also support recompilation if the snapshot was compiled with a different VM.

from sdk.

dcharkes avatar dcharkes commented on July 28, 2024

Thanks for the report @lindeer!

We don't have support yet for pub global run.

I would have expected the error message to complain that the experiment is required instead of run as if there are no native assets.

Just to double check, everything works fine when doing dart run --enable-experiment=native-assets mylib:mylib?

(Also, transferring this to the Dart SDK repo, as it should be implemented there.)

from sdk.

dcharkes avatar dcharkes commented on July 28, 2024

FYI @jonasfj @sigurdm

from sdk.

dcharkes avatar dcharkes commented on July 28, 2024

@jonasfj @sigurdm What would be a good way to save the binaries for pub global activated packages produced by the build hook.

And I'm thinking, it's probably cleanest to already invoke the build hook to produce the native assets during dart pub global activate and not during dart pub global run. (But we don't precompile the Dart code on activate judging from shell script in bin/.)

from sdk.

lindeer avatar lindeer commented on July 28, 2024

Just to double check, everything works fine when doing dart run --enable-experiment=native-assets mylib:mylib?

yeah, everything is OK when I run dart run.

from sdk.

dcharkes avatar dcharkes commented on July 28, 2024

After some offline discussion with @jonasfj and @sigurdm, this should probably be addressed by dart pub (package:pub) no longer manually compiling Dart to jit snapshots, but by dart pub invoking dart build exe (package:dartdev) so that dartdev is responsible for building dart code and bundling native assets. dart-lang/pub#4313

(Instead of trying to patch what pub is currently doing.)

from sdk.

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.