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

with-dkml opam switch got flexlink error #53

Closed
liweijian opened this issue Jun 25, 2023 · 8 comments
Closed

with-dkml opam switch got flexlink error #53

liweijian opened this issue Jun 25, 2023 · 8 comments
Milestone

Comments

@liweijian
Copy link

I some how need to switch a private ocaml repo in Windows, I've installed dkml.

PS C:\Users\tli> with-dkml opam switch --repositories=ide-dev create ide-dev ocaml-variants.4.14.1+ide --jobs=1

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
Switch invariant: ["ocaml-variants" {= "4.14.1+ide"}]
[NOTE] External dependency handling not supported for OS family 'windows'.
       You can disable this check using 'opam option --global depext=false'
[NOTE] External dependency handling not supported for OS family 'windows'.
       You can disable this check using 'opam option --global depext=false'

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
* installed base-bigarray.base
* installed base-threads.base
* installed base-unix.base
▼ retrieved ocaml-variants.4.14.1+ide  (https://github.com/ocaml/ocaml/archive/4.14.1.tar.gz)
[ERROR] The compilation of ocaml-variants.4.14.1+ide failed at "./configure --prefix=C:\\Users\\tli\\AppData\\Local\\opam\\ide-dev
        --docdir=C:\\Users\\tli\\AppData\\Local\\opam\\ide-dev\\doc/ocaml -C --disable-warn-error".

#=== ERROR while compiling ocaml-variants.4.14.1+ide =========================#
# context     2.2.0~alpha0~20221228 | win32/x86_64 |  | git+file://C:/Users/tli/opam-repository
# path        C:\Users\tli\AppData\Local\opam\ide-dev\.opam-switch\build\ocaml-variants.4.14.1+ide
# command     C:\Users\tli\AppData\Local\opam\ide-dev\.opam-switch\build\ocaml-variants.4.14.1+ide\./configure --prefix=C:\Users\tli\AppData\Local\opam\ide-dev --docdir=C:\Users\tli\AppData\Local\opam\ide-dev\doc/ocaml -C --disable-warn-error
# exit-code   1
# env-file    C:\Users\tli\AppData\Local\opam\log\ocaml-variants-4468-1e5556.env
# output-file C:\Users\tli\AppData\Local\opam\log\ocaml-variants-4468-1e5556.out
### output ###
# [...]
# checking how to hardcode library paths into programs... immediate
# checking whether stripping libraries is possible... no
# checking if libtool supports shared libraries... yes
# checking whether to build shared libraries... yes
# checking whether to build static libraries... yes
# checking C compiler vendor... msvc-1926
# checking whether host executables can be run in the build... yes
# checking whether #! works in shell scripts... yes
# checking whether the C compiler supports -d2VolatileMetadata-... yes
# checking for flexdll sources... checking for flexlink... flexlink
# checking whether flexlink works... no
# configure: error: flexlink does not work

I've read this issue, and this issue, but it seems that they are not applying to my specific case, just wondering is there any way to work around?

@jonahbeckford
Copy link
Contributor

That is an interesting way to create a switch. The failure does look very much related to the first issue you mentioned. But even if the first issue you mentioned was fixed (which it will be in the next release), I wouldn't suggest creating a switch that way on Windows. Many tweaks to the switch are needed for OCaml on native Windows.

The only official way to create a switch is typing dkml init in a directory. That will give you OCaml 4.14.0 and do all the tweaks required.

@liweijian
Copy link
Author

@jonahbeckford Cool, thanks for your reply. Just wondering when will the next release? I'd like to give it a shot:)

@jonahbeckford
Copy link
Contributor

I am trying to have something ready this week.

@liweijian
Copy link
Author

@jonahbeckford Just out of curiosity, if we are gonna to throw opam switch away, how can we applying patch to the 4.14 opam repo in dkml?

@jonahbeckford
Copy link
Contributor

jonahbeckford commented Jun 26, 2023

You can:

  1. Fork the dkml-base-compiler at https://github.com/diskuv/dkml-compiler.git. Any patches you need can be added following instructions at https://github.com/diskuv/dkml-compiler#patching. They go here: https://github.com/diskuv/dkml-compiler/tree/main/src/p
  2. Do a dkml init to create a local switch
  3. Update the new opam switch with your patched dkml-base-compiler. Something like: opam pin dkml-base-compiler git+file:///x/y/z/dkml-compiler/.git --no-action && opam install dkml-base-compiler --update-invariant.

@jonahbeckford jonahbeckford added this to the 1.2.1 milestone Jul 4, 2023
@jonahbeckford
Copy link
Contributor

You can try the Windows 64-bit Installer at https://gitlab.com/diskuv-ocaml/distributions/dkml/-/releases/1.2.1-10 which should fix the flexlink issue.

@liweijian
Copy link
Author

You can try the Windows 64-bit Installer at https://gitlab.com/diskuv-ocaml/distributions/dkml/-/releases/1.2.1-10 which should fix the flexlink issue.

I tried to build a 4.14.1 opam repo, still got flexlink issue, is it the same thing?
diskuv/diskuv-opam-repository#7

@jonahbeckford
Copy link
Contributor

Two issues open. Closing this one; keeping diskuv/diskuv-opam-repository#7 alive.

@jonahbeckford jonahbeckford closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants