Skip to content

Conversation

@f-f
Copy link
Member

@f-f f-f commented Sep 28, 2022

This PR adds a migrate command, to convert existing Dhall configurations to the new-style YAML configurations that the next-version (codenamed "spaghetto") will be using.

The command tries to read in the URL of the package set, converts it to a pointer to the JSON version (that Spaghetto can read), and dumps that and the rest of the configuration into a fresh configuration that can be used for the build.

A few notes:

  • there's a test that checks the generated config against a fixture, but we're not checking if the config works with the new Spago. This is mostly because the config format is not yet set in stone - we should wait until some users try the first alpha of Spaghetto before committing to this
  • we issue a warning about the fact that we are not converting user's overrides to the package set. This is because doing so is a little involved, and I'm focused on getting Spaghetto's alpha off the ground at the moment - however I left a few pointers in the source so if anyone's interested in implementing this I can provide guidance
  • right now we are converting the url of the package set to another url - however it would be way better (for cache-hits reasons, as we'd fetch things from the registry instead of cloning repos) to use the package sets from the registry (this is done by using the syntax registry: 0.1.0 instead of e.g. url: https://... in the set: section). We should probably add a flag along the lines of --use-registry-set for folks that want to opt into the new sets.

@f-f f-f merged commit 16f689c into master May 4, 2023
@f-f f-f deleted the migrate-command branch May 4, 2023 16:23
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