Giter Site home page Giter Site logo

Comments (7)

shawnlaffan avatar shawnlaffan commented on June 29, 2024 2

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.

shawnlaffan avatar shawnlaffan commented on June 29, 2024 1

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.

sisyphus avatar sisyphus commented on June 29, 2024 1

This is still an open Issue on github for anyone interested:
Perl/perl5#4106

Cheers,
Rob

from perl-dist-strawberry.

shawnlaffan avatar shawnlaffan commented on June 29, 2024 1

@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.

qikdauie avatar qikdauie commented on June 29, 2024

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.

qikdauie avatar qikdauie commented on June 29, 2024

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.

shawnlaffan avatar shawnlaffan commented on June 29, 2024

Issue resolved, so closing.

from perl-dist-strawberry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.