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

rubiks: init at 20070917 #38803

Merged
merged 1 commit into from Apr 22, 2018
Merged

rubiks: init at 20070917 #38803

merged 1 commit into from Apr 22, 2018

Conversation

timokau
Copy link
Member

@timokau timokau commented Apr 11, 2018

Motivation for this change

Package rubiks.

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
    • other Linux distributions
  • 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.

];

meta = with stdenv.lib; {
homepage = https://github.com/graph-algorithms/edge-addition-planarity-suite;
Copy link
Member

Choose a reason for hiding this comment

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

That doesn't seem correct

@Ma27
Copy link
Member

Ma27 commented Apr 13, 2018

do we really want to add a package from 2007 into our package set?

@timokau
Copy link
Member Author

timokau commented Apr 13, 2018

Why not? I don't think rubiks cubes have changed significantly since then.

@Ma27
Copy link
Member

Ma27 commented Apr 13, 2018

that’s true, it might’ve reached some kind of EOL phase though. Before each release we fix tons of packages because of independencies (such as am inconpatible GCC versions) and I think that packages from 2007 will be quite painful to keep building..

@timokau
Copy link
Member Author

timokau commented Apr 13, 2018

It works for now without any special attention. I'm packaging this as a sage dependency, which means theres at least one other group interested in keeping it buildable.


installFlags = [
"DESTDIR=${placeholder "out"}"
"PREFIX="
Copy link
Member

Choose a reason for hiding this comment

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

Normally, setting the prefix is preferred.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm sure I had a reason for that, I'll check what happens if I leave it out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay it works if I just set

    "PREFIX=${placeholder "out"}"

But shouldn't that be done automatically anyways?

Copy link
Member

Choose a reason for hiding this comment

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

No, it's --prefix that is set by default: https://nixos.org/nixpkgs/manual/#ssec-configure-phase

Does it work if you do just "PREFIX=$out"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

mit # Dik T. Winter's software
];
maintainers = with maintainers; [ timokau ];
platforms = platforms.all;
Copy link
Member

Choose a reason for hiding this comment

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

Tested?

@dotlambda
Copy link
Member

Considering the number of patches, this is maybe better suited for a sage overlay.

@Ma27
Copy link
Member

Ma27 commented Apr 14, 2018

agreed, that's what I'm worried about - we need several patches ATM to keep it working and I fear that the number will grow with the time it lives in nixpkgs which will cause additional (and IMO avoidable) overload especially in the last weeks before a release.

It's absolutely not that I want to discourage @timokau's work, I'm just not sure if we actually want to add as many packages as possible and rather say no to some new packages (e.g. when they're way to old).
I don't know about the further context and status of this package, but are there any people reachable that could keep the project alive? I (personally) believe that such cases upstream needs to get their stuff fixed before we can make this available in our package set.

@timokau
Copy link
Member Author

timokau commented Apr 15, 2018

agreed, that's what I'm worried about - we need several patches ATM to keep it working and I fear that the number will grow with the time it lives in nixpkgs which will cause additional (and IMO avoidable) overload especially in the last weeks before a release.

The patches are effectively the sage developers way to maintain it. I'm not sure why they prefer it to altering the source tarball in this case, since the tarball is generated by them anyways, but maybe they just want to keep it reproducible from the upstream packages. Debian, Gentoo and Arch all package this (and all the other packages I've created PRs for).

When the package breaks somebody may fix it, probably me. If nobody does, it gets marked broken and someone might still fix it in the future. I am pretty sure there are multiple people here interested in sage, and nix might attract more once its packaged in a proper way (I think nix and sage more or less attrackt similar groups of people).

If I create an overlay, all the maintenance burden is on me alone. I don't know if I can or want to maintain that.

It's absolutely not that I want to discourage @timokau's work, I'm just not sure if we actually want to add as many packages as possible and rather say no to some new packages (e.g. when they're way to old).
I don't know about the further context and status of this package, but are there any people reachable that could keep the project alive? I (personally) believe that such cases upstream needs to get their stuff fixed before we can make this available in our package set.

The sagemath upstream effectively maintains this. They have a big community and are pretty active. For reference:
https://trac.sagemath.org/search?q=rubiks

Apparently somebody already suggested a proper fork (instead of the "pach fork" they currently maintain): https://trac.sagemath.org/ticket/21493

};

preConfigure = ''
export INSTALL="${coreutils}/bin/install"
Copy link
Member

Choose a reason for hiding this comment

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

You can actually do this as an attribute instead of configure:

INSTALL="${coreutils}/bin/install";

Copy link
Member Author

Choose a reason for hiding this comment

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

But is that better? It would clutter the attributes of the package and basically depend on a side-effect of how attributes are handled (and passed as environment variables) in nix, right?

Copy link
Member

Choose a reason for hiding this comment

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

this the standard way to set environment variables.

@matthewbauer
Copy link
Member

matthewbauer commented Apr 19, 2018

I'm inclined to merge this. 4 patches is a lot but not ridiculous. Eventually we will have "inclusion" rules for what can go in Nixpkgs but right now there are none AFAIK (except maybe against nonfree stuff).

@GrahamcOfBorg build rubiks

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: rubiks

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: rubiks

Partial log (click to expand)

/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin/install dietz/mcube/mcube ut/bin
/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin/install dietz/cu2/cu2 ut/bin
/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin/install dik/dikcube ut/bin
/nix/store/jy9knxp7nmw80jkf932axrs1b4p9k4hi-coreutils-8.29/bin/install dik/size222 ut/bin
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/4clr9jnh8rila1pblsifr5mdz9pra9k6-rubiks-20070912
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/4clr9jnh8rila1pblsifr5mdz9pra9k6-rubiks-20070912
checking for references to /build in /nix/store/4clr9jnh8rila1pblsifr5mdz9pra9k6-rubiks-20070912...
/nix/store/4clr9jnh8rila1pblsifr5mdz9pra9k6-rubiks-20070912

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: rubiks

Partial log (click to expand)

/nix/store/0svz5all13h1lxkfbx5y9vvy6r4cy422-coreutils-8.29/bin/install dietz/mcube/mcube ut/bin
/nix/store/0svz5all13h1lxkfbx5y9vvy6r4cy422-coreutils-8.29/bin/install dietz/cu2/cu2 ut/bin
/nix/store/0svz5all13h1lxkfbx5y9vvy6r4cy422-coreutils-8.29/bin/install dik/dikcube ut/bin
/nix/store/0svz5all13h1lxkfbx5y9vvy6r4cy422-coreutils-8.29/bin/install dik/size222 ut/bin
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/7h489mh054fxrpjlqvcja1zwd0lz42av-rubiks-20070912
strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/7h489mh054fxrpjlqvcja1zwd0lz42av-rubiks-20070912
checking for references to /build in /nix/store/7h489mh054fxrpjlqvcja1zwd0lz42av-rubiks-20070912...
/nix/store/7h489mh054fxrpjlqvcja1zwd0lz42av-rubiks-20070912

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: rubiks

Partial log (click to expand)

/nix/store/4clr9jnh8rila1pblsifr5mdz9pra9k6-rubiks-20070912

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: rubiks

Partial log (click to expand)

/nix/store/7h489mh054fxrpjlqvcja1zwd0lz42av-rubiks-20070912

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: rubiks

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@matthewbauer
Copy link
Member

One thing that might be neat and lessen the maintenance burden would be an automatic importer of these Sage packages. It's common to have things like this for instance "cabal2nix" or "emacs2nix". Perhaps someone wants to try something like "spkg2nix".

A good start for the above would be creating a shared file like pkgs/science/math/sage/default.nix that holds all of the sage stuff. Not sure if that makes sense it just might help with clutter in all-packages.nix at least.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: rubiks

Partial log (click to expand)

/nix/store/7h489mh054fxrpjlqvcja1zwd0lz42av-rubiks-20070912

@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 19, 2018
@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 19, 2018
@timokau
Copy link
Member Author

timokau commented Apr 20, 2018

One thing that might be neat and lessen the maintenance burden would be an automatic importer of these Sage packages. It's common to have things like this for instance "cabal2nix" or "emacs2nix". Perhaps someone wants to try something like "spkg2nix".

I actually do have such an exporter, which is what I started out with. But then I migrated all the packages to system packages one-by-one. The generated packages are not very pretty (because spkgs simply don't have as much information as a nix package, sometimes transitive dependencies are assumed, no difference between build inputs and native build inputs etc.). Also most sage dependencies are already packaged, and re-generating duplicates of those defeats the point of packaging it with system packages.

Edit: For comparison, here is the auto-generated rubiks.nix (could be improved a bit of course, but not to the level of hand-written): https://gist.github.com/timokau/dd42ccaf273afdbcbd85de913db8d6f7

@matthewbauer matthewbauer merged commit d0d7894 into NixOS:master Apr 22, 2018
@timokau timokau deleted the rubiks-init branch April 22, 2018 17:27
@timokau timokau mentioned this pull request Apr 27, 2018
8 tasks
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