Navigation Menu

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

unison-ucm: init at 1.0.M1c alpha #66249

Merged

Conversation

virusdave
Copy link
Contributor

@virusdave virusdave commented Aug 7, 2019

Motivation for this change

Introducing the unison code manager. Previously available via homebrew only.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 nix-review --run "nix-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.
Notify maintainers

cc @

@virusdave
Copy link
Contributor Author

@worldofpeace Any chance you can merge this? Or point me to an appropriate person to ping? Thanks!

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

This is a binary package so it needs to be patched.
You should be able to do this by adding autoPatchelfHook to nativeBuildInputs.

pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch from a037aa8 to f1018d1 Compare August 7, 2019 20:50
@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch from f1018d1 to b185d87 Compare August 7, 2019 21:24
Copy link
Contributor Author

@virusdave virusdave left a comment

Choose a reason for hiding this comment

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

This is a binary package so it needs to be patched.
You should be able to do this by adding autoPatchelfHook to nativeBuildInputs.

I don't really understand what this is. What needs to be patched? Can you explain @worldofpeace ? Thanks!

pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/unison/default.nix Outdated Show resolved Hide resolved
@worldofpeace
Copy link
Contributor

I don't know what happened to this thread, but I can't read it.

I'll try responding like this:

This doesn't work. It fails in "unpacking sources" phase, since no directory is actually created.

You need to do

sourceRoot= ".";

Whatever got unpacked should be in the $CWD for you to copy into $out

I don't follow. Please explain?

I mean cp ucm $out/bin

This is a binary package so it needs to be patched.
You should be able to do this by adding autoPatchelfHook to nativeBuildInputs.

I don't really understand what this is. What needs to be patched? Can you explain @worldofpeace ? Thanks!

https://nixos.wiki/wiki/Packaging/Binaries explains this very well.
Simply put the binary ucm won't work on NixOS without hardcoding libraries to runtime search path of the executable etc. You probably didn't notice this because this binary would work on MacOS by default.

By doing

You should be able to do this by adding autoPatchelfHook to nativeBuildInputs.

it should take care of this for you completely, no need to patch it manually.


Not sure what you'd prefer to see here. This software is called ucm, and it is (description) the Unison Codebase Manager. What do you recommend i put here?

I got this from their github
"Modern, statically-typed purely functional language"

@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch from b185d87 to 4818fa1 Compare August 8, 2019 02:28
@virusdave virusdave changed the title unison-ucm: init at 0.0.1 alpha M1c unison-ucm: init at 1.0.M1c alpha Aug 8, 2019
@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch 3 times, most recently from 14822ba to 87bff2e Compare August 8, 2019 02:50
@virusdave
Copy link
Contributor Author

I don't know what happened to this thread, but I can't read it.

I'm sure i messed it up somehow, but not sure how. Sorry :(

I'll try responding like this:

This doesn't work. It fails in "unpacking sources" phase, since no directory is actually created.

You need to do

sourceRoot= ".";

Whatever got unpacked should be in the $CWD for you to copy into $out

I don't follow. Please explain?

I mean cp ucm $out/bin

Gotcha. This (and adding an unpackPhase to the list) together worked.

This is a binary package so it needs to be patched.
You should be able to do this by adding autoPatchelfHook to nativeBuildInputs.

I don't really understand what this is. What needs to be patched? Can you explain @worldofpeace ? Thanks!

https://nixos.wiki/wiki/Packaging/Binaries explains this very well.
Simply put the binary ucm won't work on NixOS without hardcoding libraries to runtime search path of the executable etc. You probably didn't notice this because this binary would work on MacOS by default.

Oh interesting. Yeah, i hadn't noticed this. Fixed!

By doing

You should be able to do this by adding autoPatchelfHook to nativeBuildInputs.

it should take care of this for you completely, no need to patch it manually.

Not sure what you'd prefer to see here. This software is called ucm, and it is (description) the Unison Codebase Manager. What do you recommend i put here?

I got this from their github
"Modern, statically-typed purely functional language"

Updated!

@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch from 87bff2e to 2286f97 Compare August 8, 2019 02:54
@virusdave
Copy link
Contributor Author

OK, i think i've made all the requested changes. It still works on my mac system, at least. :)

@worldofpeace
Copy link
Contributor

I'm sure i messed it up somehow, but not sure how. Sorry :(

I actually think GitHub had something to do with this.

@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch 2 times, most recently from ced8906 to 69985ce Compare August 8, 2019 10:09
@virusdave
Copy link
Contributor Author

@worldofpeace
Is there any other changes you think i should make?

Thanks again for taking the time to review this!

@worldofpeace
Copy link
Contributor

worldofpeace commented Aug 9, 2019

Can you change the description to just?
"Modern, statically-typed purely functional language"

It appears you've intersected two of them, and it seems like a lot of adjectives.

And I don't think we should use whitespace between the meta attributes.

Lastly, it fails to build on NixOS because of missing dependencies

libz.so.1 -> not found!
libtinfo.so.5 -> not found!
libgmp.so.10 -> not found!

so you need

  • zlib
  • ncurses
  • gpm

@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch 2 times, most recently from 74fe288 to 034afbc Compare August 11, 2019 12:33
@virusdave
Copy link
Contributor Author

Can you change the description to just?
"Modern, statically-typed purely functional language"

It appears you've intersected two of them, and it seems like a lot of adjectives.

Done!

And I don't think we should use whitespace between the meta attributes.

Done!

Lastly, it fails to build on NixOS because of missing dependencies

libz.so.1 -> not found!
libtinfo.so.5 -> not found!
libgmp.so.10 -> not found!

so you need

  • zlib
  • ncurses
  • gpm

Hmm, i guess this makes sense for nixos. Shared libraries need to be declared, right?
I've added the runtime dependencies.

Done!

@worldofpeace
Copy link
Contributor

worldofpeace commented Aug 11, 2019

Hmm, i guess this makes sense for nixos. Shared libraries need to be declared, right?
I've added the runtime dependencies.

That output is from autoPatchelfHook and since you've built it on MacOS without sandboxing it probably found those shared libraries from the system.

@virusdave virusdave force-pushed the dnicponski/scratch/unison_language branch 2 times, most recently from 1ebee81 to 4481f3e Compare August 11, 2019 17:34
@worldofpeace
Copy link
Contributor

worldofpeace commented Aug 11, 2019

@GrahamcOfBorg build unison-ucm

@worldofpeace
Copy link
Contributor

It looks like I've forgotten that obviously you don't need to patch binaries like this for darwin, and I miss suggested gpm when I meant gmp which is what haskell use's for multiple precision arithmetic.

@worldofpeace worldofpeace force-pushed the dnicponski/scratch/unison_language branch from af0bbcb to 4673896 Compare August 11, 2019 18:15
@worldofpeace worldofpeace merged commit 51816f0 into NixOS:master Aug 11, 2019
@worldofpeace
Copy link
Contributor

Thanks for contributing @virusdave
The above issue I fixed in the force push.

@virusdave virusdave deleted the dnicponski/scratch/unison_language branch August 12, 2019 01:38
@virusdave
Copy link
Contributor Author

Thanks for the review @worldofpeace and your patience with me. This is my first "full package derivation" experience, and although it was simple (binary distro even), it was useful learning experience and i appreciate the help :)

@worldofpeace
Copy link
Contributor

Thanks for the review @worldofpeace and your patience with me. This is my first "full package derivation" experience, and although it was simple (binary distro even), it was useful learning experience and i appreciate the help :)

I'm happy to hear this 🌸 .
I like to think the nix manual's are helpful but there's nothing like the people behind them that write them. Always be prepared to learn something new from the people that are here ✨

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

2 participants