Re: [Chicken-users] Is Android not unix?

2018-11-25 Thread Matt Welland
On Mon, 2018-11-26 at 07:26 +0300, Kristian Lein-Mathisen wrote:
> 
> I don't know how UserLand works, but there's no containerization in
> Termux. It's just an terminal emulator with its own package manager
> with quite a few packeges like emacs, gnu make and clang. So building
> CHICKEN is pretty straight forward.
According to their wiki Termux does not do chroot to present a standard
fs to the user. There is a script to do it called termux-chroot.
Userland must do the chroot as it does present a standard fs to the
user. 
https://wiki.termux.com/wiki/Differences_from_Linux
> > K.

> On Mon, Nov 26, 2018, 06:46 elf  > I had no 
> problem compiling chicken in termux (though occasionally there are linkage 
> warnings on android6).
> > 

> > 
> > My understanding is that android is basically stripped down linux with a 
> > java overlord layer. No compatibility layer necessary. This is borne out by 
> > my current work on cross-system randomness - it behaves exactly like a 
> > linux machine, with the same syscalls, etc.
> > 

> > 
> > (Which reminds me. If anyone has a bsd box i can get a login for, it would 
> > be much appreciated. Im trying to do a chicken wrapper for true randomness 
> > using sidechannel effects... so something that looks platform independent.)
> > 

> > 
> > -elf
> > 

> > 
> > On 26 November 2018 5:15:03 GMT+02:00, Matt Welland  wrote:
> > 
> > >Isn't Termux similar to UserLand - a compatibility layer of sorts
> > 
> > >similar to LXC or LXD? If so, I would not be surprised to see
> > 
> > >incompatibilities. I had to do several hacks to get IUP working on
> > 
> > >UserLand.
> > 
> > >
> > 
> > >On Mon, 2018-11-19 at 13:10 +0100, Thomas Chust wrote:
> > 
> > >> On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen 
> > 
> > >> i...@gmail.com> wrote:
> > 
> > >> 
> > 
> > >> > 
> > 
> > >> > [...]
> > 
> > >> > I was trying tweetnacl on Termux on Android 9 and ran into this
> > 
> > >> > problem:
> > 
> > >> > 
> > 
> > >> > u0_a191@localhost ~/p/chicken-5.0.0>
> > 
> > >> > csi -R tweetnacl -p '(make-symmetric-sign-key)'
> > 
> > >> > 
> > 
> > >> > Error: (read-u8vector) bad argument type - not a port: #f
> > 
> > >> > 
> > 
> > >> > 
> > 
> > >> > This happens because tweetnacl creates its current-entropy-port
> > 
> > >> > using
> > 
> > >> > cond-expand with unix, windows or else, the latter which is
> > 
> > >> > yielding the #f
> > 
> > >> > error above.
> > 
> > >> > [...]
> > 
> > >> Hello,
> > 
> > >> 
> > 
> > >> interesting, I would have thought that Android would qualify as a
> > 
> > >> unixoid system since it has a Linux kernel! If there is some other
> > 
> > >> feature identifier I should use that would indicate the system likely
> > 
> > >> supports /dev/random, please let me know so I can adapt the tweetnacl
> > 
> > >> code.
> > 
> > >> 
> > 
> > >> Anyway, as a workaround to get tweetnacl running, you can simply do
> > 
> > >> 
> > 
> > >>   (current-entropy-port (open-input-file "/dev/random"))
> > 
> > >> 
> > 
> > >> by hand.
> > 
> > >> 
> > 
> > >> I hope that helps :-)
> > 
> > >> 
> > 
> > >> Ciao,
> > 
> > >> Thomas
> > 
> > >> 
> > 
> > >> 
> > 
> > >> ___
> > 
> > >> Chicken-users mailing list
> > 
> > >> Chicken-users@nongnu.org
> > 
> > >> https://lists.nongnu.org/mailman/listinfo/chicken-users
> > 
> > >
> > 
> > >___
> > 
> > >Chicken-users mailing list
> > 
> > >Chicken-users@nongnu.org
> > 
> > >https://lists.nongnu.org/mailman/listinfo/chicken-users
> > 

> > 
> > ___
> > 
> > Chicken-users mailing list
> > 
Chicken-users@nongnu.org
> > 
https://lists.nongnu.org/mailman/listinfo/chicken-users
> > 


> ___
> Chicken-users mailing list
> 
Chicken-users@nongnu.org> 
https://lists.nongnu.org/mailman/listinfo/chicken-users> 
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Is Android not unix?

2018-11-25 Thread Kristian Lein-Mathisen
I don't know how UserLand works, but there's no containerization in Termux.
It's just an terminal emulator with its own package manager with quite a
few packeges like emacs, gnu make and clang. So building CHICKEN is pretty
straight forward.

K.

On Mon, Nov 26, 2018, 06:46 elf  I had no problem compiling chicken in termux (though occasionally there
> are linkage warnings on android6).
>
> My understanding is that android is basically stripped down linux with a
> java overlord layer. No compatibility layer necessary. This is borne out by
> my current work on cross-system randomness - it behaves exactly like a
> linux machine, with the same syscalls, etc.
>
> (Which reminds me. If anyone has a bsd box i can get a login for, it would
> be much appreciated. Im trying to do a chicken wrapper for true randomness
> using sidechannel effects... so something that looks platform independent.)
>
> -elf
>
> On 26 November 2018 5:15:03 GMT+02:00, Matt Welland 
> wrote:
> >Isn't Termux similar to UserLand - a compatibility layer of sorts
> >similar to LXC or LXD? If so, I would not be surprised to see
> >incompatibilities. I had to do several hacks to get IUP working on
> >UserLand.
> >
> >On Mon, 2018-11-19 at 13:10 +0100, Thomas Chust wrote:
> >> On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen  >> i...@gmail.com> wrote:
> >>
> >> >
> >> > [...]
> >> > I was trying tweetnacl on Termux on Android 9 and ran into this
> >> > problem:
> >> >
> >> > u0_a191@localhost ~/p/chicken-5.0.0>
> >> > csi -R tweetnacl -p '(make-symmetric-sign-key)'
> >> >
> >> > Error: (read-u8vector) bad argument type - not a port: #f
> >> > 
> >> >
> >> > This happens because tweetnacl creates its current-entropy-port
> >> > using
> >> > cond-expand with unix, windows or else, the latter which is
> >> > yielding the #f
> >> > error above.
> >> > [...]
> >> Hello,
> >>
> >> interesting, I would have thought that Android would qualify as a
> >> unixoid system since it has a Linux kernel! If there is some other
> >> feature identifier I should use that would indicate the system likely
> >> supports /dev/random, please let me know so I can adapt the tweetnacl
> >> code.
> >>
> >> Anyway, as a workaround to get tweetnacl running, you can simply do
> >>
> >>   (current-entropy-port (open-input-file "/dev/random"))
> >>
> >> by hand.
> >>
> >> I hope that helps :-)
> >>
> >> Ciao,
> >> Thomas
> >>
> >>
> >> ___
> >> Chicken-users mailing list
> >> Chicken-users@nongnu.org
> >> https://lists.nongnu.org/mailman/listinfo/chicken-users
> >
> >___
> >Chicken-users mailing list
> >Chicken-users@nongnu.org
> >https://lists.nongnu.org/mailman/listinfo/chicken-users
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Is Android not unix?

2018-11-25 Thread elf
I had no problem compiling chicken in termux (though occasionally there are 
linkage warnings on android6).

My understanding is that android is basically stripped down linux with a java 
overlord layer. No compatibility layer necessary. This is borne out by my 
current work on cross-system randomness - it behaves exactly like a linux 
machine, with the same syscalls, etc.

(Which reminds me. If anyone has a bsd box i can get a login for, it would be 
much appreciated. Im trying to do a chicken wrapper for true randomness using 
sidechannel effects... so something that looks platform independent.)

-elf

On 26 November 2018 5:15:03 GMT+02:00, Matt Welland  wrote:
>Isn't Termux similar to UserLand - a compatibility layer of sorts
>similar to LXC or LXD? If so, I would not be surprised to see
>incompatibilities. I had to do several hacks to get IUP working on
>UserLand.
>
>On Mon, 2018-11-19 at 13:10 +0100, Thomas Chust wrote:
>> On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen > i...@gmail.com> wrote:
>> 
>> > 
>> > [...]
>> > I was trying tweetnacl on Termux on Android 9 and ran into this
>> > problem:
>> > 
>> > u0_a191@localhost ~/p/chicken-5.0.0>
>> > csi -R tweetnacl -p '(make-symmetric-sign-key)'
>> > 
>> > Error: (read-u8vector) bad argument type - not a port: #f
>> > 
>> > 
>> > This happens because tweetnacl creates its current-entropy-port
>> > using
>> > cond-expand with unix, windows or else, the latter which is
>> > yielding the #f
>> > error above.
>> > [...]
>> Hello,
>> 
>> interesting, I would have thought that Android would qualify as a
>> unixoid system since it has a Linux kernel! If there is some other
>> feature identifier I should use that would indicate the system likely
>> supports /dev/random, please let me know so I can adapt the tweetnacl
>> code.
>> 
>> Anyway, as a workaround to get tweetnacl running, you can simply do
>> 
>>   (current-entropy-port (open-input-file "/dev/random"))
>> 
>> by hand.
>> 
>> I hope that helps :-)
>> 
>> Ciao,
>> Thomas
>> 
>> 
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
>___
>Chicken-users mailing list
>Chicken-users@nongnu.org
>https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Is Android not unix?

2018-11-25 Thread Matt Welland
Isn't Termux similar to UserLand - a compatibility layer of sorts
similar to LXC or LXD? If so, I would not be surprised to see
incompatibilities. I had to do several hacks to get IUP working on
UserLand.

On Mon, 2018-11-19 at 13:10 +0100, Thomas Chust wrote:
> On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen  i...@gmail.com> wrote:
> 
> > 
> > [...]
> > I was trying tweetnacl on Termux on Android 9 and ran into this
> > problem:
> > 
> > u0_a191@localhost ~/p/chicken-5.0.0>
> > csi -R tweetnacl -p '(make-symmetric-sign-key)'
> > 
> > Error: (read-u8vector) bad argument type - not a port: #f
> > 
> > 
> > This happens because tweetnacl creates its current-entropy-port
> > using
> > cond-expand with unix, windows or else, the latter which is
> > yielding the #f
> > error above.
> > [...]
> Hello,
> 
> interesting, I would have thought that Android would qualify as a
> unixoid system since it has a Linux kernel! If there is some other
> feature identifier I should use that would indicate the system likely
> supports /dev/random, please let me know so I can adapt the tweetnacl
> code.
> 
> Anyway, as a workaround to get tweetnacl running, you can simply do
> 
>   (current-entropy-port (open-input-file "/dev/random"))
> 
> by hand.
> 
> I hope that helps :-)
> 
> Ciao,
> Thomas
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Is Android not unix?

2018-11-25 Thread Kristian Lein-Mathisen
Thanks for following up on this, Thomas! tweetnacl 1.4.1 now works ootb on
Termux.

K.


On Sun, Nov 25, 2018, 14:51 Thomas Chust  On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen <
> kristianl...@gmail.com> wrote:
>
> > [...]
> > I was trying tweetnacl on Termux on Android 9 and ran into this problem:
> > [...]
>
> Hello,
>
> a new version of tweetnacl (v1.4.1) should soon be available. Since I
> replaced the system-specific code dealing with entropy sources using
> the new portable random-bytes function from (chicken random),
> cond-expand is no longer necessary and these Android troubles should
> hopefully vanish into thin air :-)
>
> Ciao,
> Thomas
>
>
> --
> Life is not a battle to win but a melody to sing.
> -- Amit Ray
>
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Is Android not unix?

2018-11-25 Thread Thomas Chust
On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen 
 wrote:

> [...]
> I was trying tweetnacl on Termux on Android 9 and ran into this problem:
> [...]

Hello,

a new version of tweetnacl (v1.4.1) should soon be available. Since I
replaced the system-specific code dealing with entropy sources using
the new portable random-bytes function from (chicken random),
cond-expand is no longer necessary and these Android troubles should
hopefully vanish into thin air :-)

Ciao,
Thomas


-- 
Life is not a battle to win but a melody to sing.
-- Amit Ray


pgpY8CmkDtZMK.pgp
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Is Android not unix?

2018-11-19 Thread Thomas Chust
On Mon, 19 Nov 2018 13:19:10 +0300 Kristian Lein-Mathisen 
 wrote:

> [...]
> I was trying tweetnacl on Termux on Android 9 and ran into this problem:
> 
> u0_a191@localhost ~/p/chicken-5.0.0>
> csi -R tweetnacl -p '(make-symmetric-sign-key)'
> 
> Error: (read-u8vector) bad argument type - not a port: #f
> 
> 
> This happens because tweetnacl creates its current-entropy-port using
> cond-expand with unix, windows or else, the latter which is yielding the #f
> error above.
> [...]

Hello,

interesting, I would have thought that Android would qualify as a
unixoid system since it has a Linux kernel! If there is some other
feature identifier I should use that would indicate the system likely
supports /dev/random, please let me know so I can adapt the tweetnacl
code.

Anyway, as a workaround to get tweetnacl running, you can simply do

  (current-entropy-port (open-input-file "/dev/random"))

by hand.

I hope that helps :-)

Ciao,
Thomas


-- 
Time only waits for black holes.


pgpURM2wMZJF9.pgp
Description: PGP signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Is Android not unix?

2018-11-19 Thread Kristian Lein-Mathisen
Hi guys,

I was trying tweetnacl on Termux on Android 9 and ran into this problem:

u0_a191@localhost ~/p/chicken-5.0.0>
csi -R tweetnacl -p '(make-symmetric-sign-key)'

Error: (read-u8vector) bad argument type - not a port: #f


This happens because tweetnacl creates its current-entropy-port using
cond-expand with unix, windows or else, the latter which is yielding the #f
error above.

I found this surprising as I'd expect Android to be unix. As I'm sure you
know, it isn't:

csi -p '(cond-expand (unix 1))'

Error: during expansion of (cond-expand ...) - no matching clause in
`cond-expand' form: unix
u0_a191@localhost ~/p/chicken-5.0.0>
csi -p '(cond-expand ((or android unix) 1))'
1

But tweetnacl isn't much use without current-entropy-port, and I hove its
/dev/random requirement:

u0_a191@localhost ~/p/chicken-5.0.0>
dd if=/dev/random bs=1 count=12 ^/dev/null |xxd -p
44ca8634752db3243ac222f0

So, my questions:

1. Is Android non-unix intentionally?
2. Could tweetnacl cond-expand with (or unix android) so it works
out-of-the-box on Android?


Thanks in advance,
K.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users