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

Document undocumented PERL_CARTON_MIRROR environmental variable #183

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hesco
Copy link

@hesco hesco commented Sep 18, 2014

No description provided.

@boundedinfinity
Copy link

PERL_CARTON_MIRROR doesn't seem to work correctly. I haven't been able to get Carton to see my private repository at all using PERL_CARTON_MIRROR=http://my.mirror.com carton install . Looking through the code, it seems that that environment variable is only referenced in the _build_mirror method, which I assume is a Moose builder method, that doesn't seem to be used any where.

EDIT: Ah I see this is using Moo, and not Moose, which should use the _build_mirror method, but I still can't get it to work (meaning it doesn't recognize the PERL_CARTON_MIRROR variable) .

@oalders
Copy link
Contributor

oalders commented Jan 22, 2015

So, I've been messing around with this ENV var and I can't get it to work. So far, this is what I found:

mkdir orepan-test
cd orepan-test

orepan2-inject https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTML-Restrict-2.1.8.tar.gz darkpan

echo "requires 'HTML::Restrict', '< 2.1.9';" > cpanfile
PERL_CARTON_MIRROR=darkpan carton install

Which creates this structure:

tree orepan-test/
orepan-test/
├── cpanfile
├── darkpan
│   ├── authors
│   │   └── id
│   │       └── D
│   │           └── DU
│   │               └── DUMMY
│   │                   └── HTML-Restrict-2.1.8.tar.gz
│   ├── modules
│   │   └── 02packages.details.txt.gz
│   └── orepan2-cache.json
└── local

And the commands have the following output. (The first 3 lines are from orepan2-inject):

Wrote 1 from https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTML-Restrict-2.1.8.tar.gz
[INFO] Could not find useful meta from 'darkpan/authors/id/D/DU/DUMMY/HTML-Restrict-2.1.8.tar.gz'
[INFO] Scanning for provided modules...
Installing modules using /Users/olaf/Documents/perl/orepan/orepan-test/cpanfile
! Couldn't find module or a distribution HTML::Restrict (< v2.1.9)
! Installing the dependencies failed: Module 'HTML::Restrict' is not installed
! Bailing out the installation for /Users/olaf/Documents/perl/orepan/orepan-test/.

The output in my cpanm build.log is:

cpanm (App::cpanminus) 1.7022 on perl 5.018002 built for darwin-thread-multi-2level
Work directory is /Users/olaf/.cpanm/work/1421897157.58021
You have make /usr/bin/make
You have LWP 6.05
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (6.66)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.59)
--> Working on /Users/olaf/Documents/perl/orepan/orepan-test/
Entering /Users/olaf/Documents/perl/orepan/orepan-test
Configuring /Users/olaf/Documents/perl/orepan/orepan-test
-> OK
Checking if you have HTML::Restrict < v2.1.9 ... No
==> Found dependencies: HTML::Restrict
Searching HTML::Restrict on mirror darkpan ...
Downloading index file darkpan/modules/02packages.details.txt.gz ...
Uncompressing index file...
-> FAIL cannot open file '/Users/olaf/.cpanm/sources/darkpan/02packages.details.txt.gz': No such file or directory opening compressed index
Searching HTML::Restrict on mirror http://cpan.metacpan.org ...
Downloading index file http://cpan.metacpan.org/modules/02packages.details.txt.gz ...
Found HTML::Restrict 2.002002 which doesn't satisfy < v2.1.9.
-> FAIL Finding HTML::Restrict (< v2.1.9) on mirror http://cpan.metacpan.org failed.
Searching HTML::Restrict on mirror http://backpan.perl.org ...
Downloading index file http://backpan.perl.org/modules/02packages.details.txt.gz ...
-> FAIL Finding HTML::Restrict (< v2.1.9) on mirror http://backpan.perl.org failed.
-> FAIL Couldn't find module or a distribution HTML::Restrict (< v2.1.9)
-> FAIL Installing the dependencies failed: Module 'HTML::Restrict' is not installed
-> FAIL Bailing out the installation for /Users/olaf/Documents/perl/orepan/orepan-test/.

And the problematic lines seem to be:

Downloading index file darkpan/modules/02packages.details.txt.gz ...
Uncompressing index file...
-> FAIL cannot open file '/Users/olaf/.cpanm/sources/darkpan/02packages.details.txt.gz': No such file or directory opening compressed index

That sources folder just ends up being empty:

tree /Users/olaf/.cpanm/sources/darkpan
/Users/olaf/.cpanm/sources/darkpan

0 directories, 0 files

@miyagawa
Copy link
Contributor

@oalders try: PERL_CARTON_MIRROR=file://$PWD/darkpan carton install

PERL_CARTON_MIRROR is supposed to be a URI, and your specification of "darkpan" doesn't follow.

@oalders
Copy link
Contributor

oalders commented Jan 22, 2015

@miyagawa Thanks very much. Works for me now. :) Any reason PERL_CARTON_MIRROR isn't documented?

@hesco
Copy link
Author

hesco commented Jan 22, 2015

@miyagawa -- please note, my patch is perldoc only. And the Tavis CI regression has nothing to do with the documentation I added.

@miyagawa
Copy link
Contributor

The reason for non-documentation is I'm meant to merge a new feature to describe them directly in cpanfile using the mirror DSL, or a command line option to override it.

@oalders
Copy link
Contributor

oalders commented Jan 22, 2015

Ah, that makes sense.

@akarelas
Copy link

Just pinging... Any plans to do the above? (ie merge the new feature, and document this env var?)

@oalders
Copy link
Contributor

oalders commented Sep 27, 2017

@akarelas you could maybe work around this by using App::cpm to install your modules.

cpm install --mirror https://cpan.metacpan.org

cpm will use your cpanfile.snapshot and has the option to ignore it. For MetaCPAN Travis builds we've switched to installing our deps this way as it's faster. See https://github.com/metacpan/metacpan-web/blob/master/.travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants