Navigation Menu

Skip to content
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

shouldn't site be earlier in @*INC ? #3613

Closed
p6rt opened this issue Jan 10, 2015 · 8 comments
Closed

shouldn't site be earlier in @*INC ? #3613

p6rt opened this issue Jan 10, 2015 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Jan 10, 2015

Migrated from rt.perl.org#123578 (status was 'resolved')

Searchable as RT123578$

@p6rt
Copy link
Author

p6rt commented Jan 10, 2015

From @szabgab

Currently in Rakudo * 2014.12.1 The @​*INC order looks like this​:

$ perl6

@​*INC.perl

Array.new(CompUnitRepo.new('file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/lib'),
CompUnitRepo.new('file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site/lib'),
CompUnitRepo.new('inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6'),
CompUnitRepo.new('inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site'))

and Bailador.pm can be found in
/Users/gabor/rakudo-star-2014.12.1//install/languages/perl6/lib/Bailador.pm

After installing a new version of Bailador using

panda install .

the new file was placed in

/Users/gabor/rakudo-star-2014.12.1//install/languages/perl6/site/lib/Bailador.pm

but that means, if I "use Bailador" it will find the old version.

I think both 'site' directories should be *before* the respective other
directory.

Gabor

@p6rt
Copy link
Author

p6rt commented Jan 11, 2015

From @lizmat

On 10 Jan 2015, at 12​:56, Gabor Szabo (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Gabor Szabo
# Please include the string​: [perl #​123578]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=123578 >

Currently in Rakudo * 2014.12.1 The @​*INC order looks like this​:

$ perl6

@​*INC.perl

Array.new(CompUnitRepo.new('file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/lib'),
CompUnitRepo.new('file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site/lib'),
CompUnitRepo.new('inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6'),
CompUnitRepo.new('inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site'))

and Bailador.pm can be found in
/Users/gabor/rakudo-star-2014.12.1//install/languages/perl6/lib/Bailador.pm

How did that get there (originally) ??? This feels like a “personal” install to me, which would have a higher precedence than a “site” install.

After installing a new version of Bailador using

panda install .

the new file was placed in

/Users/gabor/rakudo-star-2014.12.1//install/languages/perl6/site/lib/Bailador.pm

but that means, if I "use Bailador" it will find the old version.

Indeed. Question is (to me)​: how did the original one get there?

I think both 'site' directories should be *before* the respective other
directory.

This can be easily fixed. But I’m not sure it’s the right solution :-(

Liz

@p6rt
Copy link
Author

p6rt commented Jan 11, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 12, 2015

From @szabgab

If I recall correctly in Perl 5 the resolution was that the directories in
@​INC are ordered
site, vendor, system

I am not sure about Perl 6, but with the above layout I think system would
hold the modules of Rakudo.
vendor would hold the modules of Rakudo Star and site would hold the stuff
that I install myself
using Panda or otherwise.

I ran some experiments from scratch in two ways​: (with and without giving
--prefix)
using Rakudo Star 2014.12.1 Source code version and built it on OSX.
I hope these help and I have not just spent time on something that was
already obvious
to everyone else.

1) perl Configure.pl --backends=moar --gen-moar --prefix=/home/gabor/rakudo
  make; make install

$ ~/rakudo/bin/perl6 -e 'say @​*INC'
file​:/home/gabor/rakudo/languages/perl6/lib
inst​:/home/gabor/rakudo/languages/perl6

$ find /Users/gabor/rakudo -name Bailador.pm
/Users/gabor/rakudo/languages/perl6/lib/Bailador.pm

$ ~/rakudo/bin/perl6 /Users/gabor/rakudo/bin/panda
Found no writable directory into which panda could be installed
  in sub make-default-ecosystem at
/home/gabor/rakudo/languages/perl6/lib/Panda/App.pm​:18
  in block <unit> at /Users/gabor/rakudo/bin/panda​:11

$ ~/rakudo/bin/perl6 -e 'say @​*INC'
inst​:/Users/gabor/.perl6/2014.12
file​:/home/gabor/rakudo/languages/perl6/lib
inst​:/home/gabor/rakudo/languages/perl6
inst​:/home/gabor/rakudo/languages/perl6/site

******* So by running panda I got some more entries in @​*INC

$ ~/rakudo/bin/perl6 /Users/gabor/rakudo/bin/panda install Bailador
....

$ find /Users/gabor/rakudo -name Bailador.pm
/Users/gabor/rakudo/languages/perl6/lib/Bailador.pm
/Users/gabor/rakudo/languages/perl6/site/lib/Bailador.pm

****** panda installs Bailador in the site dir which comes after the
regular

1) perl Configure.pl --backends=moar --gen-moar
  make; make install

$ perl6 -e 'say @​*INC'

file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/lib
inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6
inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site

******** has a different @​*INC than what I had when I built it with
--prefix. This one already has a site directory

$ find /Users/gabor/rakudo-star-2014.12.1 -name Bailador.pm
/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/lib/Bailador.pm
/Users/gabor/rakudo-star-2014.12.1/modules/Bailador/lib/Bailador.pm

****** as I understand the one in the modules directory came with the
source code of Rakudo * and the one in the install is the installed version
of it.

$ ~/rakudo-star-2014.12.1/install/bin/perl6
~/rakudo-star-2014.12.1/install/bin/panda install Bailador
...

$ perl6 -e 'say @​*INC'

file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/lib
file​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site/lib
inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6
inst​:/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site

****** by installing Bailador, the @​*INC was changed

$ find /Users/gabor/rakudo-star-2014.12.1 -name Bailador.pm
/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/lib/Bailador.pm
/Users/gabor/rakudo-star-2014.12.1/install/languages/perl6/site/lib/Bailador.pm
/Users/gabor/rakudo-star-2014.12.1/modules/Bailador/lib/Bailador.pm

***** and now I have a third copy of Bailador.pm

Gabor

@p6rt
Copy link
Author

p6rt commented Jan 13, 2015

From @usev6

FWIW, this discussion seems to be related​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=122725

Christian

@p6rt
Copy link
Author

p6rt commented May 21, 2016

From @smls

@​*INC no longer exists.

Also, 'perl6/site' seems to be pretty early in the repo chain now​:

  ➜ .say for $*REPO.repo-chain;
  inst#/home/smls/.perl6
  inst#/home/smls/.rakudobrew/moar-blead-nom/install/share/perl6/site
  inst#/home/smls/.rakudobrew/moar-blead-nom/install/share/perl6/vendor
  inst#/home/smls/.rakudobrew/moar-blead-nom/install/share/perl6
  CompUnit​::Repository​::AbsolutePath.new(next-repo => CompUnit​::Repository​::NQP.new(next-repo => CompUnit​::Repository​::Perl5.new(next-repo => CompUnit​::Repository)))
  CompUnit​::Repository​::NQP.new(next-repo => CompUnit​::Repository​::Perl5.new(next-repo => CompUnit​::Repository))
  CompUnit​::Repository​::Perl5.new(next-repo => CompUnit​::Repository)

Can this ticket be closed?
Do we need a Roast test for this?

@p6rt
Copy link
Author

p6rt commented May 22, 2016

@p6rt p6rt closed this as completed May 22, 2016
@p6rt
Copy link
Author

p6rt commented May 22, 2016

@smls - Status changed from 'open' to 'resolved'

@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant