Giter VIP home page Giter VIP logo

Comments (5)

maowtm avatar maowtm commented on May 18, 2024

Also not sure if we should repeat the arguments in the end call. (i.e. _operator_env_end(id, "key", "value")) For all internal operators this is not needed as these things can be tracked in rust code, but a user writing their own operators may find those useful...

from modus.

mechtaev avatar mechtaev commented on May 18, 2024

@maowtm, thanks for summarizing the discussion. This feels like a macro

$x::with_std(std) => $x::in_env("CFLAGS", f"-std=${std}")

Do we need overlapping regions?

It will be even more interesting if it was possible to define custom cache invalidation conditions. For example, define cache invalidation conditions for git/hg/svn, etc, given some basic intrinsics.

from modus.

maowtm avatar maowtm commented on May 18, 2024

@mechtaev

This feels like a macro

Yes, and in fact if we don't consider any internal implementation at all what I had is actually quite a bad syntax. Your macro-style definition is much better IMO. But I just proposed this because it is easy to implement and fits into our internal model. A bit of leaky abstraction I guess.

Do we need overlapping regions?

Probably not.

Custom cache invalidation conditions

Not sure how this would work and what would be the use, as usually people would want to rebuild the thing if source has a new commit...?

from modus.

mechtaev avatar mechtaev commented on May 18, 2024

I had a discussion with @barr, and he suggested to use operators that define conditions of cache invalidation. We were thinking of something like that:

  • ::no_cache always invalidate the cache
  • ::invalidate_cache_if_before(CMD) invalidate cache if CMD, executed before the layer is applied, returns non-exit code.
  • ::invalidate_cache_if_after(CMD) invalidate cache if CMD, executed after the layer is applied, returns non-exit code.
  • ::invalidate_cache_if_changed(PATH) invalidate cache if the file/directory changes after the layer is applied.

This is just a rough sketch of the API.

from modus.

mechtaev avatar mechtaev commented on May 18, 2024

Or maybe something like ::invalidate_cache_if_different(CMD_BEFORE, CMD_AFTER)

from modus.

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.