Ticket #930 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

build fails when sandbox path contains whitespace

Reported by: duncand Owned by: coke
Priority: major Milestone:
Component: configure Version: 1.4.0
Severity: high Keywords: build configure fail path space whitespace makefile
Cc: Language: perl6
Patch status: new Platform: all

Description

Parrot's build configuration that generates the Makefile has a bug in it regarding handling of situations where the path of the Parrot source code or build directories have whitespace in directory names. The generated Makefile doesn't have properly escaped file paths, such as in these variable declarations: BUILD_DIR, LDFLAGS, ALL_PARROT_LIBS, etc.

An example Makefile line:

BUILD_DIR := /Volumes/Documents/Documents/Muldis floss projects/git_working_dirs/rakudo/parrot

This causes 'make' to fail citing nonexistent directories and files.

What needs to happen is that the whitespace in the paths needs to be escaped, perhaps as \<space> or with quoting the path. AFAIK, Perl's make process does this correctly.

To reproduce, simply have your Parrot checkout in some directory where a parent directory contains whitespace and then run Configure.pl, and then run 'make'. This problem seems platform agnostic. My own test is Mac OS X, but from a brief #parrot chat, the bug was confirmed by mikehh, on some other Unix-like OS.

This bug is a very common edge case in programming, which is neglecting to remember escaping of filenames that might have whitespace.

Attachments

nofreakychars.diff Download (0.8 KB) - added by dukeleto 5 years ago.
chromatic's diff for fixing the "spaces in the build dir" issue

Change History

  Changed 5 years ago by duncand

Actually, the bug was in trunk, but 1.4.0 is probably afflicted also.

  Changed 5 years ago by duncand

Alternately, if the actual problem can't be fixed in time for 1.5.0, then at least the Configure.pl should be updated to emit a warning that it doesn't currently work right if the source/build dir contains whitespace, so users know what they should change to workaround it.

  Changed 5 years ago by mikehh

Just to confirm that this is a problem.

I copied a checkout of trunk into a directory 'test parrot' with a single space.

I then did the following:

svn update (to revision 40604)
perl Configure.pl
make

make failed when trying to build miniparrot:

...
...
/usr/local/bin/perl tools/build/parrot_config_c.pl --mini > \
    src/null_config.c
src/null_config.c
cc -o miniparrot src/main.o src/null_config.o \
        -Wl,-rpath=/home/mhh/test parrot/blib/lib -L/home/mhh/test parrot/blib/lib -lparrot -lm -L/usr/lib  -licuuc -licudata -lm -lnsl -ldl -lm -lcrypt -lutil -lpthread -lgmp -lreadline  -fstack-protector -L/usr/local/lib -Wl,-E
cc: parrot/blib/lib: No such file or directory
cc: parrot/blib/lib: No such file or directory
make: *** [miniparrot] Error 1

Note that the space in 'test parrot' is not escaped and it needs to be either escaped or quoted.

I will have a look at the problem and see if I can come up with any ideas.

Changed 5 years ago by dukeleto

chromatic's diff for fixing the "spaces in the build dir" issue

  Changed 5 years ago by dukeleto

Chromatic's diff works for me when I have a build_dir which contains a space on OS X.

  Changed 5 years ago by duncand

I have now confirmed for myself that nofreakychars.diff seems to fix the problem.

Examination of the Makefile now shows all the whitespace in my path escaped, and 'make' now completes without error.

I recommend that this diff be committed to trunk so that 1.5.0 and any further testing includes it.

  Changed 5 years ago by mikehh

Problems with patch on Ubuntu 9.04 amd64.

I applied the patch to the version of parrot in 'test parrot' and it did indeed build - there is however a problem.

make test FAILs two tests - both of which I think are related to the space in the directory name:

Test Summary Report
-------------------
t/compilers/pct/complete_workflow.t       (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 54 tests but ran 0.
t/tools/dump_pbc.t                        (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=329, Tests=10015, 84 wallclock secs ( 3.90 usr  0.88 sys + 107.82 cusr 39.33 csys = 151.93 CPU)
Result: FAIL
make: *** [test_core] Error 1

mhh@mhh-desktop:~/test parrot$ prove -v t/compilers/pct/complete_workflow.t
t/compilers/pct/complete_workflow.t ..
1..54
Error in tempfile() using /home/mhh/test\ parrot/t/compilers/pct/XXXXXXXXXX.pg: Parent directory (/home/mhh/test\ parrot/t/compilers/pct/) does not exist at lib/Parrot/Test/Util.pm line 52
# Looks like your test exited with 2 before it could output anything.
Dubious, test returned 2 (wstat 512, 0x200)
Failed 54/54 subtests

Test Summary Report
-------------------
t/compilers/pct/complete_workflow.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 54 tests but ran 0.
Files=1, Tests=0,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.08 cusr  0.01 csys =  0.13 CPU)
Result: FAIL

mhh@mhh-desktop:~/test parrot$ prove -v t/tools/dump_pbc.t
t/tools/dump_pbc.t ..
1..1
Can't find disassembler '/home/mhh/test\ parrot/pbc_disassemble';did you remember to make parrot first?
not ok 1 - 01_temp_var.pir

#   Failed test '01_temp_var.pir'
#   at t/tools/dump_pbc.t line 40.
#                   ''
#     doesn't match '(?-xism:\=head1\ Simple\ Variables)'
# Looks like you failed 1 test of 1.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests

Test Summary Report
-------------------
t/tools/dump_pbc.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.09 cusr  0.03 csys =  0.13 CPU)
Result: FAIL

I think further investigation is needed.

  Changed 5 years ago by whiteknight

  • milestone 1.5 deleted

  Changed 4 years ago by coke

  • lang set to perl6

This is impacting rakudo developers.

  Changed 4 years ago by coke

  • owner set to coke

  Changed 4 years ago by coke

  • owner coke deleted

  Changed 4 years ago by jkeenan

What is probably the same issue has been reported more recently as TT #1716.

TT #1717, where the issue is non-ascii characters in paths rather than whitespace, may also be related.

kid51

  Changed 4 years ago by whiteknight

  • owner set to whiteknight

follow-up: ↓ 14   Changed 4 years ago by coke

  • owner changed from whiteknight to coke

in reply to: ↑ 13 ; follow-up: ↓ 15   Changed 4 years ago by jkeenan

Replying to coke: Coke:

Were the issues in this ticket resolved when we closed TT #1716 and TT #1717?

Thanks.

kid51

in reply to: ↑ 14   Changed 4 years ago by coke

  • status changed from new to closed
  • resolution set to fixed

Replying to jkeenan:

Replying to coke: Coke: Were the issues in this ticket resolved when we closed TT #1716 and TT #1717? Thanks. kid51

Looks like. Closing ticket.

Note: See TracTickets for help on using tickets.