-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
ocamlfuse: 2.7-3 -> 2.7.1cvs5 #29606
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
Conversation
@@ -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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"; }
(cherry picked from commit 595d92e)
Motivation for this change
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)