krunen / term-termios Goto Github PK
View Code? Open in Web Editor NEWtermios routines for Rakudo Perl 6
License: Artistic License 2.0
termios routines for Rakudo Perl 6
License: Artistic License 2.0
Can you please set a specific "version" for your RAKU module in your META6.json file? You have a '*" now, which is known to make trouble and may not be supported within the RAKU tool chain (soon), say ZEF, FEZ, MI6...
And can you please "GIT TAG" your RAKU modules with it's version, similar and at the same time you maintain it's "version": "x.y.z" in your META6.json
file, then and in the future?
I was told, this will happen "for free" going forward with mi6 anyhow, but for now it would be great if you spend those 2 seconds already now :)
"Tagging" is generally highly appreciated in regards to "reproducible builds" and here especially for the "Rakudo Star" modules
THANK YOU!
==> Fetching Term::termios
Please remove leading 'v' from perl version in Term::termios's meta info.
Term::termios requires Perl version 6.0.0. Cannot continue.
That's probably because of the contents of META.info?
Originates from https://github.com/krunen/term-termios/blob/master/lib/Term/termios.pm6#L145
Use of Nil in string context
Does TERM::termios only work under Unix or also under Windows?
Came back after winter break to find that the REPL in raku was broken, complaining about a raku file missing from a temp dir.
Did a refresh install of raku latest with rakubrew, installed Terminal::LineEditor, worked.
Removed $TMPDIR/.zef, and the problem happened again. (assuming original problem was tmpdir getting cleaned after a reboot)
Did a force reinstall of Term::termios, and the problem was resolved. (This is one of the deps of Terminal::LineEditor)
This seems similar to ugexe/zef#546
Looks like this commit removed libraries/myhelper
from resources, which has broken the module.
To reproduce the issue, I install Terminal::LineEditor
which depends on Term::termios
, then run raku
, the repl doesn't load and continuously throws error
relevant part in the error is:
Use of uninitialized value element of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in sub guess_library_name at /home/hythm/.rakubrew/versions/moar-HEAD-HEAD-HEAD/install/share/perl6/core/sources/D4356A413F4B0437F7F4404FF5A225216F22EFFA (NativeCall) line 217
Cannot locate native library '/home/hythm/.raku/libresources.so': /home/hythm/.raku/libresources.so: cannot open shared object file: No such file or directory
...
...
in submethod BUILD at /home/hythm/.raku/sources/B15919F9457782C67E2B931F9411A81839F73152 (Term::termios) line 168`
Adding back libraries/myhelper
to meta file resources fixes the issue for me.
Hi
I was having issues with https://github.com/ab5tract/Terminal-Print not capturing input on macOS and after some research I've found it uses Term::termios under the hood to switch terminal into raw mode.
So I've tried to switch terminal into raw mode using following oneliner:
perl6 -e 'use Term::termios; my $termios := Term::termios.new(fd => $*IN.native-descriptor).getattr; $termios.makeraw; $termios.setattr(:DRAIN); $*IN.getc; die;'
And it dies instantly without waiting for any input. Am I right by saying that in raw mode reading from STDIN should be blocking action?
I'm using
This is Rakudo version 2017.09 built on MoarVM version 2017.09.1
implementing Perl 6.c.
on macOS 10.10.5.
✗ raku --version
Welcome to Rakudo™ v2023.06-241-gcb8d2a125.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2023.06-4-g75fe055c2.
...
===> Building: Term::termios:ver<0.2.6>:auth<zef:krunen>
[Term::termios] Command: /Users/coke/.rakubrew/versions/moar-cb8d2a125/install/bin/rakudo -I/var/folders/8n/rypl9_990b9578zd5435pgr40000gn/T/.zef/1692564298.8422/Distribution%3A%3ABuilder%3A%3AMakeFromJSON%3Aver%3C0.6%3E%3Aauth%3Cgithub%3Aniner%3E.tar.gz/Distribution-Builder-MakeFromJSON-master -I/var/folders/8n/rypl9_990b9578zd5435pgr40000gn/T/.zef/1692564298.8422/d254fdd0efd10a06bde98ee99b6ab1349532760a.tar.gz -MMONKEY-SEE-NO-EVAL -e exit((require ::(q|Distribution::Builder::MakeFromJSON|)).new(:meta(EVAL($*IN.slurp(:close)))).build(q|/var/folders/8n/rypl9_990b9578zd5435pgr40000gn/T/.zef/1692564298.8422/b7707185f4d678efd41f95d08a06dc13560c6f3f.tar.gz/dist|)??0!!1)
===> Building [FAIL]: Term::termios:ver<0.2.6>:auth<zef:krunen>
Aborting due to build failure: Term::termios:ver<0.2.6>:auth<zef:krunen> (use --force-build to override)
Following the example provided on the main site, I am getting the error as described in the subject.
Here is a stack trace:
Must specify something as a path: did you mean '.' for the current directory?
in sub guess_library_name at /opt/rakudo-star-2018.04/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 220
in method setup at /opt/rakudo-star-2018.04/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 275
in method CALL-ME at /opt/rakudo-star-2018.04/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 570
in method overwrite_constant at /home/pprocacci/.perl6/sources/5CB2E088A2F6E19C63814E195E60C87BDA3C9F63 (Term::termios) line 154
in submethod BUILD at /home/pprocacci/.perl6/sources/5CB2E088A2F6E19C63814E195E60C87BDA3C9F63 (Term::termios) line 171
in submethod BUILDALL at /home/pprocacci/.perl6/precomp/697B026D10D669F6D32B196457B6D9631A5E2155/5C/5CB2E088A2F6E19C63814E195E60C87BDA3C9F63 line 1
in block at ./test.pl6 line
A simple script that reproduces the problem .....
###############################################
#!/usr/bin/env perl6
use Term::termios;
my $saved_termios := Term::termios.new(fd => 1).getattr;
################################################
This is FreeBSD 11.1.
This is Rakudo Star version 2018.04.1 built on MoarVM version 2018.04.1 implementing Perl 6.c.
In addition to the above which may need it's own ticket, the installation of this module has the following "error" though it seems to still install successfully:
% zef install Term::termios
===> Searching for: Term::termios
===> Building: Term::termios:authgithub:krunen
===> Building [OK] for Term::termios:authgithub:krunen
===> Testing: Term::termios:authgithub:krunen
===> Testing [OK] for Term::termios:authgithub:krunen
===> Installing: Term::termios:authgithub:krunen
Use of Nil in string context
in block at home#sources/5CB2E088A2F6E19C63814E195E60C87BDA3C9F63 (Term::termios) line 145
Please help me understand and solve these errors.
Hello,
good to see you back. This dist continues to back up many of the most essential TUI distributions in the Raku world.
In the meantime, the old p6c ecosystem has been declining due to its obvious limitations - lack of versioning and author integrity. Please consider to release this module to the "zef ecosystem", using the fez tool.
Thanks in advance.
Hi,
since there is no answer to this question: http://stackoverflow.com/questions/31958891/perl6-getc-in-raw-mode, maybe this is a bug.
The example code is wrong in that the getc
method will always wait for additional input in order to determine whether it is a combining character or not.
To actually do raw input, you need to set the IO::Handle
(e.g. $*IN
) to binary mode ($*IN.encoding(Nil)
;) and use $*IN.read(1)
to read a single byte; note that this will give you a Buf
instead of a Str
. (A quick hack for that is $*IN.read(1).decode("latin-1")
, especially since Buf
is currently not as easy to work with as Str
.)
The raw input mechanism may require a somewhat recent moarvm
and matching rakudo
to work properly.
When trying to install Term::termios
in the rakudo-star
Docker image, I get the following error:
===> Install [FAIL] for Term::termios:auth<github:krunen>: Failed to open file /root/.zef/store/term-termios.git/f4c84e1d95cb11be7655c489d2e470011ff269c8/resources/libraries/libmyhelper.so: No such file or directory
Failed to open file /root/.zef/store/term-termios.git/f4c84e1d95cb11be7655c489d2e470011ff269c8/resources/libraries/libmyhelper.so: No such file or directory
in any at /usr/share/perl6/site/precomp/F91BAB44DF15C5C298C627DD5E0F9D819ED79939.1521092667.22273/90/9062A39D0256C0BD797016C3FE93D839191AFE2B line 1
in block at /usr/share/perl6/site/sources/9062A39D0256C0BD797016C3FE93D839191AFE2B (Zef::Client) line 591
in any at /usr/share/perl6/site/precomp/F91BAB44DF15C5C298C627DD5E0F9D819ED79939.1521092667.22273/90/9062A39D0256C0BD797016C3FE93D839191AFE2B line 1
in block at /usr/share/perl6/site/sources/9062A39D0256C0BD797016C3FE93D839191AFE2B (Zef::Client) line 599
in block at /usr/share/perl6/site/sources/9062A39D0256C0BD797016C3FE93D839191AFE2B (Zef::Client) line 562
in sub at /usr/share/perl6/site/sources/9062A39D0256C0BD797016C3FE93D839191AFE2B (Zef::Client) line 551
in method install at /usr/share/perl6/site/sources/9062A39D0256C0BD797016C3FE93D839191AFE2B (Zef::Client) line 643
in sub MAIN at /usr/share/perl6/site/sources/9E04C517E18C976DC9F459E2CE31A87142034020 (Zef::CLI) line 152
in block <unit> at /usr/share/perl6/site/resources/25ADD3DE4D08C272AC81C82BCB2DBE07D909E768 line 3
in sub MAIN at /usr/share/perl6/site/bin/zef line 2
in block <unit> at /usr/share/perl6/site/bin/zef line 2
The testing phase returns OK.
UPDATE: If I install build-essential
first (which contains a C compiler and make
), the module installs correctly. So it seems to be mostly a LTA error message.
As you closed #15 , this is a way of re-opening it again.
Can you please set a specific "version" for your RAKU module in your META6.json file? You have a '*" now, which is known to make trouble and may not be supported within the RAKU tool chain (soon), say ZEF, FEZ, MI6...
And can you please "GIT TAG" your RAKU modules with it's version, similar and at the same time you maintain it's "version": "x.y.z" in your META6.json file, then and in the future?
I was told, this will happen "for free" going forward with mi6 anyhow, but for now it would be great if you spend those 2 seconds already now :)
"Tagging" is generally highly appreciated in regards to "reproducible builds" and here especially for the "Rakudo Star" modules
THANK YOU!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.