Comments (14)
@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.
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.
(I expect it also happens with at least the stage1/stage2 GHC binaries, and probably lots of other things...)
from hadrian.
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.
@ndmitchell I see. Just to inline the code for everyone to see on github here we go:
Lines 34 to 40 in 4265e3a
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.
@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.
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.
@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.
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.
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.
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.
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.
I reproduced and will attempt to fix today.
from hadrian.
@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)
- Rules for rts/rts.cabal are broken HOT 15
- Should Hadrian build ghctags and haddock in Stage1? HOT 3
- Documentation broken HOT 2
- Custom build root does not work on Windows HOT 2
- Symlink traversing logic in build scripts HOT 25
- GHC testsuite rules status HOT 25
- Reduce the number of times a Cabal file is parsed HOT 13
- Improve documentation of predicates
- Build more variants of profiled runtime systems (normal, threaded, debug, threaded debug, ...) ? HOT 8
- Consider using Azure for CI HOT 1
- testsuite: support figuring out the list of tests from $PWD HOT 1
- testsuite: add CLI flag for specifying extra options to pass to ghc HOT 1
- rts: buggy handling of non-trivial dynamic flavours of the library HOT 14
- ctrl + c doesn't cancel build on windows HOT 5
- Building on windows is broken. HOT 23
- --integer-simple is broken HOT 40
- Hadrian has been merged into GHC proper HOT 4
- `happy` is not properly auto built in a fresh install HOT 11
- Issue on Trac: 15908 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hadrian.