Comments (7)
Thanks @sisyphus
@qikdauie - Some other approaches are given at https://www.perl.com/article/45/2013/10/27/How-to-redirect-and-restore-STDOUT/
from perl-dist-strawberry.
I don't think this is a strawberry perl issue per se. The script is opening its own file handle called STDOUT, which overrides or conflicts with the existing STDOUT, and which then causes issues when the close is called.
I assume this is the full script? https://github.com/dot-asm/cryptogams/blob/master/ppc/aesp8-ppc.pl
Changing the script to use a lexical file handle and printing to that might fix things. (A general update to use lexical variables, strict and warnings would also be useful).
This should only need changes at four locations to use a lexical file handle, print to that file handle and then close it.
#L67
open my $stdout, "| $^X $xlate $flavour ".shift || die "can't call $xlate: $!";
# L3777
print {$stdout} ".byte\t",join(',',map (sprintf("0x%02x",$_),@bytes)),"\n";
#L3798
print {$stdout} print $_,"\n";
#L3801
close $stdout;
If you want to ensure all prints are flushed immediately then you can set local $|=1
near the top of the script before any print statements.
from perl-dist-strawberry.
This is still an open Issue on github for anyone interested:
Perl/perl5#4106
Cheers,
Rob
from perl-dist-strawberry.
@qikdauie - good to hear you have it working now.
The underlying issue is a perl one, as noted by @sisyphus in #46 (comment) , although it is not specific to Strawberry perl.
However it is easily avoided by using lexical file handles directly rather than making changes to global file handles such as STDOUT. Lexical file handles have been available since Perl version 5.6, released more than 20 years ago. Ideally the scripts would be updated in their repo.
from perl-dist-strawberry.
Hey @shawnlaffan, thanks for such a quick response. Yes, this is the script in question.
Oh, I didn't realize that the STDOUT in this script was not the canonical STDOUT...
I've never really used Perl before, so let me digest what you're suggesting and make these changes. Again, thank you for your assistance.
from perl-dist-strawberry.
Okay I just made the changes to aesp8-ppc.pl that you suggested @shawnlaffan. The script was able to complete after the changes. One other script failed afterwards, boringssl/src/crypto/fipsmodules/modes/asm/ghashp8-pcc.pl. I applied the same changes to this script, which then passed through as well.
Both of these scripts utilize xlate pipes.
So, is this pointing towards an issue with Perl + xlate pipe + typeglob filehandles?
from perl-dist-strawberry.
Issue resolved, so closing.
from perl-dist-strawberry.
Related Issues (20)
- Latest Release Version on Web Site HOT 4
- PAR::Packer regression (works in 5.38.0.1, not in 5.38.2.2) HOT 2
- Update Perl-Dist-Strawberry on CPAN HOT 4
- LWP::Protocol::https fails to install and strawberry perl cannot be compiled HOT 15
- remove dependency on WiX when MSI output is disabled HOT 14
- DBD::mysql not installed in 5.38.2.2 HOT 1
- SP 5.38.2 fails on GitHub Actions at pl2bat HOT 9
- OpenSSL and Zlib are outdated - PoC provided for OpenSSL 3.1.5 + ZLib 1.3.1 HOT 1
- virus detected in the cc1plus.exe file HOT 4
- Perl 5.38.2.2 for 32bit? HOT 12
- Strawberry Perl vulnerability in v5.32.x.x corrected? HOT 1
- UpgradeCpanModules step is failing since commit d714298 HOT 9
- POSIX bessel functions are broken on strawberry-perl 5.39.10.1. HOT 13
- libgd has no truetype support in 5.38 HOT 2
- perl 5.40 cpan | Win32::Console::ANSI failing HOT 10
- perl 5.40 cpan | GD fails tests HOT 4
- perl 5.40 cpan | PDL::Stats fails to build HOT 3
- Malware detected : Win64:MalwareX-get [Trj] HOT 4
- Can't load Win32.xs.dll when running cpanm HOT 9
- Error checking in portableshell.bat is wrong HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perl-dist-strawberry.