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

Etlas doesn't seem to use latest version of package #11

Open
AlexeyRaga opened this issue Aug 9, 2017 · 2 comments
Open

Etlas doesn't seem to use latest version of package #11

AlexeyRaga opened this issue Aug 9, 2017 · 2 comments

Comments

@AlexeyRaga
Copy link
Contributor

State

I have the following packages currently published for eta:

eta-kafka-client-0.5.0
eta-kafka-client-0.5.1
eta-kafka-conduit-0.5.0
eta-kafka-conduit-0.5.1

They are registered in https://github.com/typelead/etlas-index/tree/master/packages

Steps

In a new Eta project (etlas init):

  1. reference both packages in .cabal without specifying the version :
  build-depends:        base >=4.8 && <4.9
                      , eta-kafka-client
                      , eta-kafka-conduit
  1. etlas update

  2. etlas install --dependencies only

Resolving dependencies...
Configuring eta-kafka-conduit-0.5.1...
Building eta-kafka-conduit-0.5.1...
Failed to install eta-kafka-conduit-0.5.1
Build log ( /Users/araga/.etlas/logs/eta-0.0.9.1/eta-kafka-conduit-0.5.1-6voahL7UFAK6qLtkfQzOuM.log ):
etlas: Entering directory '/var/folders/3x/l50y6rts50j_9jqyp0fl7lqh0000gn/T/etlas-tmp-87470'
Configuring eta-kafka-conduit-0.5.1...
Preprocessing library for eta-kafka-conduit-0.5.1..
Building library for eta-kafka-conduit-0.5.1..
[1 of 3] Compiling Kafka.Conduit.Source ( src/Kafka/Conduit/Source.hs, dist/build/Kafka/Conduit/Source.jar )

src/Kafka/Conduit/Source.hs:27:34:
    Couldn't match type ‘ghc-prim-0.4.0.0:GHC.CString.JByteArray’
                   with ‘ByteString’

This happens because etlas correctly chooses the latest version of eta-kafka-conduit (0.5.1), but for kafka-client it solves version 0.5.0 instead of the latest.

I did have 0.5.0 it etlas install'ed before, and I see it in my ~/.etlas/packages/etlas.typelead.com, but version 0.5.1 is not there despite etlas update.

So etlas somehow chooses to ignore newer version in favour of an oldest one.

Expected behaviour

I expected that etlas finds out and uses the latest version of the package when no constraints are specified in .cabal (up to etlas update time).

Workaround

Specifying constraints in .cabal helps:

  build-depends:        base >=4.8 && <4.9
                      , eta-kafka-client > 0.5.0
                      , eta-kafka-conduit > 0.5.0
@rahulmutt
Copy link
Member

The default behaviour is to use the latest version that is installed already, as long as it matches the existing constraints. Do you think it may be better to have it automatically upgrade the package instead?

@rahulmutt
Copy link
Member

One way to get the behaviour you want is to use the --allow-newer flag when you install. In fact, I really want to make this flag a default since it just makes dependency resolution a whole lot simpler.

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

No branches or pull requests

2 participants