Skip to content

Conversation

mbacarella
Copy link
Contributor

portmidi.0.4

Bindings to libportmidi
OCaml bindings to libportmidi



🐫 Pull-request generated by opam-publish v2.5.1

@jmid
Copy link
Contributor

jmid commented Sep 17, 2025

CI is failing with:

# c_generated_functions.c: In function 'portmidi_stub_14_Pt_Time':
# c_generated_functions.c:176:19: error: implicit declaration of function 'Pt_Time' [-Wimplicit-function-declaration]
#   176 |    int32_t x144 = Pt_Time();
#       |                   ^~~~~~~

I also noticed deprecation alerts about using Core_kernel (not a blocker, but could be good to fix):

# File "portmidi.ml", line 1, characters 6-17:
# 1 | open! Core_kernel
#           ^^^^^^^^^^^
# Alert deprecated: module Core_kernel
# [since 2021-05] Use [Core] -- [Core_kernel] was renamed as [Core]
# (cd _build/default && /home/opam/.opam/5.3/bin/ocamlopt.opt -w -40 -g -I .portmidi.objs/byte -I .portmidi.objs/native -I /home/opam/.opam/5.3/lib/base -I /home/opam/.opam/5.3/lib/base/base_internalhash_types -I /home/opam/.opam/5.3/lib/base/md5 -I /home/opam/.opam/5.3/lib/base/shadow_stdlib -I /home/opam/.opam/5.3/lib/base_bigstring -I /home/opam/.opam/5.3/lib/base_quickcheck -I /home/opam/.opam/5.3/lib/base_quickcheck/ppx_quickcheck/runtime -I /home/opam/.opam/5.3/lib/bigarray-compat -I /home/opam/.opam/5.3/lib/bin_prot -I /home/opam/.opam/5.3/lib/bin_prot/shape -I /home/opam/.opam/5.3/lib/core -I /home/opam/.opam/5.3/lib/core/base_for_tests -I /home/opam/.opam/5.3/lib/core/command -I /home/opam/.opam/5.3/lib/core/filename_base -I /home/opam/.opam/5.3/lib/core/heap_block -I /home/opam/.opam/5.3/lib/core/univ_map -I /home/opam/.opam/5.3/lib/core/validate -I /home/opam/.opam/5.3/lib/core_kernel -I /home/opam/.opam/5.3/lib/ctypes -I /home/opam/.opam/5.3/lib/fieldslib -I /home/opam/.opam/5.3/lib/gel -I /home/opam/.opam/5.3/lib/int_repr -I /home/opam/.opam/5.3/lib/integers -I /home/opam/.opam/5.3/lib/jane-street-headers -I /home/opam/.opam/5.3/lib/ocaml_intrinsics_kernel -I /home/opam/.opam/5.3/lib/parsexp -I /home/opam/.opam/5.3/lib/ppx_assert/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_bench/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_compare/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_diff/diffable -I /home/opam/.opam/5.3/lib/ppx_diff/diffable_cinaps -I /home/opam/.opam/5.3/lib/ppx_enumerate/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_expect/config -I /home/opam/.opam/5.3/lib/ppx_expect/config_types -I /home/opam/.opam/5.3/lib/ppx_expect/make_corrected_file -I /home/opam/.opam/5.3/lib/ppx_expect/runtime -I /home/opam/.opam/5.3/lib/ppx_hash/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_here/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_inline_test/config -I /home/opam/.opam/5.3/lib/ppx_inline_test/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_log/syntax -I /home/opam/.opam/5.3/lib/ppx_log/types -I /home/opam/.opam/5.3/lib/ppx_module_timer/runtime -I /home/opam/.opam/5.3/lib/ppx_sexp_conv/runtime-lib -I /home/opam/.opam/5.3/lib/ppx_stable_witness/runtime -I /home/opam/.opam/5.3/lib/ppx_stable_witness/stable_witness -I /home/opam/.opam/5.3/lib/ppx_string/runtime -I /home/opam/.opam/5.3/lib/ppxlib/print_diff -I /home/opam/.opam/5.3/lib/sexplib -I /home/opam/.opam/5.3/lib/sexplib0 -I /home/opam/.opam/5.3/lib/splittable_random -I /home/opam/.opam/5.3/lib/stdio -I /home/opam/.opam/5.3/lib/stdlib-shims -I /home/opam/.opam/5.3/lib/time_now -I /home/opam/.opam/5.3/lib/typerep -I /home/opam/.opam/5.3/lib/variantslib -I c/.portmidi_c.objs/byte -I c/.portmidi_c.objs/native -I c/.portmidi_c_function_descriptions.objs/byte -I c/.portmidi_c_function_descriptions.objs/native -I c/.portmidi_c_type_descriptions.objs/byte -I c/.portmidi_c_type_descriptions.objs/native -cmi-file .portmidi.objs/byte/portmidi.cmi -no-alias-deps -open Portmidi__ -o .portmidi.objs/native/portmidi.cmx -c -impl portmidi.pp.ml)
# File "portmidi.ml", line 1, characters 6-17:
# 1 | open! Core_kernel
#           ^^^^^^^^^^^
# Alert deprecated: module Core_kernel
# [since 2021-05] Use [Core] -- [Core_kernel] was renamed as [Core]

@mbacarella
Copy link
Contributor Author

Oh. Guess I neglected to force push the updated 0.4 tag. I did that now in my repo. Do I need to run opam publish again to update this PR?

Comment on lines 16 to 17
"ctypes" {>= "0.13.0"}
"ctypes-foreign"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"ctypes" {>= "0.13.0"}
"ctypes-foreign"
"ctypes" {>= "0.21.1"}
"ctypes-foreign" {>= "0.21.1"}

Since ctypes.0.21.1 it depends lock-step on the corresponding ctypes-foreign version (e.g. ctypes-foreign.0.21.1) using the {= version} constraint.

Adding the above suggestion thus avoids cursed lower bounds combinations such as the following, which is causing one of the CI failures:

  - downgrade ctypes                      0.23.0 to 0.22.0     [required by portmidi]
  - downgrade ctypes-foreign              0.23.0 to 0.4.0      [required by portmidi]

...

#=== ERROR while compiling portmidi.0.4 =======================================#
# context              2.4.1 | linux/x86_64 | ocaml-base-compiler.5.2.1 | pinned(https://github.com/mbacarella/portmidi/archive/refs/tags/0.4.tar.gz)
# path                 ~/.opam/5.2/.opam-switch/build/portmidi.0.4
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p portmidi -j 255 @install
# exit-code            1
# env-file             ~/.opam/log/portmidi-7-3107e9.env
# output-file          ~/.opam/log/portmidi-7-3107e9.out
### output ###
# File "c/dune", line 17, characters 25-39:
# 17 |  (libraries ctypes.stubs ctypes.foreign portmidi_c_type_descriptions))
#                               ^^^^^^^^^^^^^^
# Error: Library "ctypes.foreign" not found.
# -> required by _build/default/c/type_gen.exe
# -> required by _build/default/c/c_generated_types.c
# -> required by _build/default/c/c_generated_types.exe
# -> required by _build/default/c/portmidi_c_generated_types.ml
# -> required by
#    _build/install/default/lib/portmidi/c_function_descriptions/portmidi_c_generated_types.ml
# -> required by _build/default/portmidi.install
# -> required by alias install

@jmid
Copy link
Contributor

jmid commented Sep 18, 2025

Beside the above lower-bounds failure I can see

  • a dune.3.12.1 failure - which should be fixed by OCaml 5.3 and dune.3.12.1 conflict too #28542
  • opam-2.0 errors/timeouts which can be ignored
  • a FreeBSD failure fatal error: 'portmidi.h' file not found
  • a Windows failure to install conf-libportmidi (which is currently unsupported)

The FreeBSD failure is curious because the workflow does install the FreeBSD system package underway:
[2/2] Extracting portmidi-2.0.6,1: .......... done
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/a8d0d9a7b31d8081082c166f58dbb8ef221daea4/variant/freebsd,freebsd-14.2-ocaml-4.14-amd64,portmidi.0.4
and that package does contain the header-file, a .pc file, etc:
https://www.freshports.org/audio/portmidi/ (press Expand this list (17 items) to see the package contents)
What do you make of this @mbacarella?

Finally, would you consider adding an x-maintenance-intent entry?
https://github.com/ocaml/opam-repository/blob/master/governance/policies/archiving.md

@jmid jmid added the question label Sep 18, 2025
@mbacarella
Copy link
Contributor Author

I can make the ctypes constraint fix.

@jmid I don't know about the FreeBSD issue. I don't have the bandwidth to look into it. Can we just disable the package for freebsd (and also windows)?

@jmid
Copy link
Contributor

jmid commented Sep 18, 2025

I can make the ctypes constraint fix.

Great, thanks! 🙏

Can we just disable the package for freebsd (and also windows)?

I would just leave Windows as is.
I can see MSys2 has support https://packages.msys2.org/base/mingw-w64-portmidi
so it should just be a matter of me or someone else extending conf-libportmidi with it.

Leaving FreeBSD as is is perhaps also preferable.
A red CI light will remind us that there is something to be looked at, whereas disabling it signals "package is not available" which is not entirely true either IMO 🤷

@mbacarella mbacarella force-pushed the opam-publish-portmidi.0.4 branch from a8d0d9a to 0acb235 Compare September 18, 2025 22:09
@mbacarella
Copy link
Contributor Author

Alrighty, pushed the constraint changes and also ...

@jmid

Finally, would you consider adding an x-maintenance-intent entry?

I set this to none since I expect to reject most requests in the future as I don't use this library and am out of the ocaml ecosystem for the time being.

Copy link
Contributor

@jmid jmid left a comment

Choose a reason for hiding this comment

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

Finally, would you consider adding an x-maintenance-intent entry?

I set this to none since I expect to reject most requests in the future as I don't use this library and am out of the ocaml ecosystem for the time being.

Thanks for your honesty - and still sharing the package here 🙏

The latest CI run agrees with the previous one and

  • fails a conf-gmp.1 lower-bound check fixed in #28540
  • fails two opam-2.0 runs, which can be ignored
  • fails on FreeBSD, but now with a Failed to get sources of portmidi.0.4: Download command failed)
  • fails on Windows to install conf-libportmidi (which is currently unsupported)

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants