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

Cdo: init at 1.7.2 #22496

Merged
merged 4 commits into from Sep 5, 2017
Merged

Cdo: init at 1.7.2 #22496

merged 4 commits into from Sep 5, 2017

Conversation

ltavard
Copy link
Contributor

@ltavard ltavard commented Feb 6, 2017

Motivation for this change

CDO is a collection of command line Operators to manipulate and analyse Climate and NWP model Data.
We want to deploy it on our HPC platform.

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

@ltavard, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zraexy, @zimbatm and @peti to be potential reviewers.

@@ -0,0 +1,60 @@
{ stdenv, fetchurl, curl
, enable_data ? true # DATA support [default=yes]
Copy link
Contributor

@joachifm joachifm Feb 9, 2017

Choose a reason for hiding this comment

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

Note that these parameters are not discoverable. Packages in Nixpkgs are usually configured with lowest-common denominator in mind, using params only sparingly. Reifying every configure switch as a parameter is certainly going overboard in any case.

Please consider reducing this to only cover options users are likely to want to change or for features that are particularly costly in terms of build footprint.


# Configure phase
configureFlags = ''
${if enable_data then "--enable-data" else ""}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider using optionalString or specifying configureFlags as a list of strings, using optional(s) for optional flags.

'';

meta = {
description = "collection of command line Operators to manipulate and analyse Climate and NWP model Data";
Copy link
Contributor

Choose a reason for hiding this comment

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

Please capitalize meta.description.


meta = {
description = "collection of command line Operators to manipulate and analyse Climate and NWP model Data";
longDescription = '' Supported data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG.
Copy link
Contributor

@joachifm joachifm Feb 9, 2017

Choose a reason for hiding this comment

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

A better/more idiomatic syntax for longDescription (or multi-line Nix strings in general) is

''
  Lorem ipsum
  Lorem ipsum.
''

@joachifm
Copy link
Contributor

joachifm commented Feb 9, 2017

Also please consider building this with sandboxing enabled to help ensure that there are no implicit dependencies.

@ltavard
Copy link
Contributor Author

ltavard commented Jun 14, 2017

I adjusted my default.nix file according to your remarks.
I hope that answered your expectations.

, enable_cdi_lib ? false # build, install and link to a CDI library [default=no]
, enable_all_static ? false # build a completely statically linked CDO binary [default=no]
, enable_cxx ? false # Use CXX as default compiler [default=no]
, with_gnu_ld ? false # assume the C compiler uses GNU ld [default=no]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it actually necessary to specify --with-gnu-ld? I can't recall that ever being an issue, autoconf seems to be able to figure it out.

Also see other expressions that use feature flags; you normally use parameters named fooSupport or withFoo. For consistency, I recommend following that pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment, after testing it's not necessary. So I deleted the option

"--with-netcdf=${netcdf}" "--with-hdf5=${hdf5}"]
++ stdenv.lib.optional (enable_cdi_lib) "--enable-cdi-lib"
++ stdenv.lib.optional (enable_all_static) "--enable-all-static"
++ stdenv.lib.optional (enable_cxx) "--enable-cxx"
Copy link
Contributor

Choose a reason for hiding this comment

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

Syntax error here, missing list terminator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for this,
I have just pushed the new version

@knedlsepp
Copy link
Member

@ltavard: Could you squash your changes to a single cdo: init at 1.7.2 commit? I think this is pretty clean now and we should get this merged. (I wanna use it! ;-) )
@joachifm: Is there anything more that you think should be done before we can merge it?
One more thing: Just did a quick compilation test and it should work on macOS too:

platforms = with stdenv.lib.platforms; linux ++ darwin;

@zimbatm zimbatm merged commit bf491f8 into NixOS:master Sep 5, 2017
@zimbatm
Copy link
Member

zimbatm commented Sep 5, 2017

All good! Just added darwin and fixed some ws and then merged

globin pushed a commit that referenced this pull request Sep 5, 2017
(cherry picked from commit bf491f8)
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

7 participants