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

new package packages/fasmifra/fasmifra.1.0.0 #19149

Merged
merged 6 commits into from
Aug 4, 2021

Conversation

UnixJunkie
Copy link
Contributor

No description provided.

@UnixJunkie
Copy link
Contributor Author

Thanks for the fixes.
I am surprised there is no dependency to declare when relying on the str regexp library.

@UnixJunkie
Copy link
Contributor Author

The CI test logs are a little hard to read.
I click on one that is supposed to be a failure (I see a red cross):

opam-2.1
    compilers
        4.03
            fasmifra.1.0.0
                lower-bounds (failed: The function applied to this argument has type nprocs:int -> unit)

It sends me there:
https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/ef204203bccb199c20f3d9f91fd74c26cf03e690/variant/opam-2.1,compilers,4.03,fasmifra.1.0.0,lower-bounds

In the same log file, I can read:

-> installed fasmifra.1.0.0
Done.
[...]
The following actions will be performed:
  - remove fasmifra 1.0.0*
[...]
[ERROR] The compilation of fasmifra.1.0.0 failed at "dune build -p fasmifra -j 31".

I understand the package was installed, then removed, then the next trial at installing failed.
I am left in a quantum superposition state about the conclusion of such a test.

@mseri
Copy link
Member

mseri commented Jul 29, 2021

The error that needs to be fixed is

#=== ERROR while compiling fasmifra.1.0.0 =====================================#
# context              2.1.0 | linux/x86_64 | ocaml-base-compiler.4.03.0 | pinned(https://github.com/UnixJunkie/FASMIFRA/archive/refs/tags/v1.0.0.tar.gz)
# path                 ~/.opam/4.03/.opam-switch/build/fasmifra.1.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p fasmifra -j 31
# exit-code            1
# env-file             ~/.opam/log/fasmifra-14787-7d252a.env
# output-file          ~/.opam/log/fasmifra-14787-7d252a.out
### output ###
#       ocamlc src/.fasmifra.eobjs/byte/fasmifra.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && /home/opam/.opam/4.03/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.fasmifra.eobjs/byte -I /home/opam/.opam/4.03/lib/batteries -I /home/opam/.opam/4.03/lib/bytes -I /home/opam/.opam/4.03/lib/dolog -I /home/opam/.opam/4.03/lib/equeue -I /home/opam/.opam/4.03/lib/line_oriented -I /home/opam/.opam/4.03/lib/minicli -I /home/opam/.opam/4.03/lib/netcamlbox -I /home/opam/.opam/4.03/lib/netmulticore -I /home/opam/.opam/4.03/lib/netplex -I /home/opam/.opam/4.03/lib/netstring -I /home/opam/.opam/4.03/lib/netsys -I /home/opam/.opam/4.03/lib/num -I /home/opam/.opam/4.03/lib/ocaml/threads -I /home/opam/.opam/4.03/lib/parany -I /home/opam/.opam/4.03/lib/rpc -no-alias-deps -o src/.fasmifra.eobjs/byte/fasmifra.cmo -c -impl src/fasmifra.ml)
# File "src/fasmifra.ml", line 433, characters 18-28:
# Error: The function applied to this argument has type nprocs:int -> unit
# This argument cannot be applied with label ~init

This is sue to some package (maybe parany) being downgraded to an incompatible version in

# Run eval $(opam env) to update the current shell environment
The following actions will be performed:
  - remove    ocamlfind-secondary      1.8.1           [conflicts with ocamlfind]
  - remove    opam-depext              1.1.5
  - remove    cpu                      2.0.0           [conflicts with dune]
  - downgrade conf-rdkit               1 to 0.1
  - downgrade ocamlbuild               0.14.0 to 0.9.0
  - downgrade ocamlfind                1.8.1 to 1.6.2
  - remove    ocaml-secondary-compiler 4.08.1-1
  - downgrade dune                     2.9.0 to 1.11.0
  - remove    conf-autoconf            0.1
  - install   base-bytes               base            [required by ocamlnet]
  - downgrade batteries                3.3.0 to 2.5.2  [uses ocamlbuild, ocamlfind]
  - recompile dolog                    6.0.0           [uses dune]
  - downgrade minicli                  5.0.2 to 5.0.0  [uses dune]
  - remove    conf-which               1
  - install   ocamlnet                 4.1.2           [required by parany]
  - recompile line_oriented            1.0.0           [uses dune]
  - downgrade parany                   12.0.3 to 1.0.0 [uses ocamlbuild, ocamlfind]
===== 2 to install | 2 to recompile | 7 to downgrade | 6 to remove =====

You just need to add the appropriate lower bound in the opam file. In this case I am not sure which one it is.

@mseri
Copy link
Member

mseri commented Jul 29, 2021

To give you more context: the lower bounds test first installs the package with the usual bounds –which is expected to succeed–, then tries to downgrade all the dependencies to their lower bounds in a way compatible with their opam bounds. Then it proceed to reinstall your packages with all the dependencies downgraded. If it fails when building your package it means that some lower bounds are missing or incorrect

@UnixJunkie
Copy link
Contributor Author

Ok, I added a lower bound contraint on parany.
If a tool could find such bounds automatically, this would be nice.

@mseri
Copy link
Member

mseri commented Jul 29, 2021

Thanks. I agree with you, but I would not know where to start to make such a tool. On the one hand, error can be of very different nature, and on the other we would need to try and install or grep the interfaces of all possible versions of the packages that are getting downgraded, try to install with the versions that seem to be correct and repeat until there is a configuration that works. There is a lot of "understanding" that the tool needs to make

@UnixJunkie
Copy link
Contributor Author

UnixJunkie commented Jul 29, 2021 via email

@UnixJunkie
Copy link
Contributor Author

Should I change something more?

@mseri
Copy link
Member

mseri commented Aug 3, 2021

There is still a wrong/missing lower bound:

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed   fasmifra.1.0.0
Done.
# Run eval $(opam env) to update the current shell environment
The following actions will be performed:
  - remove    ocamlfind-secondary      1.8.1            [conflicts with ocamlfind]
  - remove    opam-depext              1.1.5
  - downgrade dune                     2.9.0 to 1.11.0
  - downgrade conf-rdkit               1 to 0.1
  - downgrade ocamlbuild               0.14.0 to 0.9.0
  - downgrade ocamlfind                1.8.1 to 1.6.2
  - remove    ocaml-secondary-compiler 4.08.1-1
  - recompile dolog                    6.0.0            [uses dune]
  - recompile cpu                      2.0.0            [uses dune]
  - downgrade minicli                  5.0.2 to 5.0.0   [uses dune]
  - downgrade batteries                3.3.0 to 2.5.2   [uses ocamlbuild, ocamlfind]
  - downgrade parany                   12.0.3 to 11.0.2 [uses dune]
  - recompile line_oriented            1.0.0            [uses dune]
===== 3 to recompile | 7 to downgrade | 3 to remove =====

[...]

#=== ERROR while compiling fasmifra.1.0.0 =====================================#
# context              2.1.0 | linux/x86_64 | ocaml-base-compiler.4.03.0 | pinned(https://github.com/UnixJunkie/FASMIFRA/archive/refs/tags/v1.0.0.tar.gz)
# path                 ~/.opam/4.03/.opam-switch/build/fasmifra.1.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p fasmifra -j 31
# exit-code            1
# env-file             ~/.opam/log/fasmifra-7205-7a217a.env
# output-file          ~/.opam/log/fasmifra-7205-7a217a.out
### output ###
#       ocamlc src/.fasmifra.eobjs/byte/fasmifra.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && /home/opam/.opam/4.03/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.fasmifra.eobjs/byte -I /home/opam/.opam/4.03/lib/batteries -I /home/opam/.opam/4.03/lib/bytes -I /home/opam/.opam/4.03/lib/cpu -I /home/opam/.opam/4.03/lib/dolog -I /home/opam/.opam/4.03/lib/line_oriented -I /home/opam/.opam/4.03/lib/minicli -I /home/opam/.opam/4.03/lib/num -I /home/opam/.opam/4.03/lib/ocaml/threads -I /home/opam/.opam/4.03/lib/parany -no-alias-deps -o src/.fasmifra.eobjs/byte/fasmifra.cmo -c -impl src/fasmifra.ml)
# File "src/fasmifra.ml", line 433, characters 18-28:
# Error: The function applied to this argument has type
#          ?preserve:bool -> ?core_pin:bool -> unit
# This argument cannot be applied with label ~init

@UnixJunkie
Copy link
Contributor Author

I'll check, maybe for parany.

For the future, is there a script to do those tests locally?

@UnixJunkie
Copy link
Contributor Author

Note that the approach I took is: constrain almost all dependencies to the latest version currently available in opam.
Those are probably tighter constraints than strictly necessary.
However, in lack of an automatic tool to compute those bounds, and given the hairiness of the CI test results, that's the best I can propose.

@mseri
Copy link
Member

mseri commented Aug 4, 2021

I don’t have a problem with it, if you want you can go and try relaxing some bounds.

I don’t see a way to have such tool and for it to be usable. However, we are slowly fixing the lower bounds in the various PRs, so this will improve with time. It has already improved a lot in the last few weeks, but once we stumble upon previously unchecked packages it takes a while to find and fix all the issues.

I don’t know if there is a way to replicate the lower bounds locally, maybe @kit-ty-kate knows

@kit-ty-kate
Copy link
Member

For the future, is there a script to do those tests locally?

The best we know how to do properly at the moment without taking too much time is to do it step by step (same as our CI does currently).

You can use opam-devel.2.1.0 compiled with the opam-0install-cudf package or use it from the ocaml/opam docker images (the opam-2.1 binary already has everything ready):

$ opam install --solver=builtin-0install "--criteria=+count[version-lag,solution]" your-pkg

@mseri mseri merged commit 0489f20 into ocaml:master Aug 4, 2021
@UnixJunkie UnixJunkie deleted the fasmifra_100 branch August 4, 2021 23:36
@UnixJunkie
Copy link
Contributor Author

Ok, thanks for the info.

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