Re: FC31 can't find my module subs

2019-11-10 Thread ToddAndMargo via perl6-users

On 11/4/19 11:39 PM, ToddAndMargo via perl6-users wrote:

On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:

Hi All,

Help!

I just upgraded Fedora from 30 to 31.

I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
from https://github.com/nxadm/rakudo-pkg/releases

Now P6 can not find my subs inside my modules:

# perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
 ===SORRY!=== Error while compiling -e
 Undeclared name:
 PrintGreen used at line 1

[editorial comment] HHH! [/editorial comment]

The stock "rakudo" and "rakudo-zef" that resides in the
Fedora repo's has the same issue.

Many thanks,
-T


Follow up:

Fedora 31 became hard nosed about my mistakes.  Tom
called it.

I had thought all my modules used "unit module MyModule;", but
into everyone life a little humility must fall, not all of them were. 
They are now.


And everyone that imported things suddenly demanded I
use :some-key nicknames, which makes my code a lot
easier to maintain.

Everything is behaving now.  Thank you!

-T

Lets hope my modules still like the position of the moon
when it goes down!



opened

https://github.com/rakudo/rakudo/issues/3296



--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:

Hi All,

Help!

I just upgraded Fedora from 30 to 31.

I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
from https://github.com/nxadm/rakudo-pkg/releases

Now P6 can not find my subs inside my modules:

# perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
     ===SORRY!=== Error while compiling -e
     Undeclared name:
     PrintGreen used at line 1

[editorial comment] HHH! [/editorial comment]

The stock "rakudo" and "rakudo-zef" that resides in the
Fedora repo's has the same issue.

Many thanks,
-T


Follow up:

Fedora 31 became hard nosed about my mistakes.  Tom
called it.

I had thought all my modules used "unit module MyModule;", but
into everyone life a little humility must fall, not all of them were. 
They are now.


And everyone that imported things suddenly demanded I
use :some-key nicknames, which makes my code a lot
easier to maintain.

Everything is behaving now.  Thank you!

-T

Lets hope my modules still like the position of the moon
when it goes down!

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 2:28 AM, Tom Browder wrote:
One thing I noticed, you are missing a line at the top of your modules 
that should read something like "unit module MyModule;", and the 
export(:some-key) is okay.


Hi Tom,

I had thought all my moduels used "unit module MyModule;", but
into everyone life a little humility must fall, not all of them were. 
They are now.


And everyone that imported things suddenly demanded I
use :some-key nicknames.

Everything is behaving now.  Thank you!

-T


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 6:45 AM, Tom Browder wrote:

If you have much more trouble, I would file a bug with the FC folks.


That is in the works.  I am wait from some good ammunition
from the git folks.


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 6:45 AM, Tom Browder wrote:

In the future, with paying customers, I would some careful testing
before upgrading the OS. It has sure bitten me in the past!


Hi Tom,

I never do.

This computer is a mock up of their configuration.  It does
to get released to then until it works here.

I have two customer's server waiting for this one to
pass muster.  And I will run it for at leat a month
before pulling the trigger on them

So far, I have figured out the changes in dhcpd, the
new ports used by bind (SPT and DPT are no longer
identical), unbuggered bind-chroot, SELinux
and named conflict, qemu and version rising,
and "dnf system-upgrade" issues.

Perl 6 is the last item on the list.  I hope.

Life in the fast lane!

Thank you for all your help!
-T


Re: FC31 can't find my module subs

2019-11-04 Thread Tom Browder
On Mon, Nov 4, 2019 at 7:40 AM ToddAndMargo via perl6-users
 wrote:
...

> I really think this is a Fedora 31 issue and not a Perl issue.
> And really want to keep my rpm database intact.

Ok, then please deal with @nxdm on the issue you filed. Using the git
interface is best I believe.

If you have much more trouble, I would file a bug with the FC folks.

In the future, with paying customers, I would some careful testing
before upgrading the OS. It has sure bitten me in the past!

Good luck!

-Tom


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 5:19 AM, Tom Browder wrote:

On Mon, Nov 4, 2019 at 6:59 AM Tom Browder  wrote:

I'm using almost latest master:

$ ./perl6-m -v
This is Rakudo version 2019.07-447-gc745d6b10 built on MoarVM version
2019.07.1-309-g48491b896
implementing Perl 6.d.

And I can run our test sandbox with no problems--weird!

Back to my system-wide Perl 6 which is:
This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.

Can you please try installing that version (2019.03.1) by package and
run our sandbox tests again?

If that still doesn't work, how would you feel about trying to install
Perl 6 (Raku) from source? 


I really think this is a Fedora 31 issue and not a Perl issue.
And really want to keep my rpm database intact.

Keep in mind that this issue did not occur in Fedora 330
running rakudo-pkg-Fedora30-2019.07.1-03.x86_64.rpm

I wish

https://github.com/nxadm/rakudo-pkg/releases/tag/v2019.07.1-03

was not allergic to posting his SRPM's.

https://github.com/nxadm/rakudo-pkg/issues/58



It would (1) be a good experience and (2)
help troubleshoot your problem.

-Tom



[root@rn6 6]# dnf remove rakudo-pkg

[root@rn6 6]# dnf install rakudo-pkg-Fedora29-2019.03.1-01.x86_64.rpm

[root@rn6 6]# perl6 -v
This is Rakudo version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.

[root@rn6 mytest]# cat test.pl6
#!/usr/bin/env perl6
use lib ;
use A :A; A

[root@rn6 mytest]# test.pl6
WARNINGS for /home/linuxutil/mytest/./test.pl6:
Useless use of constant value A in sink context (line 3)

I am restoring the current version


Re: FC31 can't find my module subs

2019-11-04 Thread Tom Browder
On Mon, Nov 4, 2019 at 6:59 AM Tom Browder  wrote:

I'm using almost latest master:

$ ./perl6-m -v
This is Rakudo version 2019.07-447-gc745d6b10 built on MoarVM version
2019.07.1-309-g48491b896
implementing Perl 6.d.

And I can run our test sandbox with no problems--weird!

Back to my system-wide Perl 6 which is:
This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03
implementing Perl 6.d.

Can you please try installing that version (2019.03.1) by package and
run our sandbox tests again?

If that still doesn't work, how would you feel about trying to install
Perl 6 (Raku) from source? It would (1) be a good experience and (2)
help troubleshoot your problem.

-Tom


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 4:59 AM, Tom Browder wrote:
On Mon, Nov 4, 2019 at 06:52 ToddAndMargo via perl6-users 
mailto:perl6-users@perl.org>> wrote:

...

Okay, that's sounding more like an FC/package interface issue. I'm going 
to check my latest build of Rakudo against our little test sandbox and 
see what happens.


In the meantime, why don't you try putting my original test command 
inside a file and run it as a script and see how that works.


-Tom


[root@rn6 mytest]# cat test.pl6
#!/usr/bin/env perl6
use lib ;
use A :A; A

[root@rn6 mytest]# test.pl6
WARNINGS for /home/linuxutil/mytest/./test.pl6:
Useless use of constant value A in sink context (line 3)


And too much information:

[root@rn6 mytest]# cat test.pl6
#!/opt/rakudo-pkg/bin/perl6
use lib ;
use A :A; A

[root@rn6 mytest]# test.pl6
WARNINGS for /home/linuxutil/mytest/./test.pl6:
Useless use of constant value A in sink context (line 3)


Re: FC31 can't find my module subs

2019-11-04 Thread Tom Browder
On Mon, Nov 4, 2019 at 06:52 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
...

Okay, that's sounding more like an FC/package interface issue. I'm going to
check my latest build of Rakudo against our little test sandbox and see
what happens.

In the meantime, why don't you try putting my original test command inside
a file and run it as a script and see how that works.

-Tom


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 04/11/2019 03:56, ToddAndMargo via perl6-users wrote:

On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:

Hi All,

Help!

I just upgraded Fedora from 30 to 31.

I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
from https://github.com/nxadm/rakudo-pkg/releases

Now P6 can not find my subs inside my modules:

# perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
  ===SORRY!=== Error while compiling -e
  Undeclared name:
  PrintGreen used at line 1

[editorial comment] HHH! [/editorial comment]

The stock "rakudo" and "rakudo-zef" that resides in the
Fedora repo's has the same issue.

Many thanks,
-T



I am hamstrung on so may fronts if I don't get this working!

I gets uglier:

# cat p6lib/ModuleTest.pm6
sub ModuleTest() is export( :ModuleTest ) { say "Hi"; }
sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }


# perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst;
ModuleTest; ModuleTst;'

===SORRY!=== Error while compiling -e
Undeclared name:
     ModuleTst used at line 1


And way uglier.  I removed the ":"
# cat p6lib/ModuleTest.pm6

# sub ModuleTest() is export( :ModuleTest ) { say  "Hi"; }
# sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
sub ModuleTest() is export( ModuleTest ) { say  "Hi"; }
sub ModuleTst()  is export( ModuleTst )  { say "Bye"; }


# perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest;
ModuleTst;'
===SORRY!=== Error while compiling
/home/linuxutil/p6lib/ModuleTest.pm6 (ModuleTest)
Undeclared name:
     ModuleTest used at line 4

And, And, depending on the position of the moon overhead,
sometimes it works.    AAAHHH!


On 11/4/19 4:48 AM, Timo Paulssen wrote:
> Todd,
>
> can you please double-check if putting a comma in between the
> :import-tags in the "use" statement makes a difference? Like this:
>
> # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest, :ModuleTst;
> ModuleTest; ModuleTst; # correct'
> # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst; ModuleTest;
> ModuleTst;  # missing the comma'
>
> it should look like in the first line, the comma right between
> :ModuleTest and :ModuleTst
>
> Thanks
>- Timo
>


$ perl6 -I./p6lib -e 'use ModuleTest :ModuleTest, :ModuleTst; 
ModuleTest; ModuleTst; # correct'

===SORRY!=== Error while compiling -e
Undeclared name:
ModuleTest used at line 4

[tony@rn6 linuxutil]$ perl6 -I./p6lib -e 'use ModuleTest :ModuleTest 
:ModuleTst; ModuleTest; ModuleTst;  # missing the comma'

===SORRY!=== Error while compiling -e
Undeclared name:
ModuleTest used at line 4


Re: FC31 can't find my module subs

2019-11-04 Thread Timo Paulssen
Todd,

can you please double-check if putting a comma in between the
:import-tags in the "use" statement makes a difference? Like this:

# perl6 -I./p6lib -e 'use ModuleTest :ModuleTest, :ModuleTst;
ModuleTest; ModuleTst; # correct'
# perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst; ModuleTest;
ModuleTst;  # missing the comma'

it should look like in the first line, the comma right between
:ModuleTest and :ModuleTst

Thanks
  - Timo

On 04/11/2019 03:56, ToddAndMargo via perl6-users wrote:
> On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:
>> Hi All,
>>
>> Help!
>>
>> I just upgraded Fedora from 30 to 31.
>>
>> I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
>> from https://github.com/nxadm/rakudo-pkg/releases
>>
>> Now P6 can not find my subs inside my modules:
>>
>> # perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
>>  ===SORRY!=== Error while compiling -e
>>  Undeclared name:
>>  PrintGreen used at line 1
>>
>> [editorial comment] HHH! [/editorial comment]
>>
>> The stock "rakudo" and "rakudo-zef" that resides in the
>> Fedora repo's has the same issue.
>>
>> Many thanks,
>> -T
>
>
> I am hamstrung on so may fronts if I don't get this working!
>
> I gets uglier:
>
> # cat p6lib/ModuleTest.pm6
> sub ModuleTest() is export( :ModuleTest ) { say "Hi"; }
> sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
>
>
> # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst;
> ModuleTest; ModuleTst;'
>
> ===SORRY!=== Error while compiling -e
> Undeclared name:
>     ModuleTst used at line 1
>
>
> And way uglier.  I removed the ":"
> # cat p6lib/ModuleTest.pm6
>
> # sub ModuleTest() is export( :ModuleTest ) { say  "Hi"; }
> # sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
> sub ModuleTest() is export( ModuleTest ) { say  "Hi"; }
> sub ModuleTst()  is export( ModuleTst )  { say "Bye"; }
>
>
> # perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest;
> ModuleTst;'
> ===SORRY!=== Error while compiling
> /home/linuxutil/p6lib/ModuleTest.pm6 (ModuleTest)
> Undeclared name:
>     ModuleTest used at line 4
>
> And, And, depending on the position of the moon overhead,
> sometimes it works.    AAAHHH!


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 4:47 AM, Tom Browder wrote:
On Mon, Nov 4, 2019 at 06:25 ToddAndMargo via perl6-users 
mailto:perl6-users@perl.org>> wrote:

...

Okay, now we're getting somewhere! That's just a warning, but it runs. I 
am running an older version of Perl 6 (Raku) than you, so I don't get 
the warning.


My issue repeats in all of these versions
under Fedroa 31:

rakudo-pkg-Fedora29-2018.11-01.x86_64.rpm
rakudo-pkg-Fedora29-2019.03.1-01.x86_64.rpm
rakudo-pkg-Fedora30-2019.03.1-03.x86_64.rpm
rakudo-pkg-Fedora30-2019.07.1-03.x86_64.rpm
rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm




For the next step, try two things:

1. Run almost the same command but add an empty '()' after the last 'A'.

2. Run almost the same command with an ampersand in front of the 'A' and 
no '()'.


Results?

-Tom



[root@rn6 mytest]# perl6 -e 'use lib ; use A :A; A()'
WARNINGS for -e:
Useless use of constant value A() in sink context (line 1)

[root@rn6 mytest]# perl6 -e 'use lib ; use A :A; '
WARNINGS for -e:
Useless use of  in sink context (line 1)


Re: FC31 can't find my module subs

2019-11-04 Thread Tom Browder
On Mon, Nov 4, 2019 at 06:25 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
...

Okay, now we're getting somewhere! That's just a warning, but it runs. I am
running an older version of Perl 6 (Raku) than you, so I don't get the
warning.

For the next step, try two things:

1. Run almost the same command but add an empty '()' after the last 'A'.

2. Run almost the same command with an ampersand in front of the 'A' and no
'()'.

Results?

-Tom


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 3:42 AM, Tom Browder wrote:

On Mon, Nov 4, 2019 at 04:44 ToddAndMargo via perl6-users
 wrote:
...

Todd, please don't be so careless in what you show us. It's difficult
to zero in on your problem.  Do me a favor and go to a clean, empty
directory somewhere named 'mytest', and create EXACTLY what I describe
here:

+ create a sub-directory named 'lib'
+ in the sub-directory create two files named 'A.pm6' and 'B.pm6'
+ the contents of 'A.pm6':

 unit module A;
 sub A is export(:A) { say "A" }
 sub B is export(:B) { say "B" }

+ the contents of 'B.pm6':

 unit module B;
 sub A is export(:A) { say "A" }
 sub B is export(:B) { say "B" }

+ back in directory 'mytest' run the following command
 and you should get the same results I do: a single 'A'.

$ perl6 -e 'use lib ; use A :A; A'
A

Please show EXACTLY your command and the results, with no other
comment (and please DON'T TOP POST).

And do not make ANY changes to the test setup described above until I
ask you to.

-Tom




Hi Tom,

If you ever catch me top posting, please dope slap me!

Here you go.

Thank you for the h elp!

-T


# mkdir -p mytest/lib
# cd mytest

[root@rn6 mytest]# ls -aF lib
./  ../  A.pm6  B.pm6

# cat lib/A.pm6
unit module A;
sub A is export(:A) { say "A" }
sub B is export(:B) { say "B" }

# cat lib/B.pm6
unit module B;
sub A is export(:A) { say "A" }
sub B is export(:B) { say "B" }

[root@rn6 mytest]# perl6 -e 'use lib ; use A :A; A'
WARNINGS for -e:
Useless use of constant value A in sink context (line 1)

[root@rn6 mytest]# ls -aF lib
./  ../  A.pm6  B.pm6  .precomp/


Re: FC31 can't find my module subs

2019-11-04 Thread Tom Browder
On Mon, Nov 4, 2019 at 04:44 ToddAndMargo via perl6-users
 wrote:
...

Todd, please don't be so careless in what you show us. It's difficult
to zero in on your problem.  Do me a favor and go to a clean, empty
directory somewhere named 'mytest', and create EXACTLY what I describe
here:

+ create a sub-directory named 'lib'
+ in the sub-directory create two files named 'A.pm6' and 'B.pm6'
+ the contents of 'A.pm6':

unit module A;
sub A is export(:A) { say "A" }
sub B is export(:B) { say "B" }

+ the contents of 'B.pm6':

unit module B;
sub A is export(:A) { say "A" }
sub B is export(:B) { say "B" }

+ back in directory 'mytest' run the following command
and you should get the same results I do: a single 'A'.

$ perl6 -e 'use lib ; use A :A; A'
A

Please show EXACTLY your command and the results, with no other
comment (and please DON'T TOP POST).

And do not make ANY changes to the test setup described above until I
ask you to.

-Tom


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 2:28 AM, Tom Browder wrote:
On Mon, Nov 4, 2019 at 02:25 JJ Merelo > wrote:




El lun., 4 nov. 2019 a las 8:35, ToddAndMargo via perl6-users
(mailto:perl6-users@perl.org>>) escribió:


Problem still occurs with selinux disabled


One thing I noticed, you are missing a line at the top of your modules 
that should read something like "unit module MyModule;", 


My actual modules all have this

and the 
export(:some-key) is okay.


But then, in the calling programs, use them something like this:

use lib ;     # MyModule.pm6 is in this dir
use MyModule :some-key1, :some-key2; # note comma


This is my favorite method as it is far easier to maintain



HTH,

-Tom


Hi Tom,

I tried it both ways.  No joy.  But twice everything
started working, but then died again.  What did Fedora
31 do?

Thank you for the help!
-T


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: FC31 can't find my module subs

2019-11-04 Thread ToddAndMargo via perl6-users

On 11/4/19 12:24 AM, JJ Merelo wrote:



El lun., 4 nov. 2019 a las 8:35, ToddAndMargo via perl6-users 
(mailto:perl6-users@perl.org>>) escribió:



Problem still occurs with selinux disabled


selinux operates at a higher level. This is plain and simple not having 
the write bit set for your particular user.


Anyway, try this (as a regular user)

* Create a META6.json metadata file for every module, or a bunch of 
them, using the classic module layout (in a lib/ directory from root).

That is

/-- META6.json
     lib/
    MyModule.pm6

Make sure that MyModule.p6 is actually declared that way.
* zef test . (always a good idea too, including writing those self same 
tests)

* zef install . (zef will run tests too, so you double check).

That's the advised way to proceed always when you're developing a 
module. Once installed, you can use your modules from anywhere and, 
since they are in the default location, no need to use lib or -I.


BTW, that's clearly specified in the official documentation for modules 
https://docs.raku.org/language/modules

--
JJ


Hi JJ,

Not seeing the point, especially since I DO NOT want other
to see my code when I migrate it to my various customer's servers.  I 
also do not want others to see my code on this (LUKS encrypted) computer 
either.  On my customer's

servers, all my code  and directories are hidden to
everyone but root.  (The owner of the company gets a
list all users and passwords, as it is his property,
not mine.)

And everything I have installed with zef is working so far.

What write bit?  User root and group users can write
just fine to that directory.

# ls -al p6lib
total 84
drwxrwxr-x.  4 tony users  4096 Nov  3 23:12 .

They even can create a .precomp:


With this, everyone can write to it (I set it back afterwards)

[root@rn6 linuxutil]# chmod 2777 p6lib
[root@rn6 linuxutil]# perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest; 
ModuleTest; ModuleTst;'
===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6 
(ModuleTest)

Undeclared name:
ModuleTest used at line 4

This is a read issue.  P6 can read the file, but can
not process the subs correctly.

And it is not a Perl6 issue either.  The exact perl
(rakudo-pkg-Fedora30-2019.07.1-03.x86_64.rpm) I ran
on Fedora 30 has the same issue under Fedora 31.

What did Fedora 31 do?   AHH!!

-T


Re: FC31 can't find my module subs

2019-11-04 Thread Tom Browder
On Mon, Nov 4, 2019 at 02:25 JJ Merelo  wrote:

>
>
> El lun., 4 nov. 2019 a las 8:35, ToddAndMargo via perl6-users (<
> perl6-users@perl.org>) escribió:
>
>>
>> Problem still occurs with selinux disabled
>
>
One thing I noticed, you are missing a line at the top of your modules that
should read something like "unit module MyModule;", and the
export(:some-key) is okay.

But then, in the calling programs, use them something like this:

use lib ; # MyModule.pm6 is in this dir
use MyModule :some-key1, :some-key2; # note comma

HTH,

-Tom


Re: FC31 can't find my module subs

2019-11-04 Thread JJ Merelo
El lun., 4 nov. 2019 a las 8:35, ToddAndMargo via perl6-users (<
perl6-users@perl.org>) escribió:

>
> Problem still occurs with selinux disabled
>
>
selinux operates at a higher level. This is plain and simple not having the
write bit set for your particular user.

Anyway, try this (as a regular user)

* Create a META6.json metadata file for every module, or a bunch of them,
using the classic module layout (in a lib/ directory from root).
That is

/-- META6.json
lib/
   MyModule.pm6

Make sure that MyModule.p6 is actually declared that way.
* zef test . (always a good idea too, including writing those self same
tests)
* zef install . (zef will run tests too, so you double check).

That's the advised way to proceed always when you're developing a module.
Once installed, you can use your modules from anywhere and, since they are
in the default location, no need to use lib or -I.

BTW, that's clearly specified in the official documentation for modules
https://docs.raku.org/language/modules
-- 
JJ


Re: FC31 can't find my module subs

2019-11-04 Thread JJ Merelo
El lun., 4 nov. 2019 a las 8:52, ToddAndMargo via perl6-users (<
perl6-users@perl.org>) escribió:

> On 11/3/19 11:31 PM, JJ Merelo wrote:
> > Again, running stuff and installing it as root is never a good idea
>
>
> Most of my programs are for system administration and I have
> no choice but to run them as root.
>

You don't have to _develop_ them as root, though. Development, and
everything related to it, up to and including the version of the language
you're using, should never be done with root privileges.


-- 
JJ


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 11:31 PM, JJ Merelo wrote:

Again, running stuff and installing it as root is never a good idea



Most of my programs are for system administration and I have
no choice but to run them as root.


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 11:31 PM, JJ Merelo wrote:
Again, running stuff and installing it as root is never a good idea. 
It's not a good idea either to dump your modules in a directory, the 
proper way to do that is through zef install, running as a 
non-privileged user. The privileges of the .precomp directory might be 
one thing, but there might be other at work here.


El lun., 4 nov. 2019 a las 8:22, ToddAndMargo via perl6-users 
(mailto:perl6-users@perl.org>>) escribió:


Oh and it does find and read the modules.   If I
give it a bad module name, I get the finger wagged
at me:

# perl6 -I/home/linuxutil/p6lib -e 'use BadName;  ModuleTest;
ModuleTst;'
===SORRY!===
Could not find BadName at line 1 in:
      file#/home/linuxutil/p6lib
      inst#/root/.perl6
      inst#/opt/rakudo-pkg/share/perl6/site
      inst#/opt/rakudo-pkg/share/perl6/vendor
      inst#/opt/rakudo-pkg/share/perl6/core
      ap#
      nqp#
      perl5#


As opposed to something it can find:

# perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest;
ModuleTst;'
===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6
(ModuleTest)
Undeclared name:
      ModuleTest used at line 4



--
JJ



Problem still occurs with selinux disabled

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: FC31 can't find my module subs

2019-11-03 Thread JJ Merelo
Again, running stuff and installing it as root is never a good idea. It's
not a good idea either to dump your modules in a directory, the proper way
to do that is through zef install, running as a non-privileged user. The
privileges of the .precomp directory might be one thing, but there might be
other at work here.

El lun., 4 nov. 2019 a las 8:22, ToddAndMargo via perl6-users (<
perl6-users@perl.org>) escribió:

> Oh and it does find and read the modules.   If I
> give it a bad module name, I get the finger wagged
> at me:
>
> # perl6 -I/home/linuxutil/p6lib -e 'use BadName;  ModuleTest; ModuleTst;'
> ===SORRY!===
> Could not find BadName at line 1 in:
>  file#/home/linuxutil/p6lib
>  inst#/root/.perl6
>  inst#/opt/rakudo-pkg/share/perl6/site
>  inst#/opt/rakudo-pkg/share/perl6/vendor
>  inst#/opt/rakudo-pkg/share/perl6/core
>  ap#
>  nqp#
>  perl5#
>
>
> As opposed to something it can find:
>
> # perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest;
> ModuleTst;'
> ===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6
> (ModuleTest)
> Undeclared name:
>  ModuleTest used at line 4
>


-- 
JJ


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

Oh and it does find and read the modules.   If I
give it a bad module name, I get the finger wagged
at me:

# perl6 -I/home/linuxutil/p6lib -e 'use BadName;  ModuleTest; ModuleTst;'
===SORRY!===
Could not find BadName at line 1 in:
file#/home/linuxutil/p6lib
inst#/root/.perl6
inst#/opt/rakudo-pkg/share/perl6/site
inst#/opt/rakudo-pkg/share/perl6/vendor
inst#/opt/rakudo-pkg/share/perl6/core
ap#
nqp#
perl5#


As opposed to something it can find:

# perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest; ModuleTst;'
===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6 
(ModuleTest)

Undeclared name:
ModuleTest used at line 4


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 10:58 PM, JJ Merelo wrote:
The only thing I can think of is not having permission to write in that 
directory or in the directory you're running your program. In that case, 
perl6 will not be able to create a .precomp hidden directory, and that 
might result in what you're seeing. I see your modules are installed as 
root, which is probably not a good idea. if you're running your program 
as tony, you don't have write permission in /home/linuxutil/p6lib/ (as 
seen in the directory), and that might result in the eventual error 
you're seeing.


Just chown -R tony /home/linuxutil/p6lib and that should work.

JJ


I am so, so screwed if I don't get this working.

I have even tried prior versions:

rakudo-pkg-Fedora29-2018.11-01.x86_64.rpm
rakudo-pkg-Fedora29-2019.03.1-01.x86_64.rpm
rakudo-pkg-Fedora30-2019.03.1-03.x86_64.rpm
rakudo-pkg-Fedora30-2019.07.1-03.x86_64.rpm

and the one in the Fedora repo

it does the same thing for users tony, todd, root

I renamed p6lib/.precomp and it recreate one
as soon as I ran something (as root this time)

[root@rn6 p6lib]# mv .precomp .precomp.000

[root@rn6 p6lib]# ../GetPublicIP.pl6
===SORRY!=== Error while compiling /home/linuxutil/p6lib/../GetPublicIP.pl6
Undeclared names:
RunNoShell used at lines 19, 23
WriteSecondaryClipboard used at line 24

[root@rn6 p6lib]# ls -al .precomp*
.precomp:
total 12
drwxr-xr-x. 3 root root  4096 Nov  3 23:12 .
drwxrwxr-x. 4 tony users 4096 Nov  3 23:12 ..
drwxr-xr-x. 8 root root  4096 Nov  3 23:12 
843FBB0CEFE0FB475EBFA7FEAEEADA648E562FF7

-rw-r--r--. 1 root root 0 Nov  3 23:12 .lock

.precomp.000:
total 32
drwxr-xr-x.  8 root root  4096 Nov  3 18:46 .
drwxrwxr-x.  4 tony users 4096 Nov  3 23:12 ..
drwxr-xr-x. 10 root root  4096 Nov  3 18:46 
07375CA427616339BBFC24962204EEB83B2CEE6A
drwxr-xr-x.  8 root root  4096 Nov  3 14:32 
4912B1FACD657C183C02A1B78AD3A2E03B1CC2D0
drwxr-xr-x. 12 root root  4096 Nov  3 18:27 
843FBB0CEFE0FB475EBFA7FEAEEADA648E562FF7
drwxr-xr-x. 10 root root  4096 Nov  3 18:45 
B584C5F1DFA3585D8CEABA17618A6737431E2D00
drwxr-xr-x. 43 root root  4096 Jun 11 15:46 
B7E59BC9C829B78CEACC421073F5F16FDE0DA86F
drwxr-xr-x.  9 root root  4096 Apr 28  2019 
D806D91A85A9EF22D75A1EBA54A6A27D1E3A7068

-rw-r--r--.  1 root root 0 Apr 28  2019 .lock



--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: FC31 can't find my module subs

2019-11-03 Thread JJ Merelo
The only thing I can think of is not having permission to write in that
directory or in the directory you're running your program. In that case,
perl6 will not be able to create a .precomp hidden directory, and that
might result in what you're seeing. I see your modules are installed as
root, which is probably not a good idea. if you're running your program as
tony, you don't have write permission in /home/linuxutil/p6lib/ (as seen in
the directory), and that might result in the eventual error you're seeing.

Just chown -R tony /home/linuxutil/p6lib and that should work.

JJ


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users
El lun., 4 nov. 2019 a las 6:48, ToddAndMargo via perl6-users 
(mailto:perl6-users@perl.org>>) escribió:


On 11/3/19 6:56 PM, ToddAndMargo via perl6-users wrote:
 > On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:
 >> Hi All,
 >>
 >> Help!
 >>
 >> I just upgraded Fedora from 30 to 31.
 >>
 >> I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
 >> from https://github.com/nxadm/rakudo-pkg/releases
 >>
 >> Now P6 can not find my subs inside my modules:
 >>
 >> # perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen(
"Hi\n" );'
 >>  ===SORRY!=== Error while compiling -e
 >>  Undeclared name:
 >>  PrintGreen used at line 1
 >>
 >> [editorial comment] HHH! [/editorial comment]
 >>
 >> The stock "rakudo" and "rakudo-zef" that resides in the
 >> Fedora repo's has the same issue.
 >>
 >> Many thanks,
 >> -T
 >
 >
 > I am hamstrung on so may fronts if I don't get this working!
 >
 > I gets uglier:
 >
 > # cat p6lib/ModuleTest.pm6
 > sub ModuleTest() is export( :ModuleTest ) { say "Hi"; }
 > sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
 >
 >
 > # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst;
ModuleTest;
 > ModuleTst;'
 >
 > ===SORRY!=== Error while compiling -e
 > Undeclared name:
 >      ModuleTst used at line 1
 >
 >
 > And way uglier.  I removed the ":"
 > # cat p6lib/ModuleTest.pm6
 >
 > # sub ModuleTest() is export( :ModuleTest ) { say  "Hi"; }
 > # sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
 > sub ModuleTest() is export( ModuleTest ) { say  "Hi"; }
 > sub ModuleTst()  is export( ModuleTst )  { say "Bye"; }
 >
 >
 > # perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest;
 > ModuleTst;'
 > ===SORRY!=== Error while compiling
/home/linuxutil/p6lib/ModuleTest.pm6
 > (ModuleTest)
 > Undeclared name:
 >      ModuleTest used at line 4
 >
 > And, And, depending on the position of the moon overhead,
 > sometimes it works.    AAAHHH!


I just reproduced this problem on a fresh Fedora 31
virtual machine that has never before been touched by
perl6 (rakudo)



--
JJ




On 11/3/19 10:27 PM, JJ Merelo wrote:
> What's the content of /home/linuxutil/p6lib?
>

/home/linuxutil/p6lib is where I stash my p6 modules.
ModuleTest.pm6 is one of them.

This error is occurring across all my programs
that call my custom modules.

And in case that was not what you asked:

# ls -al /home/linuxutil/p6lib/
total 80
drwxrwxr-x.  3 root root   4096 Nov  3 18:53 .
drwxr-xr-x. 27 root root  12288 Jun 11 15:44 ..
-rw-r--r--.  1 tony users  1972 Apr 28  2019 CheckSystemDependancy.pm6
-rwxr-xr-x.  1 tony users 11367 Nov  3 18:30 CurlUtils.pm6
-rwxr-xr-x.  1 tony users  2435 Apr 28  2019 eMailDate.pm6
-rwxr-xr-x.  1 tony users 0 Apr 26  2019 FileVer.pm6
-rwxrwxrwx.  1 tony users   295 Nov  3 18:52 ModuleTest.pm6
-rw-r--r--.  1 tony users  4194 Apr 26  2019 Net.FTP.Inline.Perl5.pm6
-rwxr-xr-x.  1 tony users  2226 Apr 28  2019 PauseLib.pm6
drwxr-xr-x.  8 root root   4096 Nov  3 18:46 .precomp
-rwxr-xr-x.  1 tony users  1425 Apr 28  2019 PrintColors.pm6
-rw-r--r--.  1 tony users  2360 Apr 26  2019 Raw.pm6
-rwxr-xr-x.  1 tony users  5380 Nov  3 18:15 RunNoShellLib.pm6
-rw-r--r--.  1 tony users  3177 Nov  3 18:29 X11Clipboard.pm6
-rw-r--r--.  1 tony users  2748 Apr 26  2019 Xlib.pm6






--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: FC31 can't find my module subs

2019-11-03 Thread JJ Merelo
What's the content of /home/linuxutil/p6lib?

El lun., 4 nov. 2019 a las 6:48, ToddAndMargo via perl6-users (<
perl6-users@perl.org>) escribió:

> On 11/3/19 6:56 PM, ToddAndMargo via perl6-users wrote:
> > On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:
> >> Hi All,
> >>
> >> Help!
> >>
> >> I just upgraded Fedora from 30 to 31.
> >>
> >> I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
> >> from https://github.com/nxadm/rakudo-pkg/releases
> >>
> >> Now P6 can not find my subs inside my modules:
> >>
> >> # perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
> >>  ===SORRY!=== Error while compiling -e
> >>  Undeclared name:
> >>  PrintGreen used at line 1
> >>
> >> [editorial comment] HHH! [/editorial comment]
> >>
> >> The stock "rakudo" and "rakudo-zef" that resides in the
> >> Fedora repo's has the same issue.
> >>
> >> Many thanks,
> >> -T
> >
> >
> > I am hamstrung on so may fronts if I don't get this working!
> >
> > I gets uglier:
> >
> > # cat p6lib/ModuleTest.pm6
> > sub ModuleTest() is export( :ModuleTest ) { say "Hi"; }
> > sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
> >
> >
> > # perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst; ModuleTest;
> > ModuleTst;'
> >
> > ===SORRY!=== Error while compiling -e
> > Undeclared name:
> >  ModuleTst used at line 1
> >
> >
> > And way uglier.  I removed the ":"
> > # cat p6lib/ModuleTest.pm6
> >
> > # sub ModuleTest() is export( :ModuleTest ) { say  "Hi"; }
> > # sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
> > sub ModuleTest() is export( ModuleTest ) { say  "Hi"; }
> > sub ModuleTst()  is export( ModuleTst )  { say "Bye"; }
> >
> >
> > # perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest;
> > ModuleTst;'
> > ===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6
> > (ModuleTest)
> > Undeclared name:
> >  ModuleTest used at line 4
> >
> > And, And, depending on the position of the moon overhead,
> > sometimes it works.AAAHHH!
>
>
> I just reproduced this problem on a fresh Fedora 31
> virtual machine that has never before been touched by
> perl6 (rakudo)
>


-- 
JJ


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 6:56 PM, ToddAndMargo via perl6-users wrote:

On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:

Hi All,

Help!

I just upgraded Fedora from 30 to 31.

I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
from https://github.com/nxadm/rakudo-pkg/releases

Now P6 can not find my subs inside my modules:

# perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
 ===SORRY!=== Error while compiling -e
 Undeclared name:
 PrintGreen used at line 1

[editorial comment] HHH! [/editorial comment]

The stock "rakudo" and "rakudo-zef" that resides in the
Fedora repo's has the same issue.

Many thanks,
-T



I am hamstrung on so may fronts if I don't get this working!

I gets uglier:

# cat p6lib/ModuleTest.pm6
sub ModuleTest() is export( :ModuleTest ) { say "Hi"; }
sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }


# perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst; ModuleTest; 
ModuleTst;'


===SORRY!=== Error while compiling -e
Undeclared name:
     ModuleTst used at line 1


And way uglier.  I removed the ":"
# cat p6lib/ModuleTest.pm6

# sub ModuleTest() is export( :ModuleTest ) { say  "Hi"; }
# sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
sub ModuleTest() is export( ModuleTest ) { say  "Hi"; }
sub ModuleTst()  is export( ModuleTst )  { say "Bye"; }


# perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest; 
ModuleTst;'
===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6 
(ModuleTest)

Undeclared name:
     ModuleTest used at line 4

And, And, depending on the position of the moon overhead,
sometimes it works.    AAAHHH!



I just reproduced this problem on a fresh Fedora 31
virtual machine that has never before been touched by
perl6 (rakudo)


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:

Hi All,

Help!

I just upgraded Fedora from 30 to 31.

I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
from https://github.com/nxadm/rakudo-pkg/releases

Now P6 can not find my subs inside my modules:

# perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
     ===SORRY!=== Error while compiling -e
     Undeclared name:
     PrintGreen used at line 1

[editorial comment] HHH! [/editorial comment]

The stock "rakudo" and "rakudo-zef" that resides in the
Fedora repo's has the same issue.

Many thanks,
-T



I am hamstrung on so may fronts if I don't get this working!

I gets uglier:

# cat p6lib/ModuleTest.pm6
sub ModuleTest() is export( :ModuleTest ) { say "Hi"; }
sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }


# perl6 -I./p6lib -e 'use ModuleTest :ModuleTest :ModuleTst; 
ModuleTest; ModuleTst;'


===SORRY!=== Error while compiling -e
Undeclared name:
ModuleTst used at line 1


And way uglier.  I removed the ":"
# cat p6lib/ModuleTest.pm6

# sub ModuleTest() is export( :ModuleTest ) { say  "Hi"; }
# sub ModuleTst()  is export( :ModuleTst )  { say "Bye"; }
sub ModuleTest() is export( ModuleTest ) { say  "Hi"; }
sub ModuleTst()  is export( ModuleTst )  { say "Bye"; }


# perl6 -I/home/linuxutil/p6lib -e 'use ModuleTest;  ModuleTest; ModuleTst;'
===SORRY!=== Error while compiling /home/linuxutil/p6lib/ModuleTest.pm6 
(ModuleTest)

Undeclared name:
ModuleTest used at line 4

And, And, depending on the position of the moon overhead,
sometimes it works.AAAHHH!


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 3:56 PM, ToddAndMargo via perl6-users wrote:

ReadSecondaryClipboard ]


that was a typo.  original code has a ; at the end


Re: FC31 can't find my module subs

2019-11-03 Thread ToddAndMargo via perl6-users

On 11/3/19 3:15 PM, ToddAndMargo via perl6-users wrote:

Hi All,

Help!

I just upgraded Fedora from 30 to 31.

I upgraded to rakudo-pkg-Fedora31-2019.07.1-03.x86_64.rpm
from https://github.com/nxadm/rakudo-pkg/releases

Now P6 can not find my subs inside my modules:

# perl6 -I/home/linuxutil/p6lib -MPrintColors -e 'PrintGreen( "Hi\n" );'
     ===SORRY!=== Error while compiling -e
     Undeclared name:
     PrintGreen used at line 1

[editorial comment] HHH! [/editorial comment]

The stock "rakudo" and "rakudo-zef" that resides in the
Fedora repo's has the same issue.

Many thanks,
-T



Have you guys changed the way you import things?  Does this
no longer work?

use lib '/home/linuxutil/p6lib';
use RunNoShell;
use X11Clipboard; ReadSecondaryClipboard ]
use CheckSystemDependancy;