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

dotty: init at 0.4.0-RC1 #31478

Merged
merged 2 commits into from Nov 15, 2017
Merged

dotty: init at 0.4.0-RC1 #31478

merged 2 commits into from Nov 15, 2017

Conversation

karolchmist
Copy link
Member

@karolchmist karolchmist commented Nov 10, 2017

Motivation for this change

Dotty is a platform to try out new language concepts and compiler technologies for Scala. The focus is mainly on simplification. The theory behind these constructs is researched in DOT, a calculus for dependent object types.

http://dotty.epfl.ch/

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.

@karolchmist karolchmist changed the title doty: init at 0.0.4-RC1 dotty: init at 0.0.4-RC1 Nov 10, 2017
@karolchmist karolchmist changed the title dotty: init at 0.0.4-RC1 dotty: init at 0.4.0-RC1 Nov 10, 2017
Copy link
Member

@lukateras lukateras left a comment

Choose a reason for hiding this comment

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

Builds and seems to work, REPL loads up! However, meta.maintainers should be probably set.

In regards to bin/common, I don't have a strong stance on this one, but it might be better to wrap this derivation so that it's not leaked, as it's done in Rambox and Retroarch.

'';
homepage = http://dotty.epfl.ch/;
license = stdenv.lib.licenses.bsd3;
platforms = stdenv.lib.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.

If you are going to maintain it, add yourself to lib/maintainers.nix and to meta.maintainers of this derivation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

file=$(basename $p)

# no need to wrap common
if [[ "$file" = "common" ]] ; then
Copy link
Member

Choose a reason for hiding this comment

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

This leaks bin/common into shared bin, which might be a rather common script name!

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed by moving to a new shared folder.

mkdir -p $out
mv * $out

for p in $out/bin/* ; do
Copy link
Member

@lukateras lukateras Nov 10, 2017

Choose a reason for hiding this comment

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

Nitpick: this fits better in fixupPhase, and you could write this as find expression:

  fixupPhase = ''
    for p in $(find $out/bin -mindepth 1 -not -name common); do
      wrapProgram $p --set JAVA_HOME ${jre}
    done
  '';

Better yet, you can only patch $out/bin/common, as it's the only script that uses JAVA_HOME:

  fixupPhase = ''
    wrapProgram $out/bin/common --set JAVA_HOME ${jre}
  '';

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 reorganised a bit the phases, should be cleaner now.

I can't make it work when wrapping common only...

done
'';

meta = {
Copy link
Member

Choose a reason for hiding this comment

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

Just a note: you can skip stdenv.lib inside meta if you add with stdenv.lib; to the attribute set:

meta = with stdenv.lib; {
  license = licenses.bsd3;
  platforms = platforms.all;
};

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok

@@ -6253,6 +6253,7 @@ with pkgs;
scala_2_10 = callPackage ../development/compilers/scala/2.10.nix { };
scala_2_11 = callPackage ../development/compilers/scala/2.11.nix { };
scala_2_12 = callPackage ../development/compilers/scala { jre = jre8; };
scala_dotty = callPackage ../development/compilers/scala/dotty.nix { jre = jre8;};
Copy link
Member

Choose a reason for hiding this comment

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

It's easier to find packages if derivation name and attribute name match. Maybe just dotty?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea was to put it next to "standard" scala... But simply dotty is fine as well.

I guess that it will disappear anyway with scala 3.0 coming out one day. Isn't it a problem to create such an ephemeral package? On the other hand, anyone using it should be aware of it...

@karolchmist
Copy link
Member Author

Thanks @yegortimoshenko for the feedback, this is my first new package so any help is appreciated. I'll come back with the fixes.

version = "0.4.0-RC1";
name = "dotty-${version}";

src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

Can you use fetchFromGitHub here instead?

Copy link
Member

Choose a reason for hiding this comment

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

@disassembler This is a prebuilt release, to make this derivation build completely from source would require a lot of non-trivial work.

Copy link
Member

@disassembler disassembler left a comment

Choose a reason for hiding this comment

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

Also, please squash and review CONTRIBUTING.md for commit message style.

@disassembler
Copy link
Member

@GrahamcOfBorg build dotty

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

these derivations will be built:
  /nix/store/5anb357x98zmlhbsji32ivl49kyywyd5-dotty-0.4.0-RC1.tar.gz.drv
  /nix/store/irc646li1l7mpb5gy9xs4q1nwr96dzg9-dotty-0.4.0-RC1.drv
unable to connect to ‘mac1’
unable to open SSH connection to ‘mac1’, trying other available machines...
building path(s) ‘/nix/store/4gqrvc8920jsd8f9l7lzprqaigxvh4v1-dotty-0.4.0-RC1.tar.gz’
error: a ‘x86_64-darwin’ is required to build ‘/nix/store/5anb357x98zmlhbsji32ivl49kyywyd5-dotty-0.4.0-RC1.tar.gz.drv’, but I am a ‘x86_64-linux’

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-linux

setting SOURCE_DATE_EPOCH to timestamp 1508169341 of file dotty-0.4.0-RC1/lib/dotty-library_0.4-0.4.0-RC1.jar
patching sources
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/4ada72n7785wwazv42fhsnxjvilaa3aj-bash-4.4-p12/bin/bash
Run make install
installing
post-installation fixup
/nix/store/vxzl4i68vgrfmdhrfcj61cs8b4iazfiq-dotty-0.4.0-RC1

@lukateras
Copy link
Member

lukateras commented Nov 15, 2017

@disassembler Maybe this could be just squash and merged when ready? It will automatically pick up the pull request name as commit message, and the pull request name follows CONTRIBUTING.md. It's also possible to change the commit message, if necessary.

squash-and-merge

@disassembler disassembler merged commit 07bd44b into NixOS:master Nov 15, 2017
@disassembler
Copy link
Member

based on @yegortimoshenko comments on this being a binary release and not source code, I merged and squashed. Thanks for the contribution!

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

5 participants