-
Notifications
You must be signed in to change notification settings - Fork 212
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 --transitive
flag to dhall {format,lint,freeze}
#1880
Conversation
The `dhall {format,lint,freeze}` commands take a new `--transitive` flag which can be used instead of `--inplace` to also modify any transitive dependencies that can be reached via relative file imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite lovely!
The similarity between format
, freeze
and lint
has me itching to extract some kind of harness that each of them could use, but that might end up creating some incomprehensible mess…
Remote{} -> | ||
ignore | ||
|
||
Missing -> | ||
ignore | ||
|
||
Env{} -> | ||
ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[style|curiosity] why don't you use _
to catch all these cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mainly so that I get a warning if we ever extend the language to handle other import types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superficially, LGTM!
Maybe @sjakobi could have another comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more optional nits. Great job, anyway! :)
I'm restarting for now to see if the problem persists |
The test failure is further up in the log:
Maybe that test should be turned into a simple example… |
This is great! I wanted to chime in though to say that running this locally on some private libraries has resulted in >20 minute freezes. Trying to figure out what's causing the biggest shift in perf |
@thebritican: My guess is that it's most likely due to the use of |
Would you say —cache is not best practice for authoring libraries? Seems necessary but I haven’t thought through the workflow implications of not using —cache |
@thebritican: One of my goals is to replace the It would fix several issues, including this one |
@thebritican: Also, in general you should probably not need cache for internal use cases. The original reason |
Hmmm, this branch keeps failing in AppVeyor on the |
Oh, never mind. It does log why it failed. I was just looking in the wrong place |
@sjakobi: I'm going to remove some of the doctests because they are platform-sensitive (i.e. they produce a different result on Windows) |
Unfortunately, the useful tests were failing on Windows due to path rendering being platform-specific
I guess the alternative would be to move them behind a bit of CPP:
…although that seems a bit awkward too. Also note that Hydra has unfortunately OOM'd in the last job… |
@sjakobi: Alright, I'll try the CPP approach |
... but with `CPP` this time so that the test doesn't run on Windows
Tried this without |
@thebritican: I think the main thing to check is a deep and linear import chain. That seems like the most likely thing to trigger an unexpected non-linear time complexity |
Shall I start a new issue to discuss this on this repo? Or the discourse link? It's related to import performance that this tool performs very slowly against, but it's also a more general problem. The problem import chain:
Example of a very condensed and rough approximation of library structure: -- OurK8s/Resource/Deployment.dhall
let k8s = ./dependencies/dhall-kubernetes.dhall
let standardize
: Options {- mostly flat record w/ primitives -} -> k8s.Deployment.Type -> k8s.Deployment.Type
= \(options : Options) -> \(deployment : k8s.Deployment.Type) ->
withX options (withY options (withZ options deployment)))
in { standardize, withX, withY, withZ } -- OurK8s/Resource/package.dhall
{ Deployment = ./Deployment.dhall, Service = ./Service.dhall, ... } -- OurK8s/Role/package.dhall (a "role" combines resources often into a single document)
let k8s = ./dependencies/dhall-kubernetes.dhall
let OurResource = ./Resource/package.dhall
let role
: MoreTuning -> k8s.Deployment.Type -> List k8s.Resource.Type
= \(options : MoreTuning) -> \(deployment : k8s.Deployment.Type) ->
[ k8s.Resource.Deployment (OurResource.Deployment.standardize (somethingWithOptions options)
, k8s.Resource.Service (OurResource.Service.fromOptions options)
, ...
] There was a massive increase in performance once those two packages were removed. The import chain in other $ time dhall --file ./Kubernetes/package.dhall > /dev/null # today's speed
real 0m29.908s
user 0m28.871s
sys 0m0.957s
$ time dhall --file ./Kubernetes/package.dhall > /dev/null # remove `Kubernetes.Role` from the record
real 0m4.952s
user 0m4.736s
sys 0m0.189s
$ time dhall --file ./Kubernetes/package.dhall > /dev/null # remove `Kubernetes.Role,Resource` from the record
real 0m1.163s
user 0m1.086s
sys 0m0.072s |
@ thebritican I am also experiencing such massive increase in performance when trying to provide a high level interface to dhall-kubernetes. I am not sure if there is a specific issue for this already (but it has been discussed in discourse). |
@thebritican: We can continue the discussion on #1890 |
Fixes #1551
The
dhall {format,lint,freeze}
commands take a new--transitive
flag which can be used instead of
--inplace
to also modify anytransitive dependencies that can be reached via relative file imports.