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

ocamlfuse: 2.7-3 -> 2.7.1cvs5 #29606

Merged
merged 2 commits into from Sep 21, 2017
Merged

ocamlfuse: 2.7-3 -> 2.7.1cvs5 #29606

merged 2 commits into from Sep 21, 2017

Conversation

romildo
Copy link
Contributor

@romildo romildo commented Sep 20, 2017

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -1,12 +1,13 @@
{ stdenv, fetchFromGitHub, ocaml, camlidl, fuse, findlib }:

stdenv.mkDerivation rec {
name = "ocamlfuse-2.7-3";
name = "ocamlfuse-${version}";
version = "2.7.1_cvs5";
Copy link
Member

@Mic92 Mic92 Sep 20, 2017

Choose a reason for hiding this comment

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

This is not a valid version spec in nix. We would need something like 2.7.1cvs5 for nix and something else for the revision field. You could use to variables to build the version numbers for both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where can the rules for the name and version of packages be found?

Copy link
Member

@Mic92 Mic92 Sep 21, 2017

Choose a reason for hiding this comment

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

I think I was wrong in this case:

$ nix-repl
nix-repl> :l <nixpkgs>
nix-repl> lib.getVersion "ocamlfuse-2.7.1_cvs5"
"2.7.1_cvs5"
nix-repl> lib.getVersion "ocamlfuse-2.7.1cvs5"
"2.7.1cvs5"
nix-repl> builtins.compareVersions "ocamlfuse-2.7.1cvs5" "ocamlfuse-2.7.2"
-1
nix-repl> builtins.compareVersions "ocamlfuse-2.7.1_cvs5" "ocamlfuse-2.7.2"
-1

both works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upstream considers the version is 2.7.1-cvs5, with a dash instead of an underscore. The underscore appears only in the git tag v2.7.1_cvs5:

$ nix-build --check --option build-use-chroot true -K -A ocamlPackages.ocamlfuse 2>&1 | tee /var/tmp/nix-build.log
checking path(s) ‘/nix/store/yjwd3f799l20sl76zcqsrybjp5kgrfp4-ocamlfuse-2.7.1cvs5’
unpacking sources
unpacking source archive /nix/store/iv1ha8rbx8jmb1dimhlr8hsjxlpd2dz1-ocamlfuse-v2.7.1_cvs5-src
source root is ocamlfuse-v2.7.1_cvs5-src
/nix/store/j1ly0zzpnzb8y8ry6k4vi4prk8vwq233-set-source-date-epoch-to-latest.sh: line 7: warning: command substitution: ignored null byte in input
patching sources
configuring

Configuration:
ocamlfind: ........................................... /nix/store/ajbbfbxiglqg04m9gw31b44gy3qs5fng-ocaml-findlib-1.7.3/bin/ocamlfind
ocamlc: .............................................. /nix/store/mdq19cizkg3358xzhysfg213bamspq56-ocaml-4.02.3/bin/ocamlc.opt
ocamlopt: ............................................ /nix/store/mdq19cizkg3358xzhysfg213bamspq56-ocaml-4.02.3/bin/ocamlopt.opt
ocamlbuild: .......................................... /nix/store/mdq19cizkg3358xzhysfg213bamspq56-ocaml-4.02.3/bin/ocamlbuild
Package name: ........................................ ocamlfuse
Package version: ..................................... 2.7.1-cvs5

The same happens in the OPAM package.

Is 2.7.1-cvs5 a valid version in NixOS? I think so.

$ nix-repl
Welcome to Nix version 1.11.15. Type :? for help.

nix-repl> :l <nixpkgs>
Added 7837 variables.

nix-repl> lib.getVersion "ocamlfuse-2.7.1-cvs5"
"2.7.1-cvs5"

nix-repl> builtins.compareVersions "ocamlfuse-2.7.1-cvs5" "ocamlfuse-2.7.2"
-1

Maybe we should have 2.7.1-cvs5 too.

Copy link
Member

Choose a reason for hiding this comment

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

According to the manual it is:

  <varlistentry><term><function>builtins.parseDrvName</function>
  <replaceable>s</replaceable></term>
    <listitem><para>Split the string <replaceable>s</replaceable> into
    a package name and version.  The package name is everything up to
    but not including the first dash followed by a digit, and the
    version is everything following that dash.  The result is returned
    in a set <literal>{ name, version }</literal>.  Thus,
    <literal>builtins.parseDrvName "nix-0.12pre12876"</literal>
    returns <literal>{ name = "nix"; version = "0.12pre12876";
    }</literal>.</para></listitem>
  </varlistentry>

Copy link
Member

Choose a reason for hiding this comment

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

So the only limitation is no dashes in the name itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More precisely, the limitation is no dash followed by a digit in the name itself. For instance:

$ nix-repl
Welcome to Nix version 1.11.15. Type :? for help.

nix-repl> :l <nixpkgs>
Added 7837 variables.

nix-repl> builtins.parseDrvName "ocamlfuse-2.7.1-cvs5"
{ name = "ocamlfuse"; version = "2.7.1-cvs5"; }

nix-repl> builtins.parseDrvName "my-package-v2.7.1-cvs5-1.0-p3"
{ name = "my-package-v2.7.1-cvs5"; version = "1.0-p3"; }

@romildo romildo changed the title ocamlfuse: 2.7-3 -> 2.7.1-cvs5 ocamlfuse: 2.7-3 -> 2.7.1cvs5 Sep 21, 2017
@Mic92 Mic92 merged commit 595d92e into NixOS:master Sep 21, 2017
@romildo romildo deleted the upd.ocamlfuse branch September 21, 2017 11:18
globin pushed a commit that referenced this pull request Sep 22, 2017
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.

None yet

2 participants