Skip to content

2 conf-files, one for the magick-core lib with the major version 6, and a second one for 7 #27798

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fccm2
Copy link
Contributor

@fccm2 fccm2 commented Apr 19, 2025

Provides 2 different conf-files, because the magick-core library version 6 is still the one that seems to be provided in Debian 12.

fccm2 added 2 commits April 20, 2025 00:38
Checks for the magick-core lib, with major version equal to "6"
(there are api changes between 6 and 7)
Checks for the magick-core lib, with major version equal to "7"
(there are api changes between 6 and 7)
@fccm2 fccm2 changed the title 2 conf-files, one for the magick-core lib, one for the major version 6 and a second one for 7 2 conf-files, one for the magick-core lib with the major version 6 and a second one for 7 Apr 19, 2025
@fccm2 fccm2 changed the title 2 conf-files, one for the magick-core lib with the major version 6 and a second one for 7 2 conf-files, one for the magick-core lib with the major version 6, and a second one for 7 Apr 19, 2025
@fccm2
Copy link
Contributor Author

fccm2 commented Apr 20, 2025

I don't know how to make these conf-files work in case both a magick-core-6 and 7 are installed at the same time in the system. pkg-config will probably take the first .pc file found in its path.
But it will probably work for 95% of users (or more) who have only one of the two installed.

Copy link
Contributor

@shonfeder shonfeder left a comment

Choose a reason for hiding this comment

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

Thank you for helping to provide these conf packages!

It looks we have a few issues to resolved, flagged by our CI:

Comment on lines +12 to +16
build: [
[ "sh" "-c"
"pkg-config --exists MagickCore && \
pkg-config --modversion MagickCore | awk -F. '{ if ($1 == 6) exit 0; else exit 1; }'"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to failing on all platforms with errors like

#=== ERROR while compiling conf-magick-core6.1 ================================#
# context              2.3.0 | linux/x86_64 | ocaml-base-compiler.5.3.0 | pinned
# path                 ~/.opam/5.3/.opam-switch/build/conf-magick-core6.1
# command              ~/.opam/opam-init/hooks/sandbox.sh build sh -c pkg-config --exists MagickCore && pkg-config --modversion MagickCore | awk -F. '{ if ($1 == 6) exit 0; else exit 1; }'
# exit-code            1
# env-file             ~/.opam/log/conf-magick-core6-7-671145.env
# output-file          ~/.opam/log/conf-magick-core6-7-671145.out

Except for on windows, where it is failing with

  #=== ERROR while compiling conf-magick-core6.1 ================================#
  # context     2.3.0 | win32/x86_64 | ocaml.5.3.0 | file://D:/a/opam-repository/opam-repository
  # path        D:\opamroot\default\.opam-switch\build\conf-magick-core6.1
  # command     D:\opamroot\.cygwin\root\bin\sh.exe -c pkg-config --exists MagickCore && pkg-config --modversion MagickCore | awk -F. '{ if ($1 == 6) exit 0; else exit 1; }'
  # exit-code   2
  # env-file    D:\opamroot\log\conf-magick-core6-3744-45fb94.env
  # output-file D:\opamroot\log\conf-magick-core6-3744-45fb94.out
  ### output ###
  # Can't open perl script "/cygdrive/c/Strawberry/perl/bin/pkg-config": No such file or directory

(Cf. https://github.com/ocaml/opam-repository/actions/runs/14553589502/job/40827624818?pr=27798)

I'm not sure if the right fix is to use a different check on windows via a conditional guard or if this can be changed to work on all platforms.

@fccm2
Copy link
Contributor Author

fccm2 commented May 9, 2025

Maybe the error code just means that the deps that are checked by this conf-file are not installed, (which is the expected result).

The Windows error code 2 maybe means that awk is not installed in Windows.

Do you have a suggestion on a better way to check the major version of the lib ?

Is there a current conf-file that I could use as an example ?

@fccm2
Copy link
Contributor Author

fccm2 commented May 15, 2025

Maybe we should do it with an ocaml script, rather than with awk ?

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