-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
inko: init at 0.15.0 & ivm: init at 0.5.0 #325089
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6447,6 +6447,11 @@ | |
githubId = 541748; | ||
name = "Felipe Espinoza"; | ||
}; | ||
feathecutie = { | ||
name = "feathecutie"; | ||
github = "feathecutie"; | ||
githubId = 53912746; | ||
}; | ||
fedx-sudo = { | ||
email = "[email protected]"; | ||
github = "FedX-sudo"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ lib | ||
, rustPlatform | ||
, fetchFromGitHub | ||
, llvm_16 | ||
, libffi | ||
, libz | ||
, libxml2 | ||
, ncurses | ||
, stdenv | ||
, makeWrapper | ||
, callPackage | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "inko"; | ||
version = "0.15.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "inko-lang"; | ||
repo = "inko"; | ||
rev = "v${version}"; | ||
hash = "sha256-Iojv8pTyILYpLFnoTlgUGmlfWWH0DgsGBRxzd3oRNwA="; | ||
}; | ||
|
||
cargoHash = "sha256-PaZD7wwcami6EWvOHLislNkwQhCZItN9XZkPSExwo0U="; | ||
|
||
buildInputs = [ | ||
libffi | ||
libz | ||
libxml2 | ||
ncurses | ||
stdenv.cc.cc.lib | ||
]; | ||
|
||
nativeBuildInputs = [ | ||
llvm_16 | ||
makeWrapper | ||
]; | ||
|
||
env = { | ||
INKO_STD = "${placeholder "out"}/lib"; | ||
INKO_RT = "${placeholder "out"}/lib/runtime"; | ||
}; | ||
|
||
postFixup = '' | ||
wrapProgram $out/bin/inko \ | ||
--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]} | ||
''; | ||
|
||
postInstall = '' | ||
mkdir -p $out/lib/runtime | ||
mv $out/lib/*.a $out/lib/runtime/ | ||
cp -r std/src/* $out/lib/ | ||
''; | ||
|
||
passthru.tests = { | ||
simple = callPackage ./test.nix { }; | ||
}; | ||
|
||
meta = { | ||
description = "Language for building concurrent software with confidence"; | ||
homepage = "https://inko-lang.org/"; | ||
license = lib.licenses.mpl20; | ||
maintainers = [ lib.maintainers.feathecutie ]; | ||
platforms = lib.platforms.unix; | ||
mainProgram = "inko"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ inko | ||
, writeText | ||
, runCommand | ||
, ... | ||
}: | ||
|
||
let | ||
source = writeText "hello.inko" /* inko */ '' | ||
import std.process (sleep) | ||
import std.stdio (STDOUT) | ||
import std.time (Duration) | ||
|
||
class async Printer { | ||
fn async print(message: String, channel: Channel[Nil]) { | ||
let _ = STDOUT.new.print(message) | ||
|
||
channel.send(nil) | ||
} | ||
} | ||
|
||
class async Main { | ||
fn async main { | ||
let channel = Channel.new(size: 2) | ||
|
||
Printer().print('Hello', channel) | ||
Printer().print('world', channel) | ||
|
||
channel.receive | ||
channel.receive | ||
} | ||
} | ||
''; | ||
in | ||
|
||
runCommand "inko-test" { } '' | ||
${inko}/bin/inko run ${source} > $out | ||
cat $out | grep -q Hello | ||
cat $out | grep -q world | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ lib | ||
, rustPlatform | ||
, fetchFromGitHub | ||
, makeWrapper | ||
, cargo | ||
, llvm_16 | ||
, stdenv | ||
, libffi | ||
, libz | ||
, libxml2 | ||
, ncurses | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "ivm"; | ||
version = "0.5.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "inko-lang"; | ||
repo = "ivm"; | ||
rev = "v${version}"; | ||
hash = "sha256-z0oo1JUZbX3iT8N9+14NcqUzalpARImcbtUiQYS4djA="; | ||
}; | ||
|
||
cargoHash = "sha256-EP3fS4lAGOaXJXAM22ZCn4+9Ah8TM1+wvNerKCKByo0="; | ||
|
||
buildInputs = [ | ||
stdenv.cc.cc.lib | ||
]; | ||
|
||
nativeBuildInputs = [ | ||
makeWrapper | ||
]; | ||
|
||
postFixup = '' | ||
wrapProgram $out/bin/ivm \ | ||
--prefix PATH : ${lib.makeBinPath [ cargo llvm_16.dev stdenv.cc ]} \ | ||
--prefix LIBRARY_PATH : ${lib.makeLibraryPath [ | ||
libffi | ||
libz | ||
libxml2 | ||
ncurses | ||
]} | ||
''; | ||
|
||
meta = { | ||
description = "Cross-platform Inko version manager"; | ||
homepage = "https://github.com/inko-lang/ivm"; | ||
license = lib.licenses.mpl20; | ||
maintainers = [ lib.maintainers.feathecutie ]; | ||
platforms = lib.platforms.unix; | ||
mainProgram = "ivm"; | ||
}; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
? Not sure
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.
LD_LIBRARY_PATH
doesn't work here, butLIBRARY_PATH
probably isn't the best option either.Afaik,
LD_LIBRARY_PATH
specifies where to find libraries at runtime, but the libraries provided here are needed at build-time (not the build-time ofivm
itself, but the time whenivm
buildsinko
).I dislike using
LIBRARY_PATH
here because it seems to be a gcc specific variable, but I don't know how else to achieve this, and at least this wayivm
works the way it's supposed to (i.e.ivm install latest
downloads and builds the latestinko
version, compiled with all the right dependencies and libraries).