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

Bits 'n bobs #3900

Merged
merged 5 commits into from
Jul 3, 2019
Merged

Bits 'n bobs #3900

merged 5 commits into from
Jul 3, 2019

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Jun 28, 2019

Shedding the weight of some simpler commits:

  • opam-admin.top - prior to Jbuilder, this was built using ocamlmktop. I converted this badly, because the existing code now works as a toplevel, but you can't run a script by having #!opam-admin.top or opam-admin.top foo.ml. The commit generates the let _ = Topmain.main () in a second file which is used to create opam-admin.top and the actual opam_admin_top.ml is now used to generate a library. This means that scripts have two choices - you can either #require "opam-admin.top" in your script, or you can run an .ml file with opam_admin_top (although you need opam_admin_top.cmi in the same directory as your script).
  • %{exe}% does exactly what it says on the tin. The main reason for making it a global is to standardise the name used (so there's no temptation for %{ext_exe}%, etc. This extension is intentionally blank on Cygwin because Cygwin has its own official handling for automatically adding .exe.
  • Back when originally working on this, I was converting 1.2 repos to 2.0 regularly - it was a nuisance for flexdll that the ocaml dependency kept getting re-added after I'd manually removed it... this legacy commit doesn't do that if the opam-version of the file is already 2.0. The principle may be useful in the future...
  • Also in opam admin upgrade was an attempt to download URLs using their filename. Fine for a lot of things, but troublesome on Windows when you start having ? characters, etc., so this patch downloads patches and other referenced files using a safe filename (it's only to compute their checksums).
  • I'd like, prior to any kind of global depext variable support, to introduce sys-ocaml-arch, sys-ocaml-libc and sys-ocaml-cc to allow accurate selection of the system compiler on Windows (this may prove unnecessary with the other work we've been looking into on switch parameters, but I don't think these variables would ever do any harm in future).

dra27 added 5 commits May 17, 2016 07:54
%{exe}% expands to .exe on Windows platforms, and the empty string on
other systems, allowing .install files to be generated correctly.

Signed-off-by: David Allsopp <[email protected]>
Script attempted to write a filename with "?" in it, which is illegal on
Windows. "Fixed" by using a dummy name for the download (since the file
is only downloaded to obtain its checksum).

Signed-off-by: David Allsopp <[email protected]>
Two problems from the Jbuilder upgrade:

1. opam_admin_top.cmi should be installed
2. Opam_admin_top functions were not available, because Topmain was
   invoked from within Opam_admin_top.

Signed-off-by: David Allsopp <[email protected]>
The repository upgrade automatically adds a dependency on the ocaml
package (i.e. the compiler) if none are inferred (through ocaml-version
translation, etc.). This is a nuisance if running opam admin upgrade for
a second time (e.g. because some older package definitions have been
imported) where you have packages which intentionally do not depend on
the compiler.

Process tweaked so that if the opam file already has opam-version: 2.0,
then the automatic dependency is not added.

Signed-off-by: David Allsopp <[email protected]>
@dra27 dra27 force-pushed the random-bits branch 3 times, most recently from 5e4798f to f9b0656 Compare July 2, 2019 10:04
@AltGr AltGr merged commit e6b9731 into ocaml:master Jul 3, 2019
@rjbou rjbou added this to the 2.1.0 milestone Jul 5, 2019
@dra27 dra27 mentioned this pull request Jun 13, 2024
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.

3 participants