Skip to content

Commit

Permalink
Use PERL_ONLY environment variable instead of MITE_PURE_PERL
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyink committed Aug 13, 2022
1 parent 8105324 commit 85ec278
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ true
[coverage_options]
-select_re '^blib/lib/' -ignore_re '\.mite\.pm$'
[test]
- name: Test suite (MITE_PURE_PERL=0)
- name: Test suite (PERL_ONLY=0)
working-directory: ./build/
env:
MITE_PURE_PERL: 0
PERL_ONLY: 0
run: gha-prove -b -r t
- name: Test suite (MITE_PURE_PERL=1)
- name: Test suite (PERL_ONLY=1)
working-directory: ./build/
env:
MITE_PURE_PERL: 1
PERL_ONLY: 1
run: gha-prove -b -r t
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ jobs:
if: matrix.coverage
working-directory: ./build/
run: cover -delete
- name: Test suite (MITE_PURE_PERL=0)
- name: Test suite (PERL_ONLY=0)
working-directory: ./build/
env:
MITE_PURE_PERL: 0
PERL_ONLY: 0
run: gha-prove -b -r t
- name: Test suite (MITE_PURE_PERL=1)
- name: Test suite (PERL_ONLY=1)
working-directory: ./build/
env:
MITE_PURE_PERL: 1
PERL_ONLY: 1
run: gha-prove -b -r t
- name: Coveralls.io report
if: success() && matrix.coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ jobs:
run: prove -lr t
working-directory: devel.examples/${{ matrix.demo }}
- name: Run ${{ matrix.demo }} test suite in PP mode
run: prove -Msetenv=MITE_PURE_PERL,1 -lr t
run: prove -Msetenv=PERL_ONLY,1 -lr t
working-directory: devel.examples/${{ matrix.demo }}
2 changes: 1 addition & 1 deletion lib/Mite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Mite writes pure Perl code and your module will run with no
dependencies. It will also write code to use other, faster modules to
do the same job, if available.
These optimizations can be turned off by setting the C<MITE_PURE_PERL>
These optimizations can be turned off by setting the C<PERL_ONLY>
environment variable true.
You may wish to add these as recommended dependencies.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mite/Attribute.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ sub compile {
my %args = @_;

my $xs_condition = $args{xs_condition}
|| '!$ENV{MITE_PURE_PERL} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }';
|| '!$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }';
my $slot_name = $self->name;

my %xs_option_name = (
Expand Down
2 changes: 1 addition & 1 deletion lib/Mite/Trait/HasAttributes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ sub _compile_attribute_accessors {
my $attributes = $self->attributes;
keys %$attributes or return '';

my $code = 'my $__XS = !$ENV{MITE_PURE_PERL} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };' . "\n\n";
my $code = 'my $__XS = !$ENV{PERL_ONLY} && eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };' . "\n\n";
for my $name ( sort keys %$attributes ) {
my $guard = $attributes->{$name}->locally_set_compiling_class( $self );
$code .= $attributes->{$name}->compile( xs_condition => '$__XS' );
Expand Down

0 comments on commit 85ec278

Please sign in to comment.