New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #12429 (reopened defect)

Opened 6 years ago

Last modified 3 months ago

port cannot handle spaces in various variables

Reported by: nox@… Owned by: macports-tickets@…
Priority: High Milestone: MacPorts Future
Component: base Version: 1.7.0
Keywords: Cc: sfiera@…, ryandesign@…, and.damore@…, egall@…
Port:

Description

Here is my code (taken from libsdl_gfx-framework):

worksrcdir      "${distname}/Other Builds"

post-extract {
    system "cd ${worksrcpath} && tar -xvzf OSX-PB.tgz"
}

port output:

--->  Extracting SDL_gfx-2.0.16.tar.gz
DEBUG: setting option extract.args to /opt/local/var/macports/distfiles/libsdl_gfx/SDL_gfx-2.0.16.tar.gz
DEBUG: Environment: 
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work" && gzip -dc /opt/local/var/macports/distfiles/libsdl_gfx/SDL_gfx-2.0.16.tar.gz | /usr/bin/gnutar --no-same-owner -xf -'
DEBUG: Executing proc-post-org.macports.extract-extract-0
sh: line 1: cd: /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other: No such file or directory
Error: Target org.macports.extract returned: shell command "cd /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other Builds} && tar -xvzf OSX-PB.tgz" returned error 1
Command output: sh: line 1: cd: /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other: No such file or directory

Warning: the following items did not execute (for libsdl_gfx-framework): org.macports.extract
Error: Status 1 encountered during processing.

Attachments

Portfile (134 bytes) - added by ryandesign@… 4 years ago.

Change History

comment:1 Changed 6 years ago by sfiera@…

  • Cc sfiera@… added

Can you confirm that this is a problem with port and not just your post-extract? From what I can tell, port is enquoting the dir correctly (portutil.c:222), whereas your system command is not (it should read system "cd \"${worksrcpath}\" && tar -xvzf OSX-PB.tgz")

comment:2 Changed 6 years ago by nox@…

Look at the error: the shell command is printed, double quotes or not, the path is /opt/local/var/macports/build/_Users_N_Ox_src_MacPorts_ports_devel_libsdl_gfx-framework/work/{SDL_gfx-2.0.16/Other Builds}. These curly brackets should not be here.

comment:3 Changed 6 years ago by sfiera@…

Ah, yes, I didn't read closely enough. I know this is going to sound weird, but what happens if you remove the double quotes from the worksrcdir option? If I recall, options are lists; SDL_gfx-2.0.16/Other Builds is a two-element list but {SDL_gfx-2.0.16/Other Builds} is a one-element list as you specified.

comment:4 Changed 6 years ago by nox@…

Without quotes, only the first list item is taken into account, and the path becomes work/SDL_gfx-2.0.16/Other

comment:5 Changed 6 years ago by nox@…

  • Cc changed from nox@macports.org,sfiera@macports.org to nox@macports.org, sfiera@macports.org
  • Summary changed from port cannot handle spaces in worksrcdir to port cannot handle spaces in various variables

xcode.build.settings is also affected: The following code:

variant universal {
    xcode.build.settings-append "ARCHS=\"ppc i386\""
    xcode.destroot.settings     ${xcode.build.settings}
}

produces the following build.cmd:

xcodebuild  -target "SDL_gfx" -configuration Deployment build OBJROOT=build/ SYMROOT=build/ {ARCHS="ppc i386"}

I think this bug should be handled with High priority.

comment:6 Changed 6 years ago by nox@…

  • Priority changed from Normal to High

xcode.project produces garbage too.

comment:7 Changed 5 years ago by nox@…

  • Cc nox@… removed
  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone MacPorts base bugs deleted

Let's close this one. It's way too old and I don't even remember what I was talking about.

comment:8 Changed 5 years ago by ryandesign@…

  • Cc ryandesign@… added
  • Status changed from closed to reopened
  • Version set to 1.7.0
  • Resolution invalid deleted
  • Milestone set to MacPorts base bugs

It's still an issue with trunk @37836. I can still reproduce the problem in comment 5.

comment:9 Changed 4 years ago by toby@…

  • Milestone changed from MacPorts base bugs to MacPorts Future

Milestone MacPorts base bugs deleted

comment:10 follow-up: ↓ 11 Changed 4 years ago by giorgio_v@…

Is this bug still reproducible with the 1.8 release? I’ve tried to install the libsdl_gfx-framework but I haven’t seen any issue (but the portfile seems changed since the ticket was opened).

comment:11 in reply to: ↑ 10 Changed 4 years ago by ryandesign@…

Replying to giorgio_v@…:

Is this bug still reproducible with the 1.8 release?

Yes. Take this minimal portfile:

$ port fetch
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
Portfile changed since last build; discarding previous state.
--->  Computing dependencies for foo
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
--->  Fetching foo
Error: Target org.macports.fetch returned: /mp/var/macports/build/_private_tmp/work/{foo-1.0/Path with spaces}
Error: Status 1 encountered during processing.

There should not be curly brackets around the worksrcdir in the message.

Changed 4 years ago by ryandesign@…

comment:12 Changed 3 years ago by and.damore@…

  • Cc and.damore@… added

Cc Me!

comment:13 Changed 3 years ago by and.damore@…

It's still reproducible with 1.9, r73232.

comment:14 Changed 3 months ago by egall@…

  • Cc egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.