-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
scala-runners: init at 0c0b369 #84068
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.
Tested on NixOS, compiling and running a Scala program on different versions indeed works.
@@ -3033,6 +3033,12 @@ | |||
githubId = 1436960; | |||
name = "Christoph Hrdinka"; | |||
}; | |||
hrhino = { |
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 think the convention is to put this into a separate commit titled maintainers: add hrhino
(added #96666)
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; thanks.
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 pushed a newer version because, why not.
6022af9
to
975ba3f
Compare
@@ -0,0 +1,36 @@ | |||
{ stdenv, fetchFromGitHub, jre, coursier }: | |||
|
|||
let |
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.
let | |
let |
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.
yikes. thanks.
let | ||
name = "scala-runners"; | ||
owner = "dwijnand"; | ||
in stdenv.mkDerivation { | ||
inherit 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.
let | |
name = "scala-runners"; | |
owner = "dwijnand"; | |
in stdenv.mkDerivation { | |
inherit name; | |
stdenv.mkDerivation rec { | |
name = "scala-runners"; |
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, instead of having just a name
, packages should nowadays have a pname
and a version
(#103997)
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.
@raboof should I use (part of) the git tag? I can bother Dale if he wants to push tags but I think he may not care.
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.
there's no clear consensus on how to version packages where upstream doesn't use tags (#100833), using the (short) git tag seems ok to me in this case.
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.
@hrhino the convention I follow and I think is the best way to deal is
pname = "<name of software>";
version = "unstable-${date of the commit in the format YYYY-MM-DD}";
in stdenv.mkDerivation { | ||
inherit name; | ||
|
||
meta = with stdenv.lib; { |
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.
Please put meta at the end.
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; thanks.
inherit name; | ||
|
||
meta = with stdenv.lib; { | ||
homepage = "https://github.com/${owner}/${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.
homepage = "https://github.com/${owner}/${name}"; | |
homepage = "https://github.com/dwijnand/scala-runners"; |
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; thanks.
description = "An alternative implementation of the Scala distribution's runners"; | ||
license = licenses.asl20; | ||
platforms = platforms.all; | ||
maintainers = [ maintainers.hrhino ]; |
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.
maintainers = [ maintainers.hrhino ]; | |
maintainers = with maintainers; [ hrhino ]; |
}; | ||
|
||
src = fetchFromGitHub { | ||
inherit owner; |
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.
inherit owner; | |
owner = "dwijnand"; |
installPhase = '' | ||
set -x | ||
mkdir -p $out/bin $out/lib | ||
sed -ie "s_\Wcs\W_ ${coursier}/bin/coursier _" scala-runner | ||
cp scala-runner $out/lib | ||
ln -s $out/lib/scala-runner $out/bin/scala | ||
ln -s $out/lib/scala-runner $out/bin/scalac | ||
ln -s $out/lib/scala-runner $out/bin/scalap | ||
ln -s $out/lib/scala-runner $out/bin/scaladoc | ||
''; | ||
|
||
|
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.
installPhase = '' | |
set -x | |
mkdir -p $out/bin $out/lib | |
sed -ie "s_\Wcs\W_ ${coursier}/bin/coursier _" scala-runner | |
cp scala-runner $out/lib | |
ln -s $out/lib/scala-runner $out/bin/scala | |
ln -s $out/lib/scala-runner $out/bin/scalac | |
ln -s $out/lib/scala-runner $out/bin/scalap | |
ln -s $out/lib/scala-runner $out/bin/scaladoc | |
''; | |
installPhase = '' | |
mkdir -p $out/bin $out/lib | |
sed -ie "s_\Wcs\W_ ${coursier}/bin/coursier _" scala-runner | |
cp scala-runner $out/lib | |
ln -s $out/lib/scala-runner $out/bin/scala | |
ln -s $out/lib/scala-runner $out/bin/scalac | |
ln -s $out/lib/scala-runner $out/bin/scalap | |
ln -s $out/lib/scala-runner $out/bin/scaladoc | |
''; |
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.
what changed here? just removing the set -x
? I guess that's a good idea.
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.
yeah. not sure why I selected more lines.
This is a script to run multiple versions of scala either by version number or build hash.
let | ||
in stdenv.mkDerivation rec { |
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.
let | |
in stdenv.mkDerivation rec { | |
stdenv.mkDerivation rec { |
|
||
let | ||
in stdenv.mkDerivation rec { | ||
name = "scala-runners"; |
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.
name = "scala-runners"; | |
pname = "scala-runners"; | |
version = "unstable-2020-02-02" |
@@ -10851,6 +10851,10 @@ in | |||
scala_2_13 = callPackage ../development/compilers/scala/2.x.nix { majorVersion = "2.13"; jre = jdk8; }; | |||
|
|||
scala = scala_2_13; | |||
scala-runners = callPackage ../development/compilers/scala-runners/default.nix { | |||
coursier = callPackage ../development/tools/coursier { jre = jdk8; }; |
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.
coursier = callPackage ../development/tools/coursier { jre = jdk8; }; | |
coursier = coursier.override { jre = jdk8; }; |
? |
#128060 to replace this because apparently force-push then reopen doesn't work. yay, github. |
This is a script to run multiple versions of scala either by version number or build hash.
Motivation for this change
It's a good script and useful for testing with pre-release and non-current versions of Scala.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after) <-- Total closure size is 390.4Mb but almost all of that is openjdk and coursier