Skip to content

Skip building XS when PUREPERL_ONLY=1 set - #2

Merged
rehsack merged 2 commits into
perl5-utils:masterfrom
zmughal:pureperl-skip-linking
Jan 16, 2026
Merged

rehsack merged 2 commits into
perl5-utils:masterfrom
zmughal:pureperl-skip-linking

Conversation

@zmughal

@zmughal zmughal commented May 26, 2021

Copy link
Copy Markdown
Contributor

This change skips the static/dynamic sections of the Makefile when using a
pure-Perl install so that no XS linking is done at all.

Compare the build logs below:

$ for br in master pureperl-skip-linking; do \
echo "On branch $br"; \
git checkout -q $br ; \
git clean -f; \
( perl Makefile.PL PUREPERL_ONLY=1 && make && make clean)  | grep -Fe $( perl -MConfig -e 'print $Config{cc}' ); \
echo; \
done
On branch master
Checking for cc... cc
cc -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"1.102\" -DXS_VERSION=\"1.102\" -fPIC "-I$HOME/perl5/perlbrew/perls/perl-5.26.1/lib/5.26.1/x86_64-linux/CORE"   Util.c
cc  -shared -O2 -L/usr/local/lib -fstack-protector-strong  Util.o  -o blib/arch/auto/Params/Util/Util.so  \

On branch pureperl-skip-linking
Checking for cc... cc

@zmughal

zmughal commented May 26, 2021

Copy link
Copy Markdown
Contributor Author

I see there is not a CI configuration running any more (previously Travis CI). Would it help to use GitHub Actions to test this out?

@rehsack

rehsack commented May 26, 2021

Copy link
Copy Markdown
Member

I would love a PR which test whether this provides a reasonable and working change :)
Further, I'd prefer commit messages which explain the business case behind a commit, not the technical change. Most people reading commits can derive technical stuff on it's own and the remaining need the business reasons.

When `PUREPERL_ONLY=1` set, this prevents the Makefile from having rules
that compile the XS code. This is useful to have when building
dependencies for deploying to a pure Perl install such as when using
`App::FatPacker`. This removes the need to skip over files that end in
`perl -V:dlext` (e.g., `.so`, `.dll`, `.dylib`) when copying to a
deployment.

This should allow for using the `cpanm --pureperl` option so that a pure
Perl installation can be requested for all installed distributions.

Signed-off-by: Zakariyya Mughal <zaki.mughal@gmail.com>
@zmughal
zmughal force-pushed the pureperl-skip-linking branch 14 times, most recently from 31e9276 to 4c9b0c9 Compare May 26, 2021 19:15
@zmughal

zmughal commented May 26, 2021

Copy link
Copy Markdown
Contributor Author

@rehsack, OK, sounds good!

You can review updated commits to see if this fits the requirements. A workflow that tests what I'm getting at is here.

@zmughal

zmughal commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

Hi, if you have time, could you review this. It should be working on multiple platforms per the new CI workflow.

@zmughal

zmughal commented Dec 5, 2021

Copy link
Copy Markdown
Contributor Author

@rehsack, just reaching out again about this PR.

@zmughal

zmughal commented Jan 27, 2022

Copy link
Copy Markdown
Contributor Author

@rehsack, hello, do you have a moment to review this PR?

This is to test that the tests pass as expected under various versions
of Perl both using XS and pure Perl installs.

Signed-off-by: Zakariyya Mughal <zaki.mughal@gmail.com>
@zmughal
zmughal force-pushed the pureperl-skip-linking branch from 4c9b0c9 to 3afa712 Compare August 9, 2022 23:38
@zmughal

zmughal commented Aug 9, 2022

Copy link
Copy Markdown
Contributor Author

Hello @rehsack, I just ran the CI I made here again and it still passes. I also added a few more Perl versions to test against.

@plicease

plicease commented Jan 14, 2026 •

Copy link
Copy Markdown

can confirm that this one line patch makes it work. What is currently on CPAN does not.

@rehsack

rehsack commented Jan 16, 2026

Copy link
Copy Markdown
Member

@plicease / @zmughal - beside merging that: I will not re-install perl and make a release.
I spent to much spare time with negative return, so I decided to avoid future invest of spare time.

Neither Perl nor CPAN have any relevant role on embedded platforms.

@rehsack
rehsack merged commit fa7199d into perl5-utils:master Jan 16, 2026
@zmughal
zmughal deleted the pureperl-skip-linking branch January 20, 2026 02:47
@zmughal

zmughal commented Jan 20, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for merging, @rehsack. If there is anything that I can do to help, please let me know. Also, thank you for looking at the change, @plicease.

I have made the CI green again with #4.

@plicease

plicease commented Jan 21, 2026 •

Copy link
Copy Markdown

@rehsack How about giving @zmughal (CPAN id ZMUGHAL) and myself co-maint (or even owner) we can cut the release if you are no longer interested in maintaining this module. My CPAN id is PLICEASE.

@plicease

Copy link
Copy Markdown

If you do not have access to PAUSE or the time to do it yourself you can also email the PAUSE admins at modules@perl.org and ask them to do it for you, they will be only to happy to do so.

@rehsack

rehsack commented Jan 25, 2026

Copy link
Copy Markdown
Member

@plicease & @zmughal - we can probably talk about that. But I would expect that XS remains supported on host as well for cross-compile at the same level as the PP support is.

@plicease

Copy link
Copy Markdown

@plicease & @zmughal - we can probably talk about that. But I would expect that XS remains supported on host as well for cross-compile at the same level as the PP support is.

XS doesn't work for a fat packed script (App::FatPacker) which is the application that I am working on. While I appreciate your having merged this PR, it doesn't really help me without a corresponding release since the system I am using gets modules from CPAN.

I'm not sure how this is relevant to the discussion of the ownership/co-maint status though, you yourself said that you are not interested in maintaining this module, why not let us take it off your hands?

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.

3 participants