New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #29093 (assigned defect)

Opened 4 years ago

Last modified 2 years ago

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

Reported by: ciserlohn@… Owned by: ryandesign@…
Priority: Normal Milestone: MacPorts Future
Component: base Version: 1.9.2
Keywords: haspatch Cc: raimue@…, tvb377@…, egall@…
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

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

Change History

Changed 4 years ago by ciserlohn@…

use this to reproduce the bug

Changed 4 years ago by ciserlohn@…

suggested patch

comment:1 follow-up: ↓ 2 Changed 4 years ago by 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.

comment:2 in reply to: ↑ 1 Changed 4 years ago by ciserlohn@…

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 4 years ago by raimue@…

  • Keywords haspatch added
  • Milestone set to MacPorts 2.0.0

comment:4 Changed 4 years ago by ryandesign@…

  • 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 4 years ago by raimue@…

  • 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 4 years ago by ryandesign@…

Oh, in that case whatever. :)

comment:7 follow-ups: ↓ 8 ↓ 9 Changed 4 years ago by ryandesign@…

  • Cc ryandesign@… removed
  • Owner changed from macports-tickets@… to ryandesign@…
  • Status changed from new to assigned

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 4 years ago by ciserlohn@…

use command_exec for git.fetch

comment:8 in reply to: ↑ 7 Changed 4 years ago by ciserlohn@…

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 4 years ago by ciserlohn@…

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 4 years ago by ciserlohn@…

use command_exec for git.fetch and hg.fetch

comment:10 Changed 4 years ago by tvb377@…

  • Cc tvb377@… added

Cc Me!

comment:11 Changed 2 years ago by egall@…

  • Cc egall@… added

Cc Me!

Note: See TracTickets for help on using tickets.