dbuenzli / topkg

The transitory OCaml software packager
http://erratique.ch/software/topkg
ISC License
69 stars 25 forks source link

topkg 0.7.1 does not install with opam root inside of git working copy #42

Closed dsheets closed 8 years ago

dsheets commented 8 years ago
#=== ERROR while installing topkg.0.7.1 =======================================#
# opam-version 1.2.2
# os           darwin
# command      ocaml pkg/pkg.ml build --pkg-name topkg --installer true
# path         /Users/dsheets/Code/pinata/opam-test/4.02.3/build/topkg.0.7.1
# compiler     4.02.3
# exit-code    1
# env-file     /Users/dsheets/Code/pinata/opam-test/4.02.3/build/topkg.0.7.1/topkg-72076-03b1a4.env
# stdout-file  /Users/dsheets/Code/pinata/opam-test/4.02.3/build/topkg.0.7.1/topkg-72076-03b1a4.out
# stderr-file  /Users/dsheets/Code/pinata/opam-test/4.02.3/build/topkg.0.7.1/topkg-72076-03b1a4.err
### stderr ###
# pkg.ml: [WARNING] Watermarks: OPAM fields of topkg.opam: topkg: no such command. Did you install topkg-care ?
# pkg.ml: [WARNING] file topkg.opam: opam field "maintainer" undefined or unsupported
# pkg.ml: [WARNING] file topkg.opam: opam field "authors" undefined or unsupported
# pkg.ml: [WARNING] file topkg.opam: opam field "homepage" undefined or unsupported
# pkg.ml: [WARNING] file topkg.opam: opam field "bug-reports" undefined or unsupported
# pkg.ml: [WARNING] file topkg.opam: opam field "doc" undefined or unsupported
# pkg.ml: [WARNING] file topkg.opam: opam field "license" undefined or unsupported
# pkg.ml: [WARNING] file topkg.opam: opam field "dev-repo" undefined or unsupported
# pkg.ml: [ERROR] Pin distribution preparation failed: .gitattributes: No such file or directory
dbuenzli commented 8 years ago

You are not pinning topkg right ? My guess is that one directory up is in the path is git-managed and that this tricks the vcs configuration key which makes it infer a `Pin build context. Could you please confirm my assumption is right.

Discovery of the vcs configuration variable uses Topkg_vcs.find which eventually leads to this git discovery which (unfortunately in this case) works robustly if you are a in a subdirectory of a git repository.

So I guess I should check something like: the returned git directory is the one where pkg/pkg.ml lies or some kind of similar condition.

dsheets commented 8 years ago

That is correct: I am not pinning topkg and the opam root is a subdirectory of a checked out git repository (but is not itself tracked).

dbuenzli commented 8 years ago

Apparently @pqwy ran into the same kind of issue. 7dfc295 should fix this, I'll make a new release promptly.