Opened 14 years ago

Last modified 7 months ago

#29093 assigned defect

changing $worksrcdir break the build when using git.fetch or hg.fetch

Reported by: ci42 Owned by: raimue (Rainer Müller)
Priority: Normal Milestone: MacPorts Future
Component: base Version: 1.9.2
Keywords: haspatch Cc: raimue (Rainer Müller), tvb377@…, cooljeanius (Eric Gallager), anddam (Andrea D'Amore)
Port:

Description

git/hg fetch the source code directly into $worksrcpath. If your port need to change the $worksrcdir (e.g. the source to be built is in a subdirectory) the build fails because $worksrcpath is defined as $workpath/$worksrcdir and the source is now in the wrong directory. See the attached portfile for an example that demostrates this behavior.

The suggested patch uses $workpath/$distname as the location for git/hg fetch.

Attachments (4)

Portfile (2.4 KB) - added by ci42 14 years ago.
use this to reproduce the bug
portfetch.tcl.diff (1.7 KB) - added by ci42 14 years ago.
suggested patch
portfetch.tcl.2.diff (1.8 KB) - added by ci42 14 years ago.
use command_exec for git.fetch
portfetch.tcl.3.diff (2.5 KB) - added by ci42 14 years ago.
use command_exec for git.fetch and hg.fetch

Download all attachments as: .zip

Change History (20)

Changed 14 years ago by ci42

Attachment: Portfile added

use this to reproduce the bug

Changed 14 years ago by ci42

Attachment: portfetch.tcl.diff added

suggested patch

comment:1 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Note that you don't need to change worksrcdir in your portfile. You could instead change configure.dir and/or build.dir, for example.

comment:2 in reply to:  1 Changed 14 years ago by ci42

Replying to ryandesign@…:

Note that you don't need to change worksrcdir in your portfile. You could instead change configure.dir and/or build.dir, for example.

I know, and for this portfile this is already fixed (see #28799). I used this as an example because I encountered this bug while developing the portfile. The problem is there anyway.

comment:3 Changed 14 years ago by raimue (Rainer Müller)

Keywords: haspatch added
Milestone: MacPorts 2.0.0

comment:4 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

I don't think there's any need to wait until 2.0.0; I don't think changing this should break any existing ports. At the same time, we can fix fetch.type svn to have the same behavior; it's always bugged me that it behaved differently.

comment:5 Changed 14 years ago by raimue (Rainer Müller)

Cc: raimue@… added

I thought we do not want to do any 1.x release anymore? Other changes on trunk are currently targeting 2.0.

comment:6 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Oh, in that case whatever. :)

comment:7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… removed
Owner: changed from macports-tickets@… to ryandesign@…
Status: newassigned

This needs to be fixed differently. hgfetch and gitfetch need to be rewritten to use command_exec (like bzrfetch, cvzfetch and svnfetch do) instead of system.

Changed 14 years ago by ci42

Attachment: portfetch.tcl.2.diff added

use command_exec for git.fetch

comment:8 in reply to:  7 Changed 14 years ago by ci42

Replying to ryandesign@…:

This needs to be fixed differently. hgfetch and gitfetch need to be rewritten to use command_exec (like bzrfetch, cvzfetch and svnfetch do) instead of system.

Please have a look at the new patch. It uses the 'command_exec' for git.fetch and fetches the source to '$workpath/$distname' like the first patch. Feedback and suggestions are welcome.

comment:9 in reply to:  7 Changed 14 years ago by ci42

Replying to ryandesign@…:

This needs to be fixed differently. hgfetch and gitfetch need to be rewritten to use command_exec (like bzrfetch, cvzfetch and svnfetch do) instead of system.

Please have a look at the latest patch. 'command_exec' is used for both git.fetch and hg.fetch. The source will also be fetched to '$workpath/$distname' like the first patch does. Feedback and suggestions are welcome.

Changed 14 years ago by ci42

Attachment: portfetch.tcl.3.diff added

use command_exec for git.fetch and hg.fetch

comment:10 Changed 13 years ago by tvb377@…

Cc: tvb377@… added

Cc Me!

comment:11 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:12 Changed 7 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts FutureMacPorts 2.5.0
Owner: changed from ryandesign to raimue

Let's check whether this is still a problem. If so, we'll consider it for 2.5.0 – maybe this is fixed with the VCS fetch caching changes.

comment:13 Changed 7 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts 2.5.0MacPorts 2.6.0

comment:14 Changed 5 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.6.0MacPorts 2.7.0

Ticket retargeted after milestone closed

comment:15 Changed 3 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.7.0MacPorts Future

Ticket retargeted after milestone closed

comment:16 Changed 7 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: anddam added

Has duplicate #45353.

Note: See TracTickets for help on using tickets.