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 install <package> fails inside a project dir if <package> is a project dependency #920

Closed
joshsh opened this issue Jan 5, 2019 · 13 comments · Fixed by typelead/etlas#91
Labels

Comments

@joshsh
Copy link

joshsh commented Jan 5, 2019

I am trying to install the patch for Pandoc 2.5, per instructions here.

The etlas install step fails as follows:

$ etlas install pandoc
Resolving dependencies...
etlas: Cannot build the package pandoc, it is not in this project (either
directly or indirectly). If you want to add it to the project then edit the
cabal.project file.

However, pandoc is in fact listed under library/build-depends in the project.cabal, and is the reason that etlas build fails as follows:

Failed to build unix-2.7.2.2.
Build log (
/Users/joshsh/.etlas/logs/eta-0.8.6.2/unix-2.7.2.2-f35914fc1d8c6a3b9590bf1ab79e654b5f06997893ceb2ab1b8ee74415a2ff94.log
):
Configuring library for unix-2.7.2.2..
Preprocessing library for unix-2.7.2.2..
etlas: can't find source for System/Posix/Resource in ., dist/build/autogen,
dist/build/global-autogen
etlas: Failed to build unix-2.7.2.2 (which is required by u2-0.1). See the

In ./build/eta-freeze/dist/cache/solver-trace we can see that unix is a dependency of pandoc, which is a dependency of the project we are trying to build.

Your Environment

etlas 1.5.0.0, manually installed this morning per the installation guide. This is on Mac OS X 10.14.1.

@jneira
Copy link
Collaborator

jneira commented Jan 6, 2019

Hi, etlas install pandoc should build and install the package itself so it's a quick way to test the patch. However it is not needed to build a project that has pandoc as dependency (your actual user case, right?), etlas clean && etlas update && etlas build should do it applying the new patch if the build picks the version patched (2.5).

I've tried the same command inside a project in windows with a just downloaded etlas and i cant reproduce

PS C:\Users\Javier\dev\lang\eta\eta-test> etlas-1.5.0.0 install pandoc
Resolving dependencies...
In order, the following will be built (use -v for more details):
 - Win32-2.7.0.0 (lib) (requires build)
 - blaze-html-0.9.1.1 (lib) (requires build)
 - digest-0.0.1.2 (lib:digest) (requires build)
 - dlist-0.7.1.2 (lib) (requires build)
 - haddock-library-1.7.0 (lib) (requires build)
 - hxt-charproperties-9.2.0.1 (lib:hxt-charproperties) (requires build)
 - regex-base-0.93.2 (lib:regex-base) (requires build)
 - safe-0.3.17 (lib) (requires build)
 - split-0.2.3.3 (lib) (requires build)
 - syb-0.7 (lib) (requires build)
 - tagsoup-0.14.7 (lib) (requires build)
 - temporary-1.2.1.1 (lib) (requires build)
 - tf-random-0.5 (lib) (requires build)
 - th-abstraction-0.2.10.0 (lib) (requires build)
 - time-locale-compat-0.1.1.5 (lib) (requires build)
 - unicode-transforms-0.3.5 (lib) (requires build)
 - uuid-types-1.0.3 (lib) (requires build)
 - xml-1.3.14 (lib:xml) (requires build)
 - HTTP-4000.3.12 (lib) (requires build)
 - zip-archive-0.3.3 (lib) (requires build)
 - data-default-instances-dlist-0.0.1 (lib:data-default-instances-dlist) (requires build)
 - Glob-0.9.2 (lib) (requires build)
 - hxt-unicode-9.0.2.4 (lib:hxt-unicode) (requires build)
 - hxt-regex-xmlschema-9.2.0.3 (lib) (requires build)
 - regex-pcre-builtin-0.94.4.8.8.35 (lib:regex-pcre-builtin) (requires build)
 - QuickCheck-2.10.1 (lib) (requires build)
 - aeson-1.4.0.0 (lib) (requires build)
 - data-default-0.7.1.1 (lib:data-default) (requires build)
 - hxt-9.3.1.16 (lib) (requires build)
 - pandoc-types-1.17.5.4 (lib) (requires build)
 - doctemplates-0.2.2.1 (lib) (requires build)
 - aeson-pretty-0.8.7 (lib) (requires build)
 - skylighting-core-0.7.5 (lib) (requires build)
 - texmath-0.11.1.2 (lib) (requires build)
 - skylighting-0.7.5 (lib) (requires build)
 - pandoc-2.5 (lib) (requires build)
 - pandoc-2.5 (exe:pandoc) (requires build)
Found patch in eta-hackage for dlist-0.7.1.2
Found patch in eta-hackage for digest-0.0.1.2
Configuring dlist-0.7.1.2 (lib)...
Configuring digest-0.0.1.2 (all, legacy fallback)...
Configuring blaze-html-0.9.1.1 (lib)...
Configuring Win32-2.7.0.0 (lib)...
Building Win32-2.7.0.0 (lib)...
Building digest-0.0.1.2 (all, legacy fallback)...
Building dlist-0.7.1.2 (lib)...
Building blaze-html-0.9.1.1 (lib)...
Configuring haddock-library-1.7.0 (lib)...
Building haddock-library-1.7.0 (lib)...
Symlinking pandoc
etlas-1.5.0.0.exe: Symlinking feature not available on Windows

However it can't finalize the installation cause symlinking it is not supported in windows.
Maybe the executables for windows and mac os are different for some reason?

@rahulmutt
Copy link
Member

@joshsh You have done etlas update correct?

@jneira Yes, etlas install's symlinking step is known not to work on windows. We need to find an alternative. Perhaps we need to take a look at what Cabal does.

@joshsh
Copy link
Author

joshsh commented Jan 6, 2019

Hi @jneira, @rahulmutt. Yes, I did use etlas update. The commands etlas clean && etlas update && etlas build result in the build failure on unix-2.7.2.2 as above. Detailed output is below.

Perhaps etlas has the non-patched pandoc-2.5 cached, and is not fetching the patch?

$ etlas clean && etlas update && etlas build
cleaning...
Downloading the latest package lists from:
- hackage.haskell.org
- git@github.com/typelead/etlas-index
Updating binary package index.
To revert to previous state run:
    etlas update --index-state='2019-01-06T18:55:15Z'
Updating the eta-hackage patch set.
Resolving dependencies...
In order, the following will be built (use -v for more details):
 - JuicyPixels-3.3 (lib) (requires build)
 - lens-4.17 (lib) (requires build)
 - mwc-random-0.13.6.0 (lib) (requires build)
 - streaming-commons-0.1.19 (lib) (requires build)
 - texmath-0.11.1.2 (lib) (requires build)
 - tls-1.4.1 (lib) (requires build)
 - unix-2.7.2.2 (lib) (requires build)
 - zip-archive-0.3.3 (lib) (requires build)
 - foldl-1.2.5 (lib) (requires build)
 - cql-io-1.0.1.1 (lib) (requires build)
 - websockets-0.12.5.2 (lib) (requires build)
 - http-client-0.5.14 (lib) (requires build)
 - conduit-extra-1.3.0 (lib) (requires build)
 - connection-0.2.8 (lib:connection) (requires build)
 - unix-compat-0.5.1 (lib:unix-compat) (requires build)
 - http-client-tls-0.3.5.3 (lib) (requires build)
 - turtle-1.5.13 (lib) (requires build)
 - pandoc-2.5 (lib) (requires build)
 - http-conduit-2.3.2 (lib) (requires build)
 - rdf4h-3.1.1 (lib) (requires build)
 - u2-0.1 (lib) (first run)
Configuring unix-2.7.2.2 (lib)...
Configuring tls-1.4.1 (lib)...
Found patch in eta-hackage for mwc-random-0.13.6.0
Found patch in eta-hackage for JuicyPixels-3.3
Found patch in eta-hackage for streaming-commons-0.1.19
Found patch in eta-hackage for zip-archive-0.3.3
Found patch in eta-hackage for lens-4.17
Configuring mwc-random-0.13.6.0 (lib)...
Configuring JuicyPixels-3.3 (lib)...
Configuring streaming-commons-0.1.19 (lib)...
Configuring zip-archive-0.3.3 (lib)...
Configuring lens-4.17 (lib)...
Building unix-2.7.2.2 (lib)...
Building tls-1.4.1 (lib)...
Building mwc-random-0.13.6.0 (lib)...
Building JuicyPixels-3.3 (lib)...
Building zip-archive-0.3.3 (lib)...
Building streaming-commons-0.1.19 (lib)...
Building lens-4.17 (lib)...
Configuring texmath-0.11.1.2 (lib)...
Building texmath-0.11.1.2 (lib)...

Failed to build unix-2.7.2.2.
Build log (
/Users/joshsh/.etlas/logs/eta-0.8.6.2/unix-2.7.2.2-f35914fc1d8c6a3b9590bf1ab79e654b5f06997893ceb2ab1b8ee74415a2ff94.log
):
Configuring library for unix-2.7.2.2..
Preprocessing library for unix-2.7.2.2..
etlas: can't find source for System/Posix/Resource in ., dist/build/autogen,
dist/build/global-autogen
etlas: Failed to build unix-2.7.2.2 (which is required by u2-0.1). See the
build log above for details.

@rahulmutt
Copy link
Member

One way to verify is to check ~/.etlas/patches/patches and verify that pandoc-2.5.patch is present.

Also, can you attach the full solver trace?

@joshsh
Copy link
Author

joshsh commented Jan 7, 2019

Yes, the patch is listed in ~/.etlas/patches/patches:

pandoc-2.5.cabal
pandoc-2.5.patch
pandoc-types-1.17.5.4.cabal                                                                                                                                                                         
pandoc-types-1.17.5.4.patch

dist/cache/solver-trace is attached. Note that since writing the above, I have added the following to package.yaml:

- turtle >= 1.5.10 && < 1.5.11

This ties Turtle to the patched version 1.5.10; etlas otherwise uses 1.5.13, which depends on unix. The file dist/cache/solver-trace is attached.

solver-trace.txt

@rahulmutt
Copy link
Member

@joshsh This is strange - the solver trace has no mention of unix at all. Were you able to get it resolved?

@joshsh
Copy link
Author

joshsh commented Jan 8, 2019

I did get past the issue, although it was by using gradle instead of etlas (directly). If I run etlas build now, I run into the case sensitivity issue which was fixed in 0.8.6b3. etlas install pandoc still fails as above.

@jneira
Copy link
Collaborator

jneira commented Jan 8, 2019

Mmm, i wonder what difference between the windows executable and the mac os could cause different results.
@joshsh Could you try to do an etlas install pandoc outside a project folder (to be sure outside of the parent folder of any project one too)? Sharing the output with -v3 could be useful too.
@rahulmutt have you been able to reproduce it in a linux env?

@joshsh
Copy link
Author

joshsh commented Jan 8, 2019

@jneira yes, interestingly, etlas install pandoc succeeds from an empty directory outside of the project directory, and fails within the project directory.

The -v3 output (from within the project directory) is below.

$ etlas install pandoc -v3
File monitor 'config' unchanged.
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent etlas update
index-state(hackage.haskell.org) = 2019-01-08T15:35:00Z
Reading available packages of etlas.org...
Using most recent state (could not read timestamp file)
index-state(etlas.org) =
File monitor 'improved-plan' unchanged.
no user package environment file found at /Users/joshsh/projects/uber/data/u2
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --numeric-version
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta
is version 0.8.6.2
no user package environment file found at /Users/joshsh/projects/uber/data/u2
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg --version
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg
is version 0.8.6.2
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --supported-languages
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --info
Searching for java in path.
Found java at
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java -version
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java is
version 1.8.0.191
Searching for javac in path.
Found javac at
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/javac
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/javac -version
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/javac is
version 1.8.0.191
Reading installed packages...
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg dump --global -v0
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg dump '--package-db=/Users/joshsh/.etlas/store/eta-0.8.6.2/package.db' -v0
creating
/var/folders/51/8vvply0x1z92h6cdkjhjnvyc0000gn/T/cabal-install.-5148/dist
creating
/var/folders/51/8vvply0x1z92h6cdkjhjnvyc0000gn/T/cabal-install.-5148/dist/cache
File monitor 'improved-plan' changed: first run
File monitor 'elaborated-plan' changed: first run
File monitor 'compiler' changed: first run
Compiler settings changed, reconfiguring...
no user package environment file found at /Users/joshsh/projects/uber/data/u2
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --numeric-version
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta
is version 0.8.6.2
no user package environment file found at /Users/joshsh/projects/uber/data/u2
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg --version
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg
is version 0.8.6.2
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --supported-languages
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --info
Searching for java in path.
Found java at
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java -version
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java is
version 1.8.0.191
Searching for javac in path.
Found javac at
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/javac
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/javac -version
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/javac is
version 1.8.0.191
File monitor 'solver-plan' changed: first run
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta --print-global-package-db
Reading installed packages...
/Users/joshsh/.etlas/binaries/cdnverify.eta-lang.org/eta-0.8.6.2/binaries/x86_64-osx/eta-pkg dump --global -v0
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent etlas update
index-state(hackage.haskell.org) = 2019-01-08T15:35:00Z
Reading available packages of etlas.org...
Using most recent state (could not read timestamp file)
index-state(etlas.org) =
Searching for pkg-config in path.
Cannot find pkg-config on the path
Resolving dependencies...
Elaborating the install plan...
File monitor 'source-hashes' changed: first run
Updating plan.json
Improving the install plan...
?callStack, called at ./Distribution/Compat/Stack.hs:45:13 in etlas_Ienb7LiyMbVI4n0ghMVWeH:Distribution.Compat.Stack
  callStack, called at ./Distribution/Simple/Utils.hs:591:44 in etlas_Ienb7LiyMbVI4n0ghMVWeH:Distribution.Simple.Utils
  withCallStackPrefix, called at ./Distribution/Simple/Utils.hs:628:7 in etlas_Ienb7LiyMbVI4n0ghMVWeH:Distribution.Simple.Utils
  withMetadata, called at ./Distribution/Simple/Utils.hs:353:15 in etlas_Ienb7LiyMbVI4n0ghMVWeH:Distribution.Simple.Utils
  die', called at ./Distribution/Client/CmdInstall.hs:738:5 in etlas_0IBcOxS86gq2LHC0Nv7EFp:Distribution.Client.CmdInstall

etlas: Cannot build the package pandoc, it is not in this project (either
directly or indirectly). If you want to add it to the project then edit the
cabal.project file.
Cannot build the package pandoc, it is not in this project (either directly or
indirectly). If you want to add it to the project then edit the cabal.project
file.

@rahulmutt
Copy link
Member

@jneira I have not checked, but mostly it'll be the same. Windows is a known problem because of lack of symlinking. The alternative is to make a copy of the entire jar file to the destination and create a batch script like we do already.

@joshsh Yes, install within a project directory is not implemented yet - it requires some work. We'll keep this issue open to track that we need to fix the etlas install command in the context of a project.

@jneira
Copy link
Collaborator

jneira commented Jan 9, 2019

@rahulmutt sorry, but i wanted to refer to the etlas install pandoc inside a project dir throwing etlas: Cannot build the package pandoc... error. With a recent downloaded etlas i cant reproduce it in windows (but etlas build throws it correctly).

@jneira jneira pinned this issue Jan 22, 2019
@jneira jneira added the etlas label Jan 22, 2019
@jneira
Copy link
Collaborator

jneira commented Jan 22, 2019

Ok, i've reproduced the error in windows (it was easy in fact and i thought i had tested this case but something went wrong 🤔 ):

  • I've added pandoc == 2.5 in the build-depends section of .cabal file
  • I've run etlas install pandoc and voilà!

Removing pandoc from dependencies makes the command works again.
So it seems etlas thinks that if it is a package dependency it has to build as it was local, but it cant find it. The method to start the hunting would be Distribution.Client.ProjectOrchestration.resolveTargets

@jneira jneira changed the title Cannot install patch etlas install <package> fails inside a project dir if <package> is a project dependency Jan 22, 2019
@jneira jneira changed the title etlas install <package> fails inside a project dir if <package> is a project dependency etlas install <package> fails inside a project dir if <package> is a project dependency Jan 22, 2019
@jneira
Copy link
Collaborator

jneira commented Jan 22, 2019

cabal new-install pandoc since 2.2.0.0 works as intended inside a project with pandoc as dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants