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

coq_HEAD: Update to the latest commit #21822

Merged
merged 3 commits into from Apr 30, 2017
Merged

coq_HEAD: Update to the latest commit #21822

merged 3 commits into from Apr 30, 2017

Conversation

rht
Copy link
Member

@rht rht commented Jan 12, 2017

Motivation for this change

Testing an automatically generated nix file update, through https://github.com/rht/nixpkg-git-fetch-head/blob/master/nixpkg-git-fetch-head.sh.
With tiny modification (e.g. replace the ls-remote HEAD tag with release tags), this could be used for other packages that mainly use fetchgit.

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 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.

@mention-bot
Copy link

@rht, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jwiegley, @vbgl and @oconnorr to be potential reviewers.

@vbgl
Copy link
Contributor

vbgl commented Jan 12, 2017

The value of the version attribute looks weird. In particular it makes the derivation name coq-V8.6beta1 and version 203-g…; none of which makes much sense to me.

@rht
Copy link
Member Author

rht commented Jan 12, 2017

What should be a consistent way to name the version such that this can be specified in the code? It is generated by git-describe as has been used in fetchGit. 203 is the number of tags present in the coq repo, and can be clipped away. Would coq-v8.6beta1 and/or g37817bb5a be fine?

@vbgl
Copy link
Contributor

vbgl commented Jan 14, 2017

coq-V8.6beta1 is definitely a wrong name: coq is enough, or coq-head (or coq-master or whatever) if you want to distinguish is from the released ones. For the version you need a number that increases with time (before the hash); the commit date might be more readable than the number of tags.

Finally, what about something like coq-head-${date}-${git-describe}?

@rht
Copy link
Member Author

rht commented Jan 14, 2017

I just checked from https://git-scm.com/docs/git-describe that the number represents the number of additional commits since the most recent tag. The prefix 'g' refers to git. Have yet to check how other vcs describe the version of their most recent commits.

@rht
Copy link
Member Author

rht commented Jan 14, 2017

@vbgl how should I put a constraint on the ocaml version s.t. it is at least 4.02.1?

@rht
Copy link
Member Author

rht commented Jan 14, 2017

For the version you need a number that increases with time (before the hash); the commit date might be more readable than the number of tags.

This is simpler if it is up to the standard convention of each vcs (and each project's tags).

@vbgl
Copy link
Contributor

vbgl commented Jan 14, 2017

What do you call a constraint? If you expect nix to solve such constraints then I don’t know.

You can check the property you mention with stdenv.lib.versionAtLeast ocaml.version "4.02.1". If this evaluates to false, you can return null, throw an error, return a derivation with a meta.broken attribute set to true, etc.

@rht
Copy link
Member Author

rht commented Jan 14, 2017

I see, tho is it possible to specify something along the line of ">=4.02.1" then have nix automatically overrides the default if it is older than that, rather than having a broken package? Currently, I have to put this by hand at ./pkgs/top-level/all-packages.nix.

@rht
Copy link
Member Author

rht commented Jan 14, 2017

I think the only objection remaining for this PR is the versioning scheme, which as I stated, would be better to reuse the existing tag by the coq package maintainer (the number of extra commits rather than the timestamp).

@vbgl
Copy link
Contributor

vbgl commented Jan 14, 2017

Let me rephrase: the version number should start by a digit; this is why I suggest to put a timestamp in front of the output of git-describe. Otherwise, this changes the name of the package to something rather confusing.

@rht
Copy link
Member Author

rht commented Jan 14, 2017

I see, it looks like there is one case e.g. noto-fonts with version git-2016-03-29. I have added the date, now it is coq-2017-01-09-V8.6beta1-203-g37817bb5a

@rht
Copy link
Member Author

rht commented Jan 14, 2017

alt:coq-git-V8.6beta1-203-g37817bb5a

csdpPatch = if csdp != null then ''
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
'' else "";
ocaml = ocamlPackages_4_02.ocaml;
Copy link
Member Author

Choose a reason for hiding this comment

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

@vbgl I overrode the definition here so that there is no need to put an extra prefix ocamlPackages_4_02 in buildInputs. Plus, the version-specific statement is localized to only within the let clause. WDYT?

in

stdenv.mkDerivation {
name = "coq-${version}";

inherit coq-version;
inherit ocaml camlp5;
inherit ocaml findlib lablgtk camlp5;
Copy link
Contributor

Choose a reason for hiding this comment

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

What’s the purpose of this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are several ways to specify the scope (in all-packages.nix, in the let clause, or casted in inherit and buildInputs), I picked the let option because it is most localized within each packages nix file. If it were to be casted in inherit and buildInputs it'd be too verbose.

Copy link
Contributor

Choose a reason for hiding this comment

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

This change adds two attributes to the argument of mkDerivation these two attributes are never used. So I wonder why you define them.

The ocaml and camlp5 attributes are not used it this derivation but in some Coq libraries that define OCaml plugins: they have to be compiled with the same version of the OCaml compiler that is used to compile Coq itself. That’s why these attributes “remember” with which OCaml/camlp5 Coq is compiled.

BTW, what do you call “casted”?

Copy link
Member Author

@rht rht Jan 22, 2017

Choose a reason for hiding this comment

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

This change adds two attributes to the argument of mkDerivation these two attributes are never used. So I wonder why you define them.

I assumed this is necessary because of https://github.com/NixOS/nixpkgs/pull/21822/files#diff-036410e9211b4336186fc613f7200b12L16966. But it looks like defining it in let is sufficient for coq-modules to get the right version of camlp5 (coq.camlp5).

BTW, what do you call “casted”?

I refer (ocamlPackages) ocaml ... as casting (nonstandard terminology, but it sure looks like type casting).

Copy link
Member Author

Choose a reason for hiding this comment

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

Confirmed, coq.camlp5 has been used several times but neither for coq.findlib and coq.lablgtk.

Copy link
Contributor

Choose a reason for hiding this comment

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

I refer (ocamlPackages) ocaml ... as casting.

This piece of syntax cannot exist alone: it must come after the inherit keyword. It has nothing to do with type casting; it defines some attributes. See the nix manual for details.

Copy link
Member Author

@rht rht Jan 22, 2017

Choose a reason for hiding this comment

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

I know, I was just using 'casting' to describe the parentheses syntax. From the manual, this wasn't stated explicitly, only as an example ((xlibs)).

@vbgl
Copy link
Contributor

vbgl commented Jan 22, 2017 via email

@rht
Copy link
Member Author

rht commented Jan 22, 2017

Well, fine, in C-like langs, typecasting / type conversion can't be stated as a stand-alone expression, while ++ could.

Since version MUST start with a number, so I suppose it should inserted into the name attribute.
The point of this PR is to update the coq_HEAD version (making the package name properly formed, when it previously wasn't, is a side effect).

@rht
Copy link
Member Author

rht commented Jan 22, 2017

(This is outside the scope of this PR, but any conclusion/standardization made here should apply to these packages as well:

# HEAD/head files
./pkgs/applications/editors/emacs-modes/proofgeneral/HEAD.nix
./pkgs/development/coq-modules/fiat/HEAD.nix
./pkgs/development/libraries/xcb-util-cursor/HEAD.nix
./pkgs/development/compilers/ghc/head.nix
./pkgs/development/compilers/ghcjs/head.nix
# unstable files
./pkgs/applications/window-managers/bspwm/unstable.nix
./pkgs/applications/window-managers/sxhkd/unstable.nix
./pkgs/applications/networking/remote/freerdp/unstable.nix
./pkgs/applications/science/math/pari/unstable.nix
./pkgs/tools/compression/xdelta/unstable.nix
./pkgs/tools/compression/brotli/unstable.nix
./pkgs/tools/networking/isync/unstable.nix
./pkgs/tools/package-management/nixops/unstable.nix
./pkgs/development/libraries/botan/unstable.nix
./pkgs/development/libraries/audio/lv2/unstable.nix
./pkgs/development/tools/misc/patchelf/unstable.nix
./pkgs/misc/jackaudio/unstable.nix
./pkgs/misc/gnuk/unstable.nix
# grep -l 'git-20' (packages with version prefixed with `git-`)
pkgs/data/fonts/inconsolata/lgc.nix
pkgs/data/fonts/noto-fonts/default.nix
pkgs/shells/pash/default.nix
pkgs/shells/fish-foreign-env/default.nix
pkgs/shells/es/default.nix
pkgs/top-level/python-packages.nix
pkgs/applications/window-managers/velox/default.nix
pkgs/applications/window-managers/compton/git.nix
pkgs/applications/window-managers/stumpwm/default.nix
pkgs/applications/window-managers/orbment/default.nix
pkgs/applications/virtualization/driver/win-pvdrivers/default.nix
pkgs/applications/editors/supertux-editor/default.nix
pkgs/applications/networking/mumble/default.nix
pkgs/applications/networking/remote/remmina/default.nix
pkgs/applications/networking/znc/modules.nix
pkgs/applications/graphics/rawtherapee/dev.nix
pkgs/applications/science/electronics/caneda/default.nix
pkgs/applications/science/math/caffe/default.nix
pkgs/applications/audio/lv2bm/default.nix
pkgs/applications/audio/squeezelite/default.nix
pkgs/applications/audio/foo-yc20/default.nix
pkgs/applications/audio/mod-distortion/default.nix
pkgs/applications/misc/dmenu/wayland.nix
pkgs/applications/misc/st/wayland.nix
pkgs/applications/misc/finalterm/default.nix
pkgs/applications/misc/open-pdf-presenter/default.nix
pkgs/applications/misc/twmn/default.nix
pkgs/applications/misc/llpp/default.nix
pkgs/applications/misc/dfilemanager/default.nix
pkgs/servers/neard/default.nix
pkgs/os-specific/linux/miraclecast/default.nix
pkgs/os-specific/linux/pflask/default.nix
pkgs/tools/security/nsjail/default.nix
pkgs/tools/security/tpm-luks/default.nix
pkgs/tools/networking/email/default.nix
pkgs/tools/networking/horst/default.nix
pkgs/tools/networking/isync/unstable.nix
pkgs/tools/system/das_watchdog/default.nix
pkgs/tools/filesystems/fuse-7z-ng/default.nix
pkgs/tools/misc/mdbtools/git.nix
pkgs/tools/cd-dvd/vobsub2srt/default.nix
pkgs/tools/X11/xprintidle-ng/default.nix
pkgs/tools/X11/dragon-drop/default.nix
pkgs/tools/X11/ksuperkey/default.nix
pkgs/tools/X11/xsettingsd/default.nix
pkgs/tools/X11/skippy-xd/default.nix
pkgs/development/lisp-modules/lisp-packages.nix
pkgs/development/libraries/neardal/default.nix
pkgs/development/libraries/science/math/clblas/cuda/default.nix
pkgs/development/libraries/swc/default.nix
pkgs/development/libraries/wld/default.nix
pkgs/development/compilers/wla-dx/default.nix
pkgs/development/python-modules/pycuda/compyte.nix
pkgs/development/tools/haskell/multi-ghc-travis/default.nix
pkgs/misc/screensavers/xss-lock/default.nix
pkgs/games/rigsofrods/default.nix
# grep -l hg-20
pkgs/applications/window-managers/wmii-hg/default.nix
pkgs/applications/editors/vim/configurable.nix
pkgs/development/libraries/libixp-hg/default.nix
pkgs/development/libraries/ogre/default.nix

)

@vbgl
Copy link
Contributor

vbgl commented Jan 25, 2017 via email

@rht
Copy link
Member Author

rht commented Jan 25, 2017

coq.findlib added.

@@ -6,6 +6,7 @@
}:

stdenv.mkDerivation rec {
version = ";";
Copy link
Member

Choose a reason for hiding this comment

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

Why was this line added?

Copy link
Member Author

Choose a reason for hiding this comment

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

(accidentally did git commit -am on an unstaged local change ... reverting this line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants