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

Octave modules #108562

Merged
merged 68 commits into from
Feb 24, 2021
Merged

Octave modules #108562

merged 68 commits into from
Feb 24, 2021

Conversation

KarlJoad
Copy link
Contributor

@KarlJoad KarlJoad commented Jan 6, 2021

Motivation for this change

This PR would fulfill the request in Issue #65398.

Much of the code mirrors that of lua and python, and not insignificant portions were built out of that.

This is a very messy branch, I know. I attempted a naive approach the first time, which really did not work in my favor.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

No tests were present in nixos/tests for Octave, so there is nothing to do on that front.

@KarlJoad KarlJoad self-assigned this Jan 6, 2021
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 6, 2021
@SuperSandro2000
Copy link
Member

@KarlJoad please fix the merge conflict.

pkgs/development/interpreters/octave/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/octave-packages.nix Outdated Show resolved Hide resolved
pkgs/top-level/octave-packages.nix Outdated Show resolved Hide resolved
pkgs/top-level/octave-packages.nix Outdated Show resolved Hide resolved
pkgs/top-level/octave-packages.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/octave/wrapper.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/octave/wrapper.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Jan 6, 2021
@KarlJoad
Copy link
Contributor Author

KarlJoad commented Jan 6, 2021

@KarlJoad please fix the merge conflict.

Fixed! 😄

I forgot to rebase before opening the request, so I just had to do a massive rebase and sort a few things out.

KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 6, 2021
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 6, 2021
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 6, 2021
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
In the comment presented here:
NixOS#108562 (comment)

I was presented with a simpler way of formatting/building the meta
attribute set. This commit is a squash of performing these changes on
all packages that are currently defined.

octave/control: simplify meta attr set

octave/general: simplify meta attr set

octave/io: simplify meta attr set

octave/level-set: simplify meta attr set

octave/linear-algebra: simplify meta attr set

octave/ltfat: simplify meta attr set

octave/signal: simplify meta attr set

octave/symbolic: simplify meta attr set
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
This bug was introduced when KarlJoad performed a *very* large rebase
after opening PR NixOS#108562.
NixOS#108562

Essentially, while working on getting octave packages usable, octave
was changed quite a bit, and many thing in passthru were changed.
I was manipulating passthru to make some other things work, and I
accidentally flipped some things around.

This commit is meant to fix that.
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 7, 2021
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-linux: 1-10 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Jan 7, 2021
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108562 run on x86_64-linux 1

2 packages marked as broken and skipped:
  • octavePackages.level-set
  • octavePackages.ltfat
5 packages built:
  • octavePackages.control
  • octavePackages.io
  • octavePackages.linear-algebra
  • octavePackages.signal
  • octavePackages.symbolic

pkgs/development/octave-modules/symbolic/default.nix Outdated Show resolved Hide resolved
pkgs/development/octave-modules/symbolic/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/octave-packages.nix Outdated Show resolved Hide resolved
pkgs/top-level/octave-packages.nix Outdated Show resolved Hide resolved
pkgs/development/interpreters/octave/default.nix Outdated Show resolved Hide resolved
KarlJoad added a commit to KarlJoad/nixpkgs that referenced this pull request Jan 7, 2021
This allows packages to declare other octave package dependencies in
their respective definitions, and when added here, they are implicitly
passed.

In response to:
NixOS#108562 (comment)
@doronbehar
Copy link
Contributor

Thanks once more @KarlJoad for all the work. I took the liberty to shorten the commit messages even further to include only necessary information. I tested symbolic which I intend to use in my default octave interpreter and I also tested strings (as a random example) and it proved to be functional enough. Will merge once CI is green! 🎉 .

The next step is to document how Octave packages are handled in Nixpkgs... 📖.

@doronbehar doronbehar merged commit aca03db into NixOS:master Feb 24, 2021
@Misterio77
Copy link
Member

Hey, @doronbehar. Sorry for the ping, and i know this isn't exactly the right place to ask, but i've looked around and couldn't get symbolic working using nix at all.

Should nix-shell -p octave octavePackages.symbolic be enough to get octave to load symbolic, or am i missing something?

I'd love to help document this if at all possible, too.

@Misterio77
Copy link
Member

Got it working using octave.withPackages, just in case someone stumbles upon this

{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    (octave.withPackages (ps: with ps; [symbolic]))
  ];
}

@KarlJoad
Copy link
Contributor Author

@Misterio77, while technically possible open a shell with the octave package completely standalone, there is some trickery with text-based database files when using withPackages that is required to make packages usable with the actual octave package. If you specify just the package, then the package will be downloaded, compiled, and saved as an output tarball for later installation. If you want to actually use the package, then you must specify octave.withPackages, much like you must with Python.

@Misterio77
Copy link
Member

That makes a lot more sense! Thanks for helping a newbie understand it haha :))

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.

6 participants