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

Make ocaml-usb compile with OCaml 4.06 #5

Merged
merged 1 commit into from
Mar 24, 2018
Merged

Make ocaml-usb compile with OCaml 4.06 #5

merged 1 commit into from
Mar 24, 2018

Conversation

jgjl
Copy link
Contributor

@jgjl jgjl commented Mar 21, 2018

Installing usb with opam on OCaml 4.06.1+flambda failed:

opam install usb                                                            
The following actions will be performed:                                                                                                                   ∗  install usb 1.3.0                                                                                                                                   

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[usb] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of usb failed at "./configure".
Processing  1/1: [usb: ocamlfind remove]
#=== ERROR while installing usb.1.3.0 =========================================#
# opam-version 1.2.2
# os           linux
# command      ./configure
# path         /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0
# compiler     4.06.1+flambda
# exit-code    2
# env-file     /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0/usb-822-1872ec.env
# stdout-file  /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0/usb-822-1872ec.out
# stderr-file  /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0/usb-822-1872ec.err
### stderr ###
# File "/home/dim/sources/oasis/src/oasis/OASISString.ml", line 118, characters 8-26:
# Warning 3: deprecated: String.set
# Use Bytes.set instead.
# File "/home/dim/sources/oasis/src/oasis/OASISString.ml", line 118, characters 8-11:
# Error: This expression has type string but an expression was expected of type
#          bytes



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  ∗  install usb 1.3.0
No changes have been performed

=-=- usb.1.3.0 troobleshooting =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing. `opam depext usb.1.3.0' may help you find the correct installation for
   your system.

When installing manually:

make                                                                          
./setup-dev.exe -build 
Finished, 0 targets (0 cached) in 00:00:00.
File "examples/_tags", line 3, characters 13-20:
Warning: the tag "pkg_usb" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
+ /home/blendin/.opam/4.06.1+flambda/bin/ocamlfind ocamlc -c -g -annot -bin-annot -package lwt.ppx -package lwt.unix -I src -o src/USB.cmo src/USB.ml
File "src/USB.ml", line 234, characters 10-28:
Warning 3: deprecated: module Lwt_sequence
 This module is an implementation detail of Lwt. See
   https://github.com/ocsigen/lwt/issues/361
File "src/USB.ml", line 235, characters 10-28:
Warning 3: deprecated: module Lwt_sequence
 This module is an implementation detail of Lwt. See
   https://github.com/ocsigen/lwt/issues/361
File "src/USB.ml", line 273, characters 20-31:
Warning 3: deprecated: Lwt_unix.execute_job
 Use Lwt_unix.run_job.
File "src/USB.ml", line 568, characters 10-14:
Error: This expression has type bytes but an expression was expected of type
         string
Command exited with code 2.
Compilation unsuccessful after building 7 targets (6 cached) in 00:00:00.
E: Failure("Command ''/home/blendin/.opam/4.06.1+flambda/bin/ocamlbuild' src/libusb_stubs.a src/dllusb_stubs.so src/usb.cma src/usb.cmxa src/usb.a src/usb.cmxs -tag debug' terminated with error code 10")
Makefile:27: recipe for target 'build' failed
make: *** [build] Error 1

The proposed change solves that issue. "make test" claims to run through successfully.

Installing usb with opam on OCaml 4.06.1+flambda failed:

opam install usb                                                            
The following actions will be performed:                                                                                                                   ∗  install usb 1.3.0                                                                                                                                   

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[usb] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of usb failed at "./configure".
Processing  1/1: [usb: ocamlfind remove]
#=== ERROR while installing usb.1.3.0 =========================================#
# opam-version 1.2.2
# os           linux
# command      ./configure
# path         /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0
# compiler     4.06.1+flambda
# exit-code    2
# env-file     /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0/usb-822-1872ec.env
# stdout-file  /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0/usb-822-1872ec.out
# stderr-file  /home/blendin/.opam/4.06.1+flambda/build/usb.1.3.0/usb-822-1872ec.err
### stderr ###
# File "/home/dim/sources/oasis/src/oasis/OASISString.ml", line 118, characters 8-26:
# Warning 3: deprecated: String.set
# Use Bytes.set instead.
# File "/home/dim/sources/oasis/src/oasis/OASISString.ml", line 118, characters 8-11:
# Error: This expression has type string but an expression was expected of type
#          bytes



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions failed
  ∗  install usb 1.3.0
No changes have been performed

=-=- usb.1.3.0 troobleshooting =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=> This package relies on external (system) dependencies that may be missing. `opam depext usb.1.3.0' may help you find the correct installation for
   your system.

When installing manually:
make                                                                          
./setup-dev.exe -build 
Finished, 0 targets (0 cached) in 00:00:00.
File "examples/_tags", line 3, characters 13-20:
Warning: the tag "pkg_usb" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
+ /home/blendin/.opam/4.06.1+flambda/bin/ocamlfind ocamlc -c -g -annot -bin-annot -package lwt.ppx -package lwt.unix -I src -o src/USB.cmo src/USB.ml
File "src/USB.ml", line 234, characters 10-28:
Warning 3: deprecated: module Lwt_sequence
 This module is an implementation detail of Lwt. See
   ocsigen/lwt#361
File "src/USB.ml", line 235, characters 10-28:
Warning 3: deprecated: module Lwt_sequence
 This module is an implementation detail of Lwt. See
   ocsigen/lwt#361
File "src/USB.ml", line 273, characters 20-31:
Warning 3: deprecated: Lwt_unix.execute_job
 Use Lwt_unix.run_job.
File "src/USB.ml", line 568, characters 10-14:
Error: This expression has type bytes but an expression was expected of type
         string
Command exited with code 2.
Compilation unsuccessful after building 7 targets (6 cached) in 00:00:00.
E: Failure("Command ''/home/blendin/.opam/4.06.1+flambda/bin/ocamlbuild' src/libusb_stubs.a src/dllusb_stubs.so src/usb.cma src/usb.cmxa src/usb.a src/usb.cmxs -tag debug' terminated with error code 10")
Makefile:27: recipe for target 'build' failed
make: *** [build] Error 1

The proposed change solves that issue. "make test" claims to run through successfully.
@letoh
Copy link
Owner

letoh commented Mar 23, 2018

@jgjl Thank you! This patch does fix the build issue, but there is still something strange.
I don't know if it is good that the contents with immutable type are modified by the
control_recv call? Any suggestions?

@jgjl
Copy link
Contributor Author

jgjl commented Mar 24, 2018

I have not gone very far in using the library yet. Making it compile was the first step, so once I understand how it works in detail, I will try to come up with a better solution. Right now, I don't have a suggestion :)

@letoh
Copy link
Owner

letoh commented Mar 24, 2018

@jgjl You're right. I will merge this patch first. BTW, I have had some experimental changes for the 4.06 on the mutability branch, please let me know if you have any comments on the changes.

@letoh letoh merged commit 9643ddc into letoh:master Mar 24, 2018
@jgjl
Copy link
Contributor Author

jgjl commented Mar 26, 2018

@letoh sorry, I missed the mutability branch. I will test it!

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.

2 participants