Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rakudo build dependency on shell/backticks and allow smoother windows (g|mingw32-)make spectest_smolder #2201

Closed
p6rt opened this issue Oct 1, 2010 · 9 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 1, 2010

Migrated from rt.perl.org#78152 (status was 'resolved')

Searchable as RT78152$

@p6rt
Copy link
Author

p6rt commented Oct 1, 2010

From @ronaldxs

  Currently make spectest_smolder relies on curl to send the smoke
report and uses backticks, which rely on a UNIXish shell, to get the
rakudo revision from git. Among other concerns, this doesn't play well
with the build process on Windows. By the time we are ready to submit a
useful report to smolder we can reasonably expect to have a basically
working version of Perl6 and Perl6 has the equivalent of shell backticks
with "qqx" and can run curl with its "run" function. The patches,
tested at this point on three different systems with Ubuntu Linux,
Windows XP with Strawberry Perl, and Windows Vista with Mingw gcc and
ActiveState perl, use Perl6 to replace the shell functionality and fixes
Configure.pl to allow the change to work properly under Windows.

The part of the fix that uses Perl6 to remove the shell dependency is in
the file build_Makefile.in.patch. The Perl6 code, however has %
symbols, which can be misinterpreted by the Windows cmd interpreter as a
sigil for environment variables. So Configure.pl, which already adjusts
the Makefile for Windows considerations has had a line added in
Configure.pl.patch to substitute % for %% just on the line with curl to
give Perl6 the right program from the command line in that environment.

Configure.pl.patch also has one more small needed change to fix an
existing Windows bug. Currently Configure.pl translates forward slashes
to back slashes on Windows. Then, currently, it translates backslashes
back to forward slashes on http URL's where backslashes won't work. But
the git/roast test URL is missed by this approach since it starts with
git​:// rather than http:// and is left with backslashes. The other fix
line of Configure.pl.patch fixes that problem.

Running "(g|mingw32-)make spectest_smolder" under Windows is still not
so easy because you need command line versions of git, curl and possibly
svn on your execution path. Many of the more obvious looking solutions
to making those command line tools available, like cygwin and some
configurations of msys git, also puts an "sh" program on your execution
path which breaks the build process. I believe I have a fix for that
problem too, but that patch will wait for another email and another day,
at least for me.

For now, AFAIK, the only working Windows configurations that allow for
make spectest_smolder are as follows​:

1) You need recent version of either Strawberry Perl or ActiveState Perl
2) If you are working with ActiveState Perl you need the Mingw gcc compiler
3) You need msys git installed and, * this is important *, you need
"\Program Files\Git\cmd" on your execution path and NOT "\Program
Files\Git\bin".
4) You need a win32 curl program that does not depend on modifying your
path in a way that puts other stuff on your path that can cause
trouble. I went to http://curl.haxx.se/download.html and downloaded the
copy of curl from here​:
http://www.paehl.com/open_source/?download=curl_721_1.zip and then a
copy of that curl.exe in the "\Program Files\Git\cmd" directory.
5) If you need a windows command line subversion then, for the moment, I
recommend slik subversion at http://www.sliksvn.com/en/download .

BTW - I don't know of a document listing the tools needed to do this
kind of build for Rakudo on Windows. Do we need to add one someplace?

Hoping this is of help,
Ron

@p6rt
Copy link
Author

p6rt commented Oct 1, 2010

From @ronaldxs

build_Makefile.in.patch
diff --git a/build/Makefile.in b/build/Makefile.in
index d8340a5..437ab2f 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -442,7 +442,7 @@ rakudo_test_run.tar.gz: testable t/spectest.data
 	- $(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/spectest.data --archive rakudo_test_run.tar.gz --parrot_revision @revision@
 
 spectest_smolder: rakudo_test_run.tar.gz
-	curl -F architecture=@cpuarch@ -F platform=@osname@ -F revision=`git log -1 --pretty=format:%H` -F report_file=@rakudo_test_run.tar.gz -F username=parrot-autobot -F password=qa_rocks http://smolder.parrot.org/app/projects/process_add_report/5
+	./perl6 -e "run qqx[git log -1 --pretty=format:%H].fmt(qq[curl -F architecture=@cpuarch@ -F platform=@osname@ -F revision=%s -F report_file=@rakudo_test_run.tar.gz -F username=parrot-autobot -F password=qa_rocks http://smolder.parrot.org/app/projects/process_add_report/5])"
 
 testable : all spectest_checkout spectest_update
 

@p6rt
Copy link
Author

p6rt commented Oct 1, 2010

From @ronaldxs

Configure.pl.patch
diff --git a/Configure.pl b/Configure.pl
index 23f986e..9562c7e 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -171,7 +171,8 @@ sub create_makefile {
     if ($^O eq 'MSWin32') {
         $maketext =~ s{/}{\\}g;
         $maketext =~ s{\\\*}{\\\\*}g;
-        $maketext =~ s{http:\S+}{ do {my $t = $&; $t =~ s'\\'/'g; $t} }eg;
+        $maketext =~ s{(?:git|http):\S+}{ do {my $t = $&; $t =~ s'\\'/'g; $t} }eg;
+        $maketext =~ s/.*curl.*/do {my $t = $&; $t =~ s'%'%%'g; $t}/meg;
     }
 
     if ($makefile_timing) {

@p6rt
Copy link
Author

p6rt commented Oct 1, 2010

From @ronaldxs

Forgot to mention ...

I had an IRC disussion about this idea here
http://irclog.perlgeek.de/perl6/2010-09-29#i_2876244. The Perl6
command line program in the patch is pretty much that recommended by
flussence in the discussion ...

@p6rt
Copy link
Author

p6rt commented Oct 1, 2010

@ronaldxs - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 2, 2010

From @moritz

Thanks for the patch, I've applied it.

I'm leaving this ticket open for now, until we've decided what to do
about the documentation.

@p6rt
Copy link
Author

p6rt commented Oct 8, 2011

From @coke

On Sat Oct 02 03​:23​:18 2010, moritz wrote​:

Thanks for the patch, I've applied it.

I'm leaving this ticket open for now, until we've decided what to do
about the documentation.

Let's either add a Windows section to the main README, or a new
README.win32.

I will happily apply such a patch!

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 26, 2013

From @coke

On Sat Oct 08 13​:47​:10 2011, coke wrote​:

On Sat Oct 02 03​:23​:18 2010, moritz wrote​:

Thanks for the patch, I've applied it.

I'm leaving this ticket open for now, until we've decided what to do
about the documentation.

Let's either add a Windows section to the main README, or a new
README.win32.

I will happily apply such a patch!

Added a section to the tail of INSTALL.txt
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 26, 2013

@coke - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 26, 2013
@p6rt p6rt added the patch label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant