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
dotty: init at 0.4.0-RC1 #31478
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
''; | ||
homepage = http://dotty.epfl.ch/; | ||
license = stdenv.lib.licenses.bsd3; | ||
platforms = stdenv.lib.platforms.all; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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}
'';
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
pkgs/top-level/all-packages.nix
Outdated
@@ -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;}; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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...
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
@GrahamcOfBorg build dotty |
There was a problem hiding this 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’
There was a problem hiding this 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
@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 |
based on @yegortimoshenko comments on this being a binary release and not source code, I merged and squashed. Thanks for the contribution! |
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
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)