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

delete vendor directory when installing lsp #260

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

rgrinberg
Copy link
Member

Fix #259

@rgrinberg rgrinberg merged commit 94e2c42 into ocaml:master Oct 19, 2020
@Gbury
Copy link
Collaborator

Gbury commented Oct 21, 2020

I think you forgot to re-generate the opam file (you edited the template, but the current lsp.opam file in the repo doesn't have the unvendor line).
That may be deliberate (i.e. re-generate the opam file only at release time), but because of that, there is currently no way for a project to use both uutf and lsp, which is annoying, whereas if the re-generated opam file was committed, it would become possible to pin the dev version of lsp until the next release, which would help a lot, ^^

@Gbury
Copy link
Collaborator

Gbury commented Oct 21, 2020

Additionally, when trying to pin a local version with the opam file re-generated, I get the following error (because of the dependency on Unix):

# File "./unvendor.ml", line 1:
# Error: Reference to undefined global `Unix'

I guess the line in the template should actually be:

["ocaml" "unix.cma" "unvendor.ml"]

@Gbury
Copy link
Collaborator

Gbury commented Oct 21, 2020

Further going down the rabbit hole, once the two problems above are fixed, it seems like the dune subst part of the build fails. Here is the verbose opam log:

$ opam install lsp -vvvvvv

<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
+ /usr/bin/git "symbolic-ref" "--quiet" "--short" "HEAD" (CWD=/home/guigui/build/ocaml-lsp)
- wip
+ /usr/bin/git "diff" "--no-ext-diff" "--quiet" (CWD=/home/guigui/build/ocaml-lsp)
+ /usr/bin/git "remote" "set-url" "origin" "file:///home/guigui/build/ocaml-lsp" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "fetch" "-q" "file:///home/guigui/build/ocaml-lsp" "--update-shallow" "+wip:refs/remotes/opam-ref-wip" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "diff" "--no-ext-diff" "--quiet" "refs/remotes/opam-ref-wip" "--" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
[lsp.1.1.0] no changes from git+file:///home/guigui/build/ocaml-lsp#wip

+ /usr/bin/lsb_release "-s" "-r"
- rolling
+ /usr/bin/ocamlc "-vnum"
- 4.11.1
The following actions will be performed:
  ↻ recompile lsp 1.1.0*
+ /usr/bin/git "init" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
- Initialized empty Git repository in /home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/.git/
+ /usr/bin/git "config" "--local" "fetch.prune" "false" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "config" "--local" "diff.noprefix" "false" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "remote" "add" "origin" "file:///home/guigui/build/ocaml-lsp" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "remote" "set-url" "origin" "file:///home/guigui/build/ocaml-lsp" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "fetch" "-q" "file:///home/guigui/build/ocaml-lsp" "--update-shallow" "+wip:refs/remotes/opam-ref-wip" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
+ /usr/bin/git "reset" "--hard" "refs/remotes/opam-ref-wip" "--" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
- HEAD is now at 349ad10 Re-generate opam file
+ /usr/bin/git "submodule" "update" "--init" "--recursive" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp)
- Submodule 'vendor/cmdliner' (https://github.com/dbuenzli/cmdliner.git) registered for path 'vendor/cmdliner'
- Submodule 'vendor/merlin' (https://github.com/rgrinberg/merlin) registered for path 'vendor/merlin'
- Submodule 'ocaml-syntax-shims' (https://github.com/ocaml-ppx/ocaml-syntax-shims) registered for path 'vendor/ocaml-syntax-shims'
- Submodule 'vendor/octavius' (https://github.com/ocaml-doc/octavius.git) registered for path 'vendor/octavius'
- Submodule 'vendor/omd' (https://github.com/ulugbekna/omd.git) registered for path 'vendor/omd'
- Submodule 'vendor/uutf' (https://github.com/dune-universe/uutf.git) registered for path 'vendor/uutf'
- Cloning into '/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/vendor/cmdliner'...
- Cloning into '/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/vendor/merlin'...
- Cloning into '/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/vendor/ocaml-syntax-shims'...
- Cloning into '/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/vendor/octavius'...
- Cloning into '/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/vendor/omd'...
- Cloning into '/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp/vendor/uutf'...
- Submodule path 'vendor/cmdliner': checked out 'db4d02a9eb47b5c43127a67cb121004b03ea3719'
- Submodule path 'vendor/merlin': checked out '1a82f8dee93dd39c7200f5ba2802dff8f250a699'
- Submodule path 'vendor/ocaml-syntax-shims': checked out '38a6dd23543d9c4c3678fc6741962832fd539877'
- Submodule path 'vendor/octavius': checked out '50820d76c796caffc850cfea93ac2bbc23c86857'
- Submodule path 'vendor/omd': checked out 'd6bb7ea5b1739dcbe97a2cf44f74689c05ba46a5'
- Submodule path 'vendor/uutf': checked out '66ddef1cf88fa0806095fb262b3a47b32a85b54d'
[lsp.1.1.0] synchronised from git+file:///home/guigui/build/ocaml-lsp#wip

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+ /usr/bin/cp "-PRp" "/home/guigui/build/dolmen/_opam/.opam-switch/sources/lsp" "/home/guigui/build/dolmen/_opam/.opam-switch/build/lsp.1.1.0"
+ /home/guigui/.opam/opam-init/hooks/sandbox.sh "build" "ocaml" "unix.cma" "unvendor.ml" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/build/lsp.1.1.0)
+ /home/guigui/.opam/opam-init/hooks/sandbox.sh "build" "dune" "subst" (CWD=/home/guigui/build/dolmen/_opam/.opam-switch/build/lsp.1.1.0)
- Error: vendor/cmdliner: No such file or directory
[ERROR] The compilation of lsp failed at "/home/guigui/.opam/opam-init/hooks/sandbox.sh build dune subst".

#=== ERROR while compiling lsp.1.1.0 ==========================================#
# context     2.0.7 | linux/x86_64 | ocaml-base-compiler.4.11.1 | pinned(git+file:///home/guigui/build/ocaml-lsp#wip#349ad100)
# path        ~/build/dolmen/_opam/.opam-switch/build/lsp.1.1.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune subst
# exit-code   1
# env-file    ~/.opam/log/lsp-49393-48c407.env
# output-file ~/.opam/log/lsp-49393-48c407.out
### output ###
# Error: vendor/cmdliner: No such file or directory

@rgrinberg
Copy link
Member Author

@Gbury thanks for the investigation. Would you mind sending a PR with your fix? We'll fix the rest in it.

@Gbury Gbury mentioned this pull request Oct 21, 2020
@Gbury
Copy link
Collaborator

Gbury commented Oct 21, 2020

done (cf #265 )

rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Nov 16, 2020
CHANGES:

## Features

- Add keyword completion

- Add go to declaration functionality to jump to a value's specification in a
  .mli file (ocaml/ocaml-lsp#294)

## Fixes

- ocaml/ocaml-lsp#245: correctly use mutexes on OpenBSD (ocaml/ocaml-lsp#264)

- ocaml/ocaml-lsp#268: Do not use vendored libraries when building the lsp package (ocaml/ocaml-lsp#260)

- ocaml/ocaml-lsp#271: Clear diagnostics when files are closed

- Disable non-prefix completion. There's no reliably way to trigger it and it
  can be slow.
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.

Inconsistent interfaces when depending on opam lsp package
3 participants