From 7f15d1b072ffecc7d5fde202b3faf0cdbb42430e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20B=C3=B6ker?= Date: Mon, 6 Nov 2023 20:46:39 +0100 Subject: [PATCH] Add static OBS project files to the repo --- misc/OBS-setup/moarvm/moarvm-segfault.diff | 13 + misc/OBS-setup/moarvm/moarvm.spec | 97 ++++ misc/OBS-setup/moarvm/reproducible.patch | 17 + misc/OBS-setup/nqp-moarvm/nqp-moarvm.spec | 64 +++ misc/OBS-setup/nqp-moarvm/nqp-test-log.diff | 469 ++++++++++++++++++ misc/OBS-setup/rakudo-moarvm/_constraints | 8 + .../rakudo-moarvm/rakudo-moarvm.spec | 79 +++ .../rakudo-moarvm/rakudo-test-log.diff | 469 ++++++++++++++++++ 8 files changed, 1216 insertions(+) create mode 100644 misc/OBS-setup/moarvm/moarvm-segfault.diff create mode 100644 misc/OBS-setup/moarvm/moarvm.spec create mode 100644 misc/OBS-setup/moarvm/reproducible.patch create mode 100644 misc/OBS-setup/nqp-moarvm/nqp-moarvm.spec create mode 100644 misc/OBS-setup/nqp-moarvm/nqp-test-log.diff create mode 100644 misc/OBS-setup/rakudo-moarvm/_constraints create mode 100644 misc/OBS-setup/rakudo-moarvm/rakudo-moarvm.spec create mode 100644 misc/OBS-setup/rakudo-moarvm/rakudo-test-log.diff diff --git a/misc/OBS-setup/moarvm/moarvm-segfault.diff b/misc/OBS-setup/moarvm/moarvm-segfault.diff new file mode 100644 index 0000000..68aea11 --- /dev/null +++ b/misc/OBS-setup/moarvm/moarvm-segfault.diff @@ -0,0 +1,13 @@ +diff --git a/build/setup.pm b/build/setup.pm +index 40c0ada5b..de2fbc061 100644 +--- a/build/setup.pm ++++ b/build/setup.pm +@@ -532,7 +532,7 @@ my %OS_AIX = ( + my %OS_LINUX = ( + %OS_POSIX, + +- syslibs => [ @{$OS_POSIX{syslibs}}, qw( rt dl ) ], ++ syslibs => [ @{$OS_POSIX{syslibs}}, qw( rt dl SegFault ) ], + + -thirdparty => { + uv => { %TP_UVDUMMY, objects => '$(UV_LINUX)' }, diff --git a/misc/OBS-setup/moarvm/moarvm.spec b/misc/OBS-setup/moarvm/moarvm.spec new file mode 100644 index 0000000..015508d --- /dev/null +++ b/misc/OBS-setup/moarvm/moarvm.spec @@ -0,0 +1,97 @@ +# +# spec file for package moarvm +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%global moar_rev 388924D67C75569C85DAD83A1772F98D32525FA9_D397598A16ACA9AA7C62513B7FA9411E0820C394_3AE8A31C168A08430BB8764A25CEAFAB3B98F172 + +Name: moarvm +Version: %moar_rev +Release: 2.1 +Summary: A virtual machine built especially for Rakudo +License: Artistic-2.0 +Group: Development/Libraries/Other +URL: http://moarvm.org +Source: http://raku-ci.org/test/12345/%{moar_rev}-moar.tar.xz +# PATCH-FIX-OPENSUSE boo#1100677 +Patch0: reproducible.patch +BuildRequires: perl(ExtUtils::Command) +BuildRequires: pkgconfig(libffi) +%if 0%{?suse_version} >= 1550 +BuildRequires: pkgconfig(libtommath) +BuildRequires: pkgconfig(libuv) +%endif +%if !0%{?rhel_version} +BuildRequires: pkgconfig(libzstd) +%endif + +%description +MoarVM (short for Metamodel On A Runtime Virtual Machine) is a runtime built +for the 6model object system. It is primarily aimed at running NQP and Rakudo, +but should be able to serve as a backend for any compilers built using +the NQP compiler toolchain. + +%package devel +Summary: MoarVM development headers and libraries +Group: Development/Libraries/Other +Requires: %{name} = %{version} +Requires: pkgconfig(libffi) +%if 0%{?suse_version} >= 1550 +Requires: pkgconfig(libtommath) +Requires: pkgconfig(libuv) +%endif +%if !0%{?rhel_version} +Requires: pkgconfig(libzstd) +%endif + +%description devel +MoarVM (Metamodel On A Runtime) development headers. + +%prep +%setup -q -n %{moar_rev}-moar +%patch0 -p1 + +%build +extra_config_args= +%if 0%{?suse_version} >= 1550 +extra_config_args+=" --has-libtommath --has-libuv" +%endif +%ifarch riscv64 +extra_config_args+=" --c11-atomics" +%endif +CFLAGS="%{optflags}" \ +perl Configure.pl --prefix=%{_usr} --libdir=%{_libdir} --debug --optimize=3 --has-libffi $extra_config_args +make NOISY=1 %{?_smp_mflags} + +%install +%make_install +find %buildroot -type f \( -name '*.so' -o -name '*.so.*' \) -exec chmod 755 {} + +mkdir -p $RPM_BUILD_ROOT/%{_libdir}/moar/share + +%files +%defattr(-,root,root) +%doc CREDITS Artistic2.txt docs +%license LICENSE +%{_bindir}/moar +%{_libdir}/libmoar* +%{_libdir}/moar +%{_datadir}/nqp + +%files devel +%defattr(-,root,root) +%{_includedir}/* +%{_datadir}/pkgconfig/* + +%changelog diff --git a/misc/OBS-setup/moarvm/reproducible.patch b/misc/OBS-setup/moarvm/reproducible.patch new file mode 100644 index 0000000..9f2035e --- /dev/null +++ b/misc/OBS-setup/moarvm/reproducible.patch @@ -0,0 +1,17 @@ +diff --git a/build/probe.pm b/build/probe.pm +index 7c81e1a6f..8e94a592e 100644 +--- a/build/probe.pm ++++ b/build/probe.pm +@@ -1022,12 +1022,6 @@ sub rdtscp { + #endif + + int main(int argc, char **argv) { +- unsigned int _tsc_aux; +- unsigned int tscValue; +- tscValue = __rdtscp(&_tsc_aux); +- +- if (tscValue > 1) +- return EXIT_SUCCESS; + return EXIT_FAILURE; + } + EOT diff --git a/misc/OBS-setup/nqp-moarvm/nqp-moarvm.spec b/misc/OBS-setup/nqp-moarvm/nqp-moarvm.spec new file mode 100644 index 0000000..c44a99f --- /dev/null +++ b/misc/OBS-setup/nqp-moarvm/nqp-moarvm.spec @@ -0,0 +1,64 @@ +# +# spec file for package nqp-moarvm +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%global nqp_rev 388924D67C75569C85DAD83A1772F98D32525FA9_D397598A16ACA9AA7C62513B7FA9411E0820C394_3AE8A31C168A08430BB8764A25CEAFAB3B98F172 +%global moar_rev 388924D67C75569C85DAD83A1772F98D32525FA9_D397598A16ACA9AA7C62513B7FA9411E0820C394_3AE8A31C168A08430BB8764A25CEAFAB3B98F172 + +Name: nqp-moarvm +Version: %nqp_rev +Release: 1.1 +Summary: NQP +License: Artistic-2.0 +Group: Development/Languages/Other +URL: https://github.com/Raku/nqp/ +Source: http://raku-ci.org/test/12345/%{version}-nqp.tar.xz +Patch0: nqp-test-log.diff +BuildRequires: moarvm-devel = %moar_rev +BuildRequires: perl(YAML::Tiny) +Requires: moarvm = %moar_rev +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%ifarch s390x +BuildRequires: libffi-devel +%endif + +%description +This is "Not Quite Perl" -- a compiler for a subset of Raku used +to implement the full Rakudo compiler. This package provides NQP running +on the MoarVM virtual machine. + +%prep +%setup -q -n %{nqp_rev}-nqp +%patch0 -p1 + +%build +perl Configure.pl --backends=moar --prefix=%{_usr} --with-moar=/usr/bin/moar --ignore-errors +make + +%check +make test + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc CREDITS +%license LICENSE +%{_bindir}/* +%{_datadir}/nqp + +%changelog diff --git a/misc/OBS-setup/nqp-moarvm/nqp-test-log.diff b/misc/OBS-setup/nqp-moarvm/nqp-test-log.diff new file mode 100644 index 0000000..6b447c9 --- /dev/null +++ b/misc/OBS-setup/nqp-moarvm/nqp-test-log.diff @@ -0,0 +1,469 @@ +diff --git a/tools/templates/Makefile-backend-common.in b/tools/templates/Makefile-backend-common.in +index 085ad3c64..6558d0f30 100644 +--- a/tools/templates/Makefile-backend-common.in ++++ b/tools/templates/Makefile-backend-common.in +@@ -171,7 +171,7 @@ + ## testing + + @backend_prefix@-test: @backend_prefix@-all +- $(PROVE) -r --exec @q(@bpm(BUILD_RUNNER_BIN)@)@ @nfpl(t/nqp t/hll t/qregex t/p5regex t/qast t/@backend@ t/serialization t/nativecall)@ @bpm(EXTRA_TESTS)@ ++ PERL5LIB=lib5 $(PROVE) --archive=make-test.tar -r --exec @q(@bpm(BUILD_RUNNER_BIN)@)@ @nfpl(t/nqp t/hll t/qregex t/p5regex t/qast t/@backend@ t/serialization t/nativecall)@ @bpm(EXTRA_TESTS)@ || { mkdir results && cd results && tar xf ../make-test.tar && find . -type f -exec echo '{}' \; -exec cat '{}' \; ; false ; } + + @backend_prefix@-test-loud: @backend_prefix@-all + $(PROVE) -r -v --exec @q(@bpm(BUILD_RUNNER_BIN)@)@ @nfpl(t/nqp t/hll t/qregex t/p5regex t/qast t/@backend@ t/serialization t/nativecall)@ @bpm(EXTRA_TESTS)@ +diff --git a/lib5/TAP/Harness/Archive.pm b/lib5/TAP/Harness/Archive.pm +new file mode 100644 +index 000000000..23810ba2d +--- /dev/null ++++ b/lib5/TAP/Harness/Archive.pm +@@ -0,0 +1,450 @@ ++package TAP::Harness::Archive; ++use warnings; ++use strict; ++use base 'TAP::Harness'; ++use Cwd (); ++use File::Basename (); ++use File::Temp (); ++use File::Spec (); ++use File::Path (); ++use File::Find (); ++use Archive::Tar (); ++use TAP::Parser (); ++use YAML::Tiny (); ++use TAP::Parser::Aggregator (); ++ ++=head1 NAME ++ ++TAP::Harness::Archive - Create an archive of TAP test results ++ ++=cut ++ ++our $VERSION = '0.18'; ++ ++=head1 SYNOPSIS ++ ++ use TAP::Harness::Archive; ++ my $harness = TAP::Harness::Archive->new(\%args); ++ $harness->runtests(@tests); ++ ++=head1 DESCRIPTION ++ ++This module is a direct subclass of L and behaves ++in exactly the same way except for one detail. In addition to ++outputting a running progress of the tests and an ending summary ++it can also capture all of the raw TAP from the individual test ++files or streams into an archive file (C<.tar> or C<.tar.gz>). ++ ++=head1 METHODS ++ ++All methods are exactly the same as our base L except ++for the following. ++ ++=head2 new ++ ++In addition to the options that L allow to this method, ++we also allow the following: ++ ++=over ++ ++=item archive ++ ++This is the name of the archive file to generate. We use L ++in the background so we only support C<.tar> and C<.tar.gz> archive file ++formats. This can optionally be an existing directory that will have ++the TAP archive's contents deposited therein without any file archiving ++(no L involved). ++ ++=item extra_files ++ ++This is an array reference to extra files that you want to include in the TAP ++archive but which are not TAP files themselves. This is useful if you want to ++include some log files that contain useful information about the test run. ++ ++=item extra_properties ++ ++This is a hash reference of extra properties that you've collected during your ++test run. Some things you might want to include are the Perl version, the system's ++architecture, the operating system, etc. ++ ++=back ++ ++=cut ++ ++my (%ARCHIVE_TYPES, @ARCHIVE_EXTENSIONS); ++BEGIN { ++ %ARCHIVE_TYPES = ( ++ 'tar' => 'tar', ++ 'tar.gz' => 'tar.gz', ++ 'tgz' => 'tar.gz', ++ ); ++ @ARCHIVE_EXTENSIONS = map { ".$_" } keys %ARCHIVE_TYPES; ++} ++ ++sub new { ++ my ($class, $args) = @_; ++ $args ||= {}; ++ ++ # these can't be passed on to Test::Harness ++ my $archive = delete $args->{archive}; ++ my $extra_files = delete $args->{extra_files}; ++ my $extra_props = delete $args->{extra_properties}; ++ ++ $class->_croak("You must provide the name of the archive to create!") ++ unless $archive; ++ ++ my $self = $class->SUPER::new($args); ++ ++ my $is_directory = -d $archive ? 1 : 0; ++ if ($is_directory) { ++ $self->{__archive_is_directory} = $is_directory; ++ $self->{__archive_tempdir} = $archive; ++ } else { ++ my $format = $class->_get_archive_format_from_filename($archive); ++ ++ # if it's not a format we understand, or it's not a directory ++ $class->_croak("Archive is not a known format type!") ++ unless $format && $ARCHIVE_TYPES{$format}; ++ ++ $self->{__archive_file} = $archive; ++ $self->{__archive_format} = $format; ++ $self->{__archive_tempdir} = File::Temp::tempdir(); ++ } ++ ++ # handle any extra files ++ if($extra_files) { ++ ref $extra_files eq 'ARRAY' ++ or $class->_croak("extra_files must be an array reference!"); ++ foreach my $file (@$extra_files) { ++ $class->_croak("extra_file $file does not exist!") unless -e $file; ++ $class->_croak("extra_file $file is not readable!") unless -r $file; ++ } ++ $self->{__archive_extra_files} = $extra_files; ++ } ++ ++ if($extra_props) { ++ ref $extra_props eq 'HASH' ++ or $class->_croak("extra_properties must be a hash reference!"); ++ $self->{__archive_extra_props} = $extra_props; ++ } ++ ++ return $self; ++} ++ ++sub _get_archive_format_from_filename { ++ my ($self, $filename) = @_; ++ ++ # try to guess it if we don't have one ++ my (undef, undef, $suffix) = File::Basename::fileparse($filename, @ARCHIVE_EXTENSIONS); ++ $suffix =~ s/^\.//; ++ return $ARCHIVE_TYPES{$suffix}; ++} ++ ++=head2 runtests ++ ++Takes the same arguments as L's version and returns the ++same thing (a L object). The only difference ++is that in addition to the normal test running and progress output ++we also create the TAP Archive when it's all done. ++ ++=cut ++ ++sub runtests { ++ my ($self, @files) = @_; ++ ++ # tell TAP::Harness to put the raw tap someplace we can find it later ++ my $dir = $self->{__archive_tempdir}; ++ $ENV{PERL_TEST_HARNESS_DUMP_TAP} = $dir; ++ ++ # get some meta information about this run ++ my %meta = ( ++ file_order => \@files, ++ start_time => time(), ++ ); ++ ++ my $aggregator = $self->SUPER::runtests(@files); ++ ++ $meta{stop_time} = time(); ++ ++ my @parsers = $aggregator->parsers; ++ for ( my $i = 0; $i < @parsers; $i++ ) { ++ $parsers[ $i ] = { ++ start_time => $parsers[ $i ]->start_time, ++ end_time => $parsers[ $i ]->end_time, ++ description => $files[ $i ], ++ }; ++ } ++ $meta{file_attributes} = \@parsers; ++ ++ my $cwd = Cwd::getcwd(); ++ my $is_dir = $self->{__archive_is_directory}; ++ my ($archive, $output_file); ++ if( $is_dir ) { ++ $output_file = $self->{__archive_tempdir}; ++ } else { ++ $output_file = $self->{__archive_file}; ++ ++ # go into the dir so that we can reference files ++ # relatively and put them in the archive that way ++ chdir($dir) or $self->_croak("Could not change to directory $dir: $!"); ++ ++ unless (File::Spec->file_name_is_absolute($output_file)) { ++ $output_file = File::Spec->catfile($cwd, $output_file); ++ } ++ ++ # create the archive ++ $archive = Archive::Tar->new(); ++ $archive->add_files($self->_get_all_tap_files); ++ chdir($cwd) or $self->_croak("Could not return to directory $cwd: $!"); ++ } ++ ++ # add in any extra files ++ if(my $x_files = $self->{__archive_extra_files}) { ++ my @rel_x_files; ++ foreach my $x_file (@$x_files) { ++ # handle both relative and absolute file names ++ my $rel_file; ++ if( File::Spec->file_name_is_absolute($x_file) ) { ++ $rel_file = File::Spec->abs2rel($x_file, $cwd); ++ } else { ++ $rel_file = $x_file; ++ } ++ push(@rel_x_files, $rel_file); ++ } ++ $archive->add_files(@rel_x_files) unless $is_dir; ++ $meta{extra_files} = \@rel_x_files; ++ } ++ ++ # add any extra_properties to the meta ++ if(my $extra_props = $self->{__archive_extra_props}) { ++ $meta{extra_properties} = $extra_props; ++ } ++ ++ # create the YAML meta file ++ my $yaml = YAML::Tiny->new(); ++ $yaml->[0] = \%meta; ++ if( $is_dir ) { ++ my $meta_file = File::Spec->catfile($output_file, 'meta.yml'); ++ open(my $out, '>', $meta_file) or die "Could not create meta.yml: $!"; ++ print $out $yaml->write_string; ++ close($out); ++ } else { ++ $archive->add_data('meta.yml', $yaml->write_string); ++ $archive->write($output_file, $self->{__archive_format} eq 'tar.gz') or die $archive->error; ++ # be nice and clean up ++ File::Path::rmtree($dir); ++ } ++ ++ print "\nTAP Archive created at $output_file\n" unless $self->verbosity < -1; ++ ++ return $aggregator; ++} ++ ++sub _get_all_tap_files { ++ my ($self, $dir, $meta) = @_; ++ $dir ||= $self->{__archive_tempdir}; ++ my @files; ++ my %x_files; ++ if($meta && $meta->{extra_files}) { ++ %x_files = map { $_ => 1 } @{$meta->{extra_files}}; ++ } ++ ++ File::Find::find( ++ { ++ no_chdir => 1, ++ wanted => sub { ++ return if /^\./; ++ return if -d; ++ my $rel_name = File::Spec->abs2rel($_, $dir); ++ return if $rel_name eq 'meta.yml'; ++ push(@files, $rel_name) unless $x_files{$rel_name}; ++ }, ++ }, ++ $dir ++ ); ++ return @files; ++} ++ ++=head2 aggregator_from_archive ++ ++This class method will return a L object ++when given a TAP Archive to open and parse. It's pretty much the reverse ++of creating a TAP Archive from using C and C. ++ ++It takes a hash of arguments which are as follows: ++ ++=over ++ ++=item archive ++ ++The path to the archive file. This can also be a directory if you created ++the archive as a directory. This is required. ++ ++=item parser_callbacks ++ ++This is a hash ref containing callbacks for the L objects ++that are created while parsing the TAP files. See the L ++documentation for details about these callbacks. ++ ++=item made_parser_callback ++ ++This callback is executed every time a new L object ++is created. It will be passed the new parser object, the name ++of the file to be parsed, and also the full (temporary) path of that file. ++ ++=item meta_yaml_callback ++ ++This is a subroutine that will be called if we find and parse a YAML ++file containing meta information about the test run in the archive. ++The structure of the YAML file will be passed in as an argument. ++ ++=back ++ ++ my $aggregator = TAP::Harness::Archive->aggregator_from_archive( ++ { ++ archive => 'my_tests.tar.gz', ++ parser_callbacks => { ++ plan => sub { warn "Nice to see you plan ahead..." }, ++ unknown => sub { warn "Your TAP is bad!" }, ++ }, ++ made_parser_callback => sub { ++ my ($parser, $file, $full_path) = @_; ++ warn "$file is temporarily located at $full_path\n"; ++ } ++ ++ } ++ ); ++ ++=cut ++ ++sub aggregator_from_archive { ++ my ($class, $args) = @_; ++ my $meta; ++ ++ my $file = Cwd::abs_path( $args->{archive} ) ++ or $class->_croak("You must provide the path to the archive!"); ++ ++ my $is_directory = -d $file; ++ ++ # extract the files out into a temporary directory ++ my $dir = $is_directory ? $file : File::Temp::tempdir(); ++ my $cwd = Cwd::getcwd(); ++ chdir($dir) or $class->_croak("Could not change to directory $dir: $!"); ++ my @files; ++ ++ Archive::Tar->new()->extract_archive($file) unless $is_directory; ++ my @tap_files; ++ ++ # do we have a meta.yml file in the archive? ++ my $yaml_file = File::Spec->catfile($dir, 'meta.yml'); ++ if( -e $yaml_file) { ++ ++ # parse it into a structure ++ if ($YAML::Tiny::VERSION < 1.57) { ++ $meta = YAML::Tiny->new()->read($yaml_file); ++ die "Could not read YAML $yaml_file: " . YAML::Tiny->errstr if YAML::Tiny->errstr; ++ } else { ++ $meta = eval { ++ YAML::Tiny->new()->read($yaml_file); ++ }; ++ if ($@) { ++ die "Could not read YAML $yaml_file: ".$@; ++ } ++ } ++ ++ if($args->{meta_yaml_callback}) { ++ $args->{meta_yaml_callback}->($meta); ++ } ++ $meta = $meta->[0]; ++ ++ if($meta->{file_order} && ref $meta->{file_order} eq 'ARRAY') { ++ foreach my $file (@{$meta->{file_order}}) { ++ push(@tap_files, $file) if -e $file; ++ } ++ } ++ } ++ ++ # if we didn't get the files from the YAML file, just find them all ++ unless(@tap_files) { ++ @tap_files = $class->_get_all_tap_files($dir, $meta); ++ } ++ ++ # now create the aggregator ++ my $aggregator = TAP::Parser::Aggregator->new(); ++ foreach my $tap_file (@tap_files) { ++ open(my $fh, $tap_file) or die "Could not open $tap_file for reading: $!"; ++ my $parser = TAP::Parser->new({source => $fh, callbacks => $args->{parser_callbacks}}); ++ if($args->{made_parser_callback}) { ++ $args->{made_parser_callback}->($parser, $tap_file, File::Spec->catfile($dir, $tap_file)); ++ } ++ $parser->run; ++ $aggregator->add($tap_file, $parser); ++ } ++ ++ # be nice and clean up ++ chdir($cwd) or $class->_croak("Could not return to directory $cwd: $!"); ++ File::Path::rmtree($dir) unless $is_directory; ++ ++ return $aggregator; ++} ++ ++=head1 AUTHOR ++ ++Michael Peters, C<< >> ++ ++=head1 BUGS ++ ++Please report any bugs or feature requests to ++C, or through the web interface at ++L. ++I will be notified, and then you'll automatically be notified of progress on ++your bug as I make changes. ++ ++=head1 SUPPORT ++ ++You can find documentation for this module with the perldoc command. ++ ++ perldoc TAP::Harness::Archive ++ ++You can also look for information at: ++ ++=over 4 ++ ++=item * AnnoCPAN: Annotated CPAN documentation ++ ++L ++ ++=item * CPAN Ratings ++ ++L ++ ++=item * RT: CPAN's request tracker ++ ++L ++ ++=item * Search CPAN ++ ++L ++ ++=back ++ ++=head1 ACKNOWLEDGEMENTS ++ ++=over ++ ++=item * A big thanks to Plus Three, LP (L) for sponsoring my work on this module and other open source pursuits. ++ ++=item * Andy Armstrong ++ ++=back ++ ++=head1 COPYRIGHT & LICENSE ++ ++Copyright 2007 Michael Peters, all rights reserved. ++ ++This program is free software; you can redistribute it and/or modify it ++under the same terms as Perl itself. ++ ++=cut ++ ++1; # End of TAP::Harness::Archive diff --git a/misc/OBS-setup/rakudo-moarvm/_constraints b/misc/OBS-setup/rakudo-moarvm/_constraints new file mode 100644 index 0000000..f648c3d --- /dev/null +++ b/misc/OBS-setup/rakudo-moarvm/_constraints @@ -0,0 +1,8 @@ + + + + + 1500 + + + diff --git a/misc/OBS-setup/rakudo-moarvm/rakudo-moarvm.spec b/misc/OBS-setup/rakudo-moarvm/rakudo-moarvm.spec new file mode 100644 index 0000000..b322887 --- /dev/null +++ b/misc/OBS-setup/rakudo-moarvm/rakudo-moarvm.spec @@ -0,0 +1,79 @@ +# +# spec file for package rakudo-moarvm +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%global rakudo_rev 388924D67C75569C85DAD83A1772F98D32525FA9_D397598A16ACA9AA7C62513B7FA9411E0820C394_3AE8A31C168A08430BB8764A25CEAFAB3B98F172 +%global nqp_rev 388924D67C75569C85DAD83A1772F98D32525FA9_D397598A16ACA9AA7C62513B7FA9411E0820C394_3AE8A31C168A08430BB8764A25CEAFAB3B98F172 +%global moar_rev 388924D67C75569C85DAD83A1772F98D32525FA9_D397598A16ACA9AA7C62513B7FA9411E0820C394_3AE8A31C168A08430BB8764A25CEAFAB3B98F172 + +Name: rakudo-moarvm +Version: %rakudo_rev +Release: 2.1 +Summary: Raku implementation running on MoarVM +License: Artistic-2.0 +Group: Development/Languages/Other +URL: http://rakudo.org/ +Source0: http://raku-ci.org/test/12345/%{version}-rakudo.tar.xz +Patch0: rakudo-test-log.diff +BuildRequires: fdupes +BuildRequires: moarvm-devel = %moar_rev +BuildRequires: nqp-moarvm = %nqp_rev +BuildRequires: perl(YAML::Tiny) +BuildRequires: curl +Provides: raku = %{version} +Requires: nqp-moarvm = %nqp_rev +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%ifarch s390x +BuildRequires: libffi-devel +%endif + +%description +Rakudo is an implementation of the Raku programming language specification that +runs on the MoarVM virtual machine. + +%prep +%setup -q -n %{rakudo_rev}-rakudo +%patch0 -p1 + +%build +perl Configure.pl --prefix="%{_prefix}" --ignore-errors +make + +%check +rm t/08-performance/99-misc.t +make test + +%install +%make_install +mkdir -p "%{buildroot}/%{_datadir}/perl6/bin" +cp tools/install-dist.p6 "%{buildroot}/%{_datadir}/perl6/bin/install-perl6-dist" +chmod +x "%{buildroot}/%{_datadir}/perl6/bin/install-perl6-dist" +sed -i -e '1s:!/usr/bin/env :!/usr/bin/:' "%{buildroot}/%{_datadir}/perl6/bin"/* +rm "%{buildroot}/%{_bindir}/raku" +rm "%{buildroot}/%{_bindir}/raku-debug" +ln -s rakudo "%{buildroot}/%{_bindir}/raku" +ln -s rakudo-debug "%{buildroot}/%{_bindir}/raku-debug" +%fdupes %{buildroot}/%{_bindir} +%fdupes %{buildroot}/%{_datadir}/perl6/runtime + +%files +%defattr(-,root,root) +%doc CREDITS +%license LICENSE +%{_bindir}/* +%{_datadir}/perl6 + +%changelog diff --git a/misc/OBS-setup/rakudo-moarvm/rakudo-test-log.diff b/misc/OBS-setup/rakudo-moarvm/rakudo-test-log.diff new file mode 100644 index 0000000..009c0cb --- /dev/null +++ b/misc/OBS-setup/rakudo-moarvm/rakudo-test-log.diff @@ -0,0 +1,469 @@ +diff --git a/tools/templates/Makefile-backend-common.in b/tools/templates/Makefile-backend-common.in +index 57396c6df..0688cbe59 100644 +--- a/tools/templates/Makefile-backend-common.in ++++ b/tools/templates/Makefile-backend-common.in +@@ -145,7 +145,7 @@ + @backend_prefix@-stresstest: @backend_prefix@-stresstest@bpm(HARNESS_TYPE)@ + + @backend_prefix@-coretest5: @backend_prefix@-all +- @bpm(HARNESS5)@ $(COMMON_TEST_DIRS) @bsm(SPECIFIC_TEST_DIRS)@ ++ PERL5LIB=lib5 @bpm(HARNESS5)@ --archive=make-test.tar $(COMMON_TEST_DIRS) @bsm(SPECIFIC_TEST_DIRS)@ || { mkdir results && cd results && tar xf ../make-test.tar && find . -type f -exec echo '{}' \; -exec cat '{}' \; ; false ; } + + # Run the spectests that we know work. + @backend_prefix@-spectest5: @backend_prefix@-testable +diff --git a/lib5/TAP/Harness/Archive.pm b/lib5/TAP/Harness/Archive.pm +new file mode 100644 +index 000000000..23810ba2d +--- /dev/null ++++ b/lib5/TAP/Harness/Archive.pm +@@ -0,0 +1,450 @@ ++package TAP::Harness::Archive; ++use warnings; ++use strict; ++use base 'TAP::Harness'; ++use Cwd (); ++use File::Basename (); ++use File::Temp (); ++use File::Spec (); ++use File::Path (); ++use File::Find (); ++use Archive::Tar (); ++use TAP::Parser (); ++use YAML::Tiny (); ++use TAP::Parser::Aggregator (); ++ ++=head1 NAME ++ ++TAP::Harness::Archive - Create an archive of TAP test results ++ ++=cut ++ ++our $VERSION = '0.18'; ++ ++=head1 SYNOPSIS ++ ++ use TAP::Harness::Archive; ++ my $harness = TAP::Harness::Archive->new(\%args); ++ $harness->runtests(@tests); ++ ++=head1 DESCRIPTION ++ ++This module is a direct subclass of L and behaves ++in exactly the same way except for one detail. In addition to ++outputting a running progress of the tests and an ending summary ++it can also capture all of the raw TAP from the individual test ++files or streams into an archive file (C<.tar> or C<.tar.gz>). ++ ++=head1 METHODS ++ ++All methods are exactly the same as our base L except ++for the following. ++ ++=head2 new ++ ++In addition to the options that L allow to this method, ++we also allow the following: ++ ++=over ++ ++=item archive ++ ++This is the name of the archive file to generate. We use L ++in the background so we only support C<.tar> and C<.tar.gz> archive file ++formats. This can optionally be an existing directory that will have ++the TAP archive's contents deposited therein without any file archiving ++(no L involved). ++ ++=item extra_files ++ ++This is an array reference to extra files that you want to include in the TAP ++archive but which are not TAP files themselves. This is useful if you want to ++include some log files that contain useful information about the test run. ++ ++=item extra_properties ++ ++This is a hash reference of extra properties that you've collected during your ++test run. Some things you might want to include are the Perl version, the system's ++architecture, the operating system, etc. ++ ++=back ++ ++=cut ++ ++my (%ARCHIVE_TYPES, @ARCHIVE_EXTENSIONS); ++BEGIN { ++ %ARCHIVE_TYPES = ( ++ 'tar' => 'tar', ++ 'tar.gz' => 'tar.gz', ++ 'tgz' => 'tar.gz', ++ ); ++ @ARCHIVE_EXTENSIONS = map { ".$_" } keys %ARCHIVE_TYPES; ++} ++ ++sub new { ++ my ($class, $args) = @_; ++ $args ||= {}; ++ ++ # these can't be passed on to Test::Harness ++ my $archive = delete $args->{archive}; ++ my $extra_files = delete $args->{extra_files}; ++ my $extra_props = delete $args->{extra_properties}; ++ ++ $class->_croak("You must provide the name of the archive to create!") ++ unless $archive; ++ ++ my $self = $class->SUPER::new($args); ++ ++ my $is_directory = -d $archive ? 1 : 0; ++ if ($is_directory) { ++ $self->{__archive_is_directory} = $is_directory; ++ $self->{__archive_tempdir} = $archive; ++ } else { ++ my $format = $class->_get_archive_format_from_filename($archive); ++ ++ # if it's not a format we understand, or it's not a directory ++ $class->_croak("Archive is not a known format type!") ++ unless $format && $ARCHIVE_TYPES{$format}; ++ ++ $self->{__archive_file} = $archive; ++ $self->{__archive_format} = $format; ++ $self->{__archive_tempdir} = File::Temp::tempdir(); ++ } ++ ++ # handle any extra files ++ if($extra_files) { ++ ref $extra_files eq 'ARRAY' ++ or $class->_croak("extra_files must be an array reference!"); ++ foreach my $file (@$extra_files) { ++ $class->_croak("extra_file $file does not exist!") unless -e $file; ++ $class->_croak("extra_file $file is not readable!") unless -r $file; ++ } ++ $self->{__archive_extra_files} = $extra_files; ++ } ++ ++ if($extra_props) { ++ ref $extra_props eq 'HASH' ++ or $class->_croak("extra_properties must be a hash reference!"); ++ $self->{__archive_extra_props} = $extra_props; ++ } ++ ++ return $self; ++} ++ ++sub _get_archive_format_from_filename { ++ my ($self, $filename) = @_; ++ ++ # try to guess it if we don't have one ++ my (undef, undef, $suffix) = File::Basename::fileparse($filename, @ARCHIVE_EXTENSIONS); ++ $suffix =~ s/^\.//; ++ return $ARCHIVE_TYPES{$suffix}; ++} ++ ++=head2 runtests ++ ++Takes the same arguments as L's version and returns the ++same thing (a L object). The only difference ++is that in addition to the normal test running and progress output ++we also create the TAP Archive when it's all done. ++ ++=cut ++ ++sub runtests { ++ my ($self, @files) = @_; ++ ++ # tell TAP::Harness to put the raw tap someplace we can find it later ++ my $dir = $self->{__archive_tempdir}; ++ $ENV{PERL_TEST_HARNESS_DUMP_TAP} = $dir; ++ ++ # get some meta information about this run ++ my %meta = ( ++ file_order => \@files, ++ start_time => time(), ++ ); ++ ++ my $aggregator = $self->SUPER::runtests(@files); ++ ++ $meta{stop_time} = time(); ++ ++ my @parsers = $aggregator->parsers; ++ for ( my $i = 0; $i < @parsers; $i++ ) { ++ $parsers[ $i ] = { ++ start_time => $parsers[ $i ]->start_time, ++ end_time => $parsers[ $i ]->end_time, ++ description => $files[ $i ], ++ }; ++ } ++ $meta{file_attributes} = \@parsers; ++ ++ my $cwd = Cwd::getcwd(); ++ my $is_dir = $self->{__archive_is_directory}; ++ my ($archive, $output_file); ++ if( $is_dir ) { ++ $output_file = $self->{__archive_tempdir}; ++ } else { ++ $output_file = $self->{__archive_file}; ++ ++ # go into the dir so that we can reference files ++ # relatively and put them in the archive that way ++ chdir($dir) or $self->_croak("Could not change to directory $dir: $!"); ++ ++ unless (File::Spec->file_name_is_absolute($output_file)) { ++ $output_file = File::Spec->catfile($cwd, $output_file); ++ } ++ ++ # create the archive ++ $archive = Archive::Tar->new(); ++ $archive->add_files($self->_get_all_tap_files); ++ chdir($cwd) or $self->_croak("Could not return to directory $cwd: $!"); ++ } ++ ++ # add in any extra files ++ if(my $x_files = $self->{__archive_extra_files}) { ++ my @rel_x_files; ++ foreach my $x_file (@$x_files) { ++ # handle both relative and absolute file names ++ my $rel_file; ++ if( File::Spec->file_name_is_absolute($x_file) ) { ++ $rel_file = File::Spec->abs2rel($x_file, $cwd); ++ } else { ++ $rel_file = $x_file; ++ } ++ push(@rel_x_files, $rel_file); ++ } ++ $archive->add_files(@rel_x_files) unless $is_dir; ++ $meta{extra_files} = \@rel_x_files; ++ } ++ ++ # add any extra_properties to the meta ++ if(my $extra_props = $self->{__archive_extra_props}) { ++ $meta{extra_properties} = $extra_props; ++ } ++ ++ # create the YAML meta file ++ my $yaml = YAML::Tiny->new(); ++ $yaml->[0] = \%meta; ++ if( $is_dir ) { ++ my $meta_file = File::Spec->catfile($output_file, 'meta.yml'); ++ open(my $out, '>', $meta_file) or die "Could not create meta.yml: $!"; ++ print $out $yaml->write_string; ++ close($out); ++ } else { ++ $archive->add_data('meta.yml', $yaml->write_string); ++ $archive->write($output_file, $self->{__archive_format} eq 'tar.gz') or die $archive->error; ++ # be nice and clean up ++ File::Path::rmtree($dir); ++ } ++ ++ print "\nTAP Archive created at $output_file\n" unless $self->verbosity < -1; ++ ++ return $aggregator; ++} ++ ++sub _get_all_tap_files { ++ my ($self, $dir, $meta) = @_; ++ $dir ||= $self->{__archive_tempdir}; ++ my @files; ++ my %x_files; ++ if($meta && $meta->{extra_files}) { ++ %x_files = map { $_ => 1 } @{$meta->{extra_files}}; ++ } ++ ++ File::Find::find( ++ { ++ no_chdir => 1, ++ wanted => sub { ++ return if /^\./; ++ return if -d; ++ my $rel_name = File::Spec->abs2rel($_, $dir); ++ return if $rel_name eq 'meta.yml'; ++ push(@files, $rel_name) unless $x_files{$rel_name}; ++ }, ++ }, ++ $dir ++ ); ++ return @files; ++} ++ ++=head2 aggregator_from_archive ++ ++This class method will return a L object ++when given a TAP Archive to open and parse. It's pretty much the reverse ++of creating a TAP Archive from using C and C. ++ ++It takes a hash of arguments which are as follows: ++ ++=over ++ ++=item archive ++ ++The path to the archive file. This can also be a directory if you created ++the archive as a directory. This is required. ++ ++=item parser_callbacks ++ ++This is a hash ref containing callbacks for the L objects ++that are created while parsing the TAP files. See the L ++documentation for details about these callbacks. ++ ++=item made_parser_callback ++ ++This callback is executed every time a new L object ++is created. It will be passed the new parser object, the name ++of the file to be parsed, and also the full (temporary) path of that file. ++ ++=item meta_yaml_callback ++ ++This is a subroutine that will be called if we find and parse a YAML ++file containing meta information about the test run in the archive. ++The structure of the YAML file will be passed in as an argument. ++ ++=back ++ ++ my $aggregator = TAP::Harness::Archive->aggregator_from_archive( ++ { ++ archive => 'my_tests.tar.gz', ++ parser_callbacks => { ++ plan => sub { warn "Nice to see you plan ahead..." }, ++ unknown => sub { warn "Your TAP is bad!" }, ++ }, ++ made_parser_callback => sub { ++ my ($parser, $file, $full_path) = @_; ++ warn "$file is temporarily located at $full_path\n"; ++ } ++ ++ } ++ ); ++ ++=cut ++ ++sub aggregator_from_archive { ++ my ($class, $args) = @_; ++ my $meta; ++ ++ my $file = Cwd::abs_path( $args->{archive} ) ++ or $class->_croak("You must provide the path to the archive!"); ++ ++ my $is_directory = -d $file; ++ ++ # extract the files out into a temporary directory ++ my $dir = $is_directory ? $file : File::Temp::tempdir(); ++ my $cwd = Cwd::getcwd(); ++ chdir($dir) or $class->_croak("Could not change to directory $dir: $!"); ++ my @files; ++ ++ Archive::Tar->new()->extract_archive($file) unless $is_directory; ++ my @tap_files; ++ ++ # do we have a meta.yml file in the archive? ++ my $yaml_file = File::Spec->catfile($dir, 'meta.yml'); ++ if( -e $yaml_file) { ++ ++ # parse it into a structure ++ if ($YAML::Tiny::VERSION < 1.57) { ++ $meta = YAML::Tiny->new()->read($yaml_file); ++ die "Could not read YAML $yaml_file: " . YAML::Tiny->errstr if YAML::Tiny->errstr; ++ } else { ++ $meta = eval { ++ YAML::Tiny->new()->read($yaml_file); ++ }; ++ if ($@) { ++ die "Could not read YAML $yaml_file: ".$@; ++ } ++ } ++ ++ if($args->{meta_yaml_callback}) { ++ $args->{meta_yaml_callback}->($meta); ++ } ++ $meta = $meta->[0]; ++ ++ if($meta->{file_order} && ref $meta->{file_order} eq 'ARRAY') { ++ foreach my $file (@{$meta->{file_order}}) { ++ push(@tap_files, $file) if -e $file; ++ } ++ } ++ } ++ ++ # if we didn't get the files from the YAML file, just find them all ++ unless(@tap_files) { ++ @tap_files = $class->_get_all_tap_files($dir, $meta); ++ } ++ ++ # now create the aggregator ++ my $aggregator = TAP::Parser::Aggregator->new(); ++ foreach my $tap_file (@tap_files) { ++ open(my $fh, $tap_file) or die "Could not open $tap_file for reading: $!"; ++ my $parser = TAP::Parser->new({source => $fh, callbacks => $args->{parser_callbacks}}); ++ if($args->{made_parser_callback}) { ++ $args->{made_parser_callback}->($parser, $tap_file, File::Spec->catfile($dir, $tap_file)); ++ } ++ $parser->run; ++ $aggregator->add($tap_file, $parser); ++ } ++ ++ # be nice and clean up ++ chdir($cwd) or $class->_croak("Could not return to directory $cwd: $!"); ++ File::Path::rmtree($dir) unless $is_directory; ++ ++ return $aggregator; ++} ++ ++=head1 AUTHOR ++ ++Michael Peters, C<< >> ++ ++=head1 BUGS ++ ++Please report any bugs or feature requests to ++C, or through the web interface at ++L. ++I will be notified, and then you'll automatically be notified of progress on ++your bug as I make changes. ++ ++=head1 SUPPORT ++ ++You can find documentation for this module with the perldoc command. ++ ++ perldoc TAP::Harness::Archive ++ ++You can also look for information at: ++ ++=over 4 ++ ++=item * AnnoCPAN: Annotated CPAN documentation ++ ++L ++ ++=item * CPAN Ratings ++ ++L ++ ++=item * RT: CPAN's request tracker ++ ++L ++ ++=item * Search CPAN ++ ++L ++ ++=back ++ ++=head1 ACKNOWLEDGEMENTS ++ ++=over ++ ++=item * A big thanks to Plus Three, LP (L) for sponsoring my work on this module and other open source pursuits. ++ ++=item * Andy Armstrong ++ ++=back ++ ++=head1 COPYRIGHT & LICENSE ++ ++Copyright 2007 Michael Peters, all rights reserved. ++ ++This program is free software; you can redistribute it and/or modify it ++under the same terms as Perl itself. ++ ++=cut ++ ++1; # End of TAP::Harness::Archive