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

Default flag value and depopt/test #29

Closed
gildor478 opened this issue Dec 8, 2016 · 7 comments
Closed

Default flag value and depopt/test #29

gildor478 opened this issue Dec 8, 2016 · 7 comments

Comments

@gildor478
Copy link
Member

See ocaml/opam-repository#8031

I have the following in my _oasis:

Flag quickstart_tests                                                           
  Description: Build test-quickstart                                            
  Default: true   

[...]

Executable "test-quickstart"                                                    
  Path: test/test-quickstart                                                    
  MainIs: TestQuickstart.ml                                                     
  Install: false                                                                
  CompiledObject: best                                                          
  Build$: flag(tests) && flag(quickstart_tests)                                 
  BuildDepends: oUnit (>= 2.0.0), findlib, fileutils (>= 0.4.2),                
                expect.pcre (>= 0.0.4), oasis, oasis.builtin-plugins,           
                test-common 

The generated opam:

build-test: [
  ["ocaml" "setup.ml" "-configure" "--enable-tests"]
  ["ocaml" "setup.ml" "-build"]
  ["ocaml" "setup.ml" "-test"]
]
build-doc: [ "ocaml" "setup.ml" "-doc" ]
depends: [
  "base-unix"
  "camlp4" {test}
  "fileutils" {test & >= "0.4.2"}
  "ocamlbuild"
  "ocamlfind" {>= "1.3.1"}
  "ocamlify" {build}
  "ocamlmod" {build}
  "omake" {test}
  "ounit" {test & >= "2.0.0"}
  "pcre" {test}
]
depopts: [
  "benchmark"
  "expect"
]
conflicts: [
  "benchmark" {< "1.2"}
  "expect" {< "0.0.4"}
  "oasis-mirage" {= "0.3.0"}
  "oasis-mirage" {= "0.3.0a"}
]

And the following error when building:

# ocamlfind: Package `expect.pcre' not found
# W: Field 'pkg_expect_pcre' is not set: Command ''/home/travis/.opam/4.03.0/bin/ocamlfind' query -format %d expect.pcre > '/tmp/oasis-402383.txt'' terminated with error code 2
# E: Cannot find findlib package expect.pcre (>= 0.0.4)
# E: Failure("1 configuration error")

What I expect is to have either:

  • build-test to disable quickstart-tests:
build-test: [
  ["ocaml" "setup.ml" "-configure" "--enable-tests" "--disable-quickstart-tests"]
  ["ocaml" "setup.ml" "-build"]
  ["ocaml" "setup.ml" "-test"]
]
  • OR take into account default value of the flag and update depends/depopts/conflicts accordingly:
depends: [
  "base-unix"
  "camlp4" {test}
  "fileutils" {test & >= "0.4.2"}
  "ocamlbuild"
  "ocamlfind" {>= "1.3.1"}
  "ocamlify" {build}
  "ocamlmod" {build}
  "omake" {test}
  "ounit" {test & >= "2.0.0"}
  "pcre" {test}
  "expect" {test & >= "0.0.4"}
]
depopts: [
  "benchmark"
]
conflicts: [
  "benchmark" {< "1.2"}
  "oasis-mirage" {= "0.3.0"}
  "oasis-mirage" {= "0.3.0a"}
]
@Chris00
Copy link
Member

Chris00 commented Dec 8, 2016

The dev version of oasis2opam generates:

depends: [
  "base-unix"
  "camlp4" {test}
  "expect" {test & >= "0.0.4"}
  "fileutils" {test & >= "0.4.2"}
  "ocamlbuild"
  "ocamlfind" {>= "1.3.1"}
  "ocamlify" {build}
  "ocamlmod" {build & test}
  "omake" {test}
  "ounit" {test & >= "2.0.0"}
  "pcre" {test}
]
depopts: [
  "benchmark"
]
conflicts: [
  "benchmark" {< "1.2"}
  "oasis-mirage" {= "0.3.0"}
  "oasis-mirage" {= "0.3.0a"}
]

@Chris00
Copy link
Member

Chris00 commented Dec 8, 2016

Notice that oasis2opam issue warnings on https://forge.ocamlcore.org/frs/download.php/1669/oasis-0.4.8.tar.gz about oasis.install and _oasis_remove_.ml. It would be good to add those files to the tarball.

@Chris00
Copy link
Member

Chris00 commented Dec 8, 2016

See ocaml/opam-repository#8040

@Chris00
Copy link
Member

Chris00 commented Dec 8, 2016

It seems build & test is causing a problem, not implying build (even though the manual seem to say so).

@gildor478
Copy link
Member Author

gildor478 commented Dec 8, 2016

_oasis_remove_.ml was the thing used to "chdir" ? If this is the case, it should not be useful anymore and it would be better to remove it.

Concerning the the oasis.install, I thought it belonged to the packaging and should be in opam/files (I read it in the manual). Why would the upstream author have to provide this file?

@Chris00
Copy link
Member

Chris00 commented Dec 8, 2016

About _oasis_remove_.ml, good to know that the -C flag is available in the latest release. I've updated oasis2opam and the PR for oasis.

For oasis.install, the OPAM manual indeed talks about that file without expressing a clear preference. A discussion — somewhere on Github I think — made clear however that <pkg>.install files are not welcome in the opam-repository in order not to "pollute" everybody with extra files that may not be useful for them.

@gildor478
Copy link
Member Author

Forking the discussion in #30 and #31 so that we can close this bug.

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

No branches or pull requests

2 participants