Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prelude.utils.mapBuildInfo. #172

Merged

Conversation

quasicomputational
Copy link
Collaborator

IMO, this is a function that highlights how dhall-to-cabal is an advance on hpack: the best feature of hpack, setting ghc-options at the top level and then having them apply to all components without any per-component effort, is now really easy to implement. It was writable before the latest Dhall version, but record projection by expression turns it from horrible to just mildly repetetive.

Tests are actually passing but I don't think its ready to merge on two counts:

@ocharles
Copy link
Member

#1009 is merged now, but I don't understand the second point. What's wrong with HTTP URLs?

@quasicomputational
Copy link
Collaborator Author

Ah, it's the non-self-containment, and how it'll hit the network at runtime. A secondary problem is that it's mutable, so there's no guarantee that the Dhall being fetched will work with the user's version.

A third option occurs to me: we could run dhall resolve at build time and distribute a 'statically linked' version of dhall/, which has the benefit of clean source but also self-containment for users.

@ocharles
Copy link
Member

Ah, it's the non-self-containment, and how it'll hit the network at runtime

Only if it's not in the cache.

A secondary problem is that it's mutable, so there's no guarantee that the Dhall being fetched will work with the user's version.

That's just a case for versioning. We do have Git tag's that we should be using, and we should be using dhall freeze to add hashes for caching compatibility.

Would that be sufficient?

@quasicomputational
Copy link
Collaborator Author

I guess the cache is OK, though making sure it's filled is presently a bit clunky.

OK - let's go with HTTP; if it turns out to be a problem, there are always options.

@quasicomputational quasicomputational marked this pull request as ready for review August 18, 2019 08:03
@quasicomputational
Copy link
Collaborator Author

I've done some further thinking, and I realised that HTTP doesn't necessarily mean hitting the network - it's imaginable that, e.g., Dhall will get clever enough that it'll be able to resolve HTTP imports by using provided signed HTTP exchanges. That it's liable to hit the network today, and preventing that relies on the vagaries of cache invalidation, is unfortunate.

@quasicomputational
Copy link
Collaborator Author

Blocked on dhall-lang/dhall-lang#670, for version-pinned imports of the prelude from dhall-lang.org.

@quasicomputational
Copy link
Collaborator Author

Ah, and also on #179, because of that projection bug that was fixed in 1.25.

@quasicomputational quasicomputational merged commit a9db1e6 into dhall-lang:master Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants