Navigation Menu

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

Ensure coqide.opam actually installs coqide #16505

Merged
merged 5 commits into from Sep 20, 2022

Conversation

Blaisorblade
Copy link
Contributor

@Blaisorblade Blaisorblade commented Sep 17, 2022

Naive, but worth an attempt. I encourage people to take over or open new PRs if this is useful.

Without this change, dune build coqide.install fails silently when dependencies are missing. With this patch, dune build coqide-server.install still succeeds while dune build coqide.install reports the missing deps:

$ dune build coqide.install
File "ide/coqide/dune", line 33, characters 54-74:
33 |  (libraries coqide-server.protocol coqide-server.core lablgtk3-sourceview3))
                                                           ^^^^^^^^^^^^^^^^^^^^
Error: Library "lablgtk3-sourceview3" not found.
-> required by library "coqide_gui" in _build/default/ide/coqide
-> required by executable coqide_main in ide/coqide/dune:53
-> required by _build/default/ide/coqide/coqide_main.exe
-> required by _build/install/default/bin/coqide
-> required by _build/default/coqide.install
  • Added changelog.

Probably naive, but worth an attempt.
@Blaisorblade
Copy link
Contributor Author

The optional directives I'm dropping were added in faf6ffc and 1d454c7, but I don't understand those commit logs.

@Blaisorblade
Copy link
Contributor Author

Blaisorblade commented Sep 17, 2022

https://gitlab.com/coq/coq/-/jobs/3043744428 fails with

$ dune build -p coq-core,coq-stdlib,coqide-server,coqide,coq
File "ide/coqide/dune", line 33, characters 54-74:
33 |  (libraries coqide-server.protocol coqide-server.core lablgtk3-sourceview3))
                                                           ^^^^^^^^^^^^^^^^^^^^
Error: Library "lablgtk3-sourceview3" not found.

so I now explicitly skip building coqide on that platform Gitlab CI job.

This should be dropped if we change the default in the template (or if you
prefer), but it seems `configure` will auto-enable coqide if dependencies are
available.
@Blaisorblade Blaisorblade marked this pull request as ready for review September 17, 2022 15:56
@Blaisorblade Blaisorblade requested review from a team as code owners September 17, 2022 15:56
@Blaisorblade
Copy link
Contributor Author

This passed at least NJOBS=10 make test-suite locally; seems good enough for an initial review.

@Alizter
Copy link
Contributor

Alizter commented Sep 17, 2022

Windows build seems to have failed. I wonder if we were ever actually building CoqIDE on windows before? cc @MSoegtropIMC any idea what might have gone wrong?

@Blaisorblade
Copy link
Contributor Author

Blaisorblade commented Sep 17, 2022

Windows build seems to have failed. I wonder if we were ever actually building CoqIDE on windows before? cc @MSoegtropIMC any idea what might have gone wrong?

I assume not: That’s the same error I got at first (and fixed) on 32bit, so we should disable that as well. Or install the dependency if possible (32bit has a comment clarifying it's not possible for now).

FWIW, there’s a potential regression: the commit messages I linked suggest maybe something was still built and tested in the coqide packages? I haven’t checked, but even if that's the case, that stuff should move elsewhere. I'm sure I miss something, but "coqide might not include coqide" is too confusing.

@Zimmi48
Copy link
Member

Zimmi48 commented Sep 17, 2022

If coqide was not built on windows, that was a bug in the CI configuration.

@MSoegtropIMC
Copy link
Contributor

@Blaisorblade : in Coq Platform, where opam takes care that all dependencies are there, CoqIDE builds fine on all platforms (MacOS, Linux, Windows). I didn't have much of a look at the "outside of opam" builds. Afaik the CoqIDE opam file is dune based.

@Blaisorblade
Copy link
Contributor Author

@MSoegtropIMC The problem was in the CI for the dev platform.

AFAICT:

  • coq/coqide.opam did not depend on lablgtk3-sourceview3. This was a bug and I pushed a fix.
  • The platform relies on that dependency existing, so package picks only pin lablgtk3.3.1.2, and let opam install lablgtk3-sourceview3. I don't consider that a bug.
  • Before this MR, if lablgtk3-sourceview3 was not installed, installing coq/coqide.opam succeeded without building coqide; thankfully @palmskog noticed and @silene diagnosed it.

@Blaisorblade
Copy link
Contributor Author

Cool, this is passing CI — up to unimath's hopefully unrelated time out.

@Blaisorblade Blaisorblade changed the title Try making coqide non-optional Ensure coqide.opam actually installs coqide Sep 19, 2022
@Blaisorblade
Copy link
Contributor Author

BTW: dune regeneration also suggests adding an odoc optional dependency: Blaisorblade@d3c0ab8. I'd rather not add it here (and risk breaking CI and entangling discussions), but we could do an MR on top.

@Alizter
Copy link
Contributor

Alizter commented Sep 19, 2022

@Blaisorblade That's fine to ignore it for now. The OCaml documentation generated by dune relies on odoc which is why you are seeing it.

@ejgallego
Copy link
Member

Why not move coqide's to its own CI job?

@Blaisorblade
Copy link
Contributor Author

This MR attempts (and I think succeeds) at an obvious fix for a clear bug. I don't personally use coqide, but it seemed it could be simple enough to try.

Splitting coqide seems a separate question: while it avoids ~3 lines of shell code, it requires adding and maintaining 5 new jobs, since there are 6 jobs building coq and only 1 of those skips coqide. That seems a regression to me, but that's not my call.

Either way, I admit I don't think I have time for it — so it's fine if this MR is turned down.

@ejgallego
Copy link
Member

I think the PR makes sense, but indeed the shell code looks a bit hackish, the problem is that I don't understand shell well :)

I'd be nice if we can find a quick way to not to use this hack, so I was thinking that maybe another job could do the trick, OMMV.

@Alizter
Copy link
Contributor

Alizter commented Sep 20, 2022

Let's keep this fix for now, splitting the job is a separate future concern.

@Alizter
Copy link
Contributor

Alizter commented Sep 20, 2022

@SkySkimmer I wouldn't mind another pair of eyes if you don't mind

@Alizter Alizter added kind: fix This fixes a bug or incorrect documentation. part: CI The continuous integration system. labels Sep 20, 2022
@Alizter Alizter added this to the 8.17+rc1 milestone Sep 20, 2022
@Alizter Alizter added this to To do in CI via automation Sep 20, 2022
@Alizter Alizter self-assigned this Sep 20, 2022
@SkySkimmer
Copy link
Contributor

I don't think we should split the jobs, I expect the coqide jobs would be dominated by docker/VM boot overhead.
Changes look OK, we should probably remove the configure switch since configure doesn't command the default targets anymore but that's for another PR.

- dev/ci/gitlab-section.sh end coq.build

- dev/ci/gitlab-section.sh start coq.install coq.install
- dune install --prefix="$(pwd)/_install_ci" coq-core coq-stdlib coqide-server coqide coq
- dune install --prefix="$(pwd)/_install_ci" $(sed -e 's/,/ /g' <<< ${PKGS})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This idiom isn't that hard if you know, but it is gratuitous obfuscation:

Suggested change
- dune install --prefix="$(pwd)/_install_ci" $(sed -e 's/,/ /g' <<< ${PKGS})
- dune install --prefix="$(pwd)/_install_ci" $(echo ${PKGS} | sed -e 's/,/ /g')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This shouldn't block merge, but is motivated by @ejgallego 's comment and will help some people read it).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are talking about more concise and possibly more readable alternatives, I suggest ${PKGS//,/ }.

@Zimmi48
Copy link
Member

Zimmi48 commented Sep 20, 2022

The choice of skipping the build of CoqIDE in the 32 bit job was made 5 years ago in the initial version of the GitLab CI configuration. Has someone checked that it is still necessary? If this is the only job skipping it and there's actually no need to skip it, it would save a lot of logical complexity.

@Blaisorblade
Copy link
Contributor Author

Has someone checked that it is still necessary?

This MR definitely failed before I implemented the skipping. Maybe one could install the missing library, I can at least try in the job (but I have no idea/privileges how to patch it in the Docker image).

@Alizter
Copy link
Contributor

Alizter commented Sep 20, 2022

Let's defer that to a separate PR for now I think.

@Alizter
Copy link
Contributor

Alizter commented Sep 20, 2022

@Blaisorblade Are you happy for me to merge?

@Blaisorblade
Copy link
Contributor Author

@Alizter Very happy with merging! We can defer all the other improvements.

@Alizter
Copy link
Contributor

Alizter commented Sep 20, 2022

@coqbot merge now

@coqbot-app coqbot-app bot merged commit 944ed31 into coq:master Sep 20, 2022
CI automation moved this from To do to Done Sep 20, 2022
@Blaisorblade Blaisorblade deleted the coqide-non-optional branch September 20, 2022 23:30
@Blaisorblade
Copy link
Contributor Author

Blaisorblade commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: fix This fixes a bug or incorrect documentation. part: CI The continuous integration system.
Projects
CI
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants