Ticket #29093 (assigned defect)
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
Change History
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: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: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@…
- Attachment portfetch.tcl.2.diff added
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@…
- Attachment portfetch.tcl.3.diff added
use command_exec for git.fetch and hg.fetch


use this to reproduce the bug