Coder Social home page Coder Social logo

Comments (14)

ndmitchell avatar ndmitchell commented on June 11, 2024 1

@angerman Hadrian explicitly sets ChangeModtimeAndDigest in https://github.com/snowleopard/hadrian/blob/master/src/Main.hs which means it is only considered changed if the contents change.

from hadrian.

ndmitchell avatar ndmitchell commented on June 11, 2024 1

If you don't work with digests you aren't going to work with cloud caching - so it's worth getting it right as is.

from hadrian.

ndmitchell avatar ndmitchell commented on June 11, 2024

(I expect it also happens with at least the stage1/stage2 GHC binaries, and probably lots of other things...)

from hadrian.

angerman avatar angerman commented on June 11, 2024

ghc-8.7.conf is regenerated by doesn't change.

Doesn’t that change the modification time? Is that insufficient to trigger invalidation?

—-

What we need to do then is to actually read the conf file and depend on all the referenced libraries from within?

from hadrian.

angerman avatar angerman commented on June 11, 2024

@ndmitchell I see. Just to inline the code for everyone to see on github here we go:

hadrian/src/Main.hs

Lines 34 to 40 in 4265e3a

options = shakeOptions
{ shakeChange = ChangeModtimeAndDigest
, shakeFiles = buildRoot -/- Base.shakeFilesDir
, shakeProgress = progressSimple
, shakeRebuild = rebuild
, shakeTimings = True
, shakeExtra = extra }

Do we know what the impact on hadrian is when we allow modification time to trigger rebuilds?

All that said, I'm not much a fan of adding explicit dependencies to all targets. If we would automate that by reading the conf files and computing (discovering) the dependencies like that on the fly, that does seem to me like the better solution here.

from hadrian.

snowleopard avatar snowleopard commented on June 11, 2024

@angerman The improvements thanks to using digests instead of modtimes are significant, e.g. see the last section of the Hadrian paper.

Parsing conf sounds plausible but complicated. Adding explicit dependencies is a simple baseline solution that, I think, should be preferred. There aren't too many of such dependencies anyway, are there?

from hadrian.

angerman avatar angerman commented on June 11, 2024

I’ll try to get around to this later today. Let’s do this right and parse the dependencies automatically.

Alternatively I could imagine adding additional fields to he config file that more closely trac the contents of the package.

from hadrian.

snowleopard avatar snowleopard commented on June 11, 2024

@angerman Before you write a lot of new code, could you show an example of the kind of dependency information you'd like to parse? Why is it not available statically? Is it really worth turning it into dynamic?

Hadrian already got a lot more complexity compared to the Make build system, which makes it hard to understand and maintain. We need to be careful about adding more.

from hadrian.

snowleopard avatar snowleopard commented on June 11, 2024

To clarify the static vs dynamic bit: it's much easier to understand/debug build rules containing

need [x, y, z]

compared to

need =<< parse x

from hadrian.

ndmitchell avatar ndmitchell commented on June 11, 2024

I was assuming there was a 1-1 mapping between foo.conf and libHSfoo.a - if so parsing seems overkill. Where is it more complex than that?

from hadrian.

angerman avatar angerman commented on June 11, 2024

Neil, that’s basically what I’m trying to go for. I believe this might get more complicated once cabals multi lib support lands. I’m not sure how fast that would be used within ghc though.

Andrey, I prefer not to have to write any code at all. I do prefer generic rules over hardcoded values as they provide the least surprise when the packages change. I think hadrian excels at what it does if it completely faded into the background for anyone working on ghc.

from hadrian.

snowleopard avatar snowleopard commented on June 11, 2024

I do prefer generic rules over hardcoded values as they provide the least surprise when the packages change

I'm not suggesting we hard-code dependencies for each package separately. What we can do now is to simply depend on pkgLibraryFile, which we already defined and use elsewhere in the codebase.

Later, if/when Hadrian needs to support multiple libraries per package, we'll just switch to pkgLibraryFiles. Sounds simple and generic enough to me. How could this go wrong?

from hadrian.

snowleopard avatar snowleopard commented on June 11, 2024

I reproduced and will attempt to fix today.

from hadrian.

snowleopard avatar snowleopard commented on June 11, 2024

@ndmitchell It turned out that we did have all necessary dependencies, but due to a recently introduced bug they were accidentally dropped. To prevent such regressions in future I added some tests.

#657 solves the issue for me.

from hadrian.

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.