FS#17175 - makepkg to remove src/ before building
Attached to Project:
Pacman
Opened by Phillip Smith (fukawi2) - Tuesday, 17 November 2009, 09:31 GMT
Last edited by Allan McRae (Allan) - Tuesday, 15 October 2013, 04:26 GMT
Opened by Phillip Smith (fukawi2) - Tuesday, 17 November 2009, 09:31 GMT
Last edited by Allan McRae (Allan) - Tuesday, 15 October 2013, 04:26 GMT
|
Details
When makepkg is called, can it please remove the src/ dir
the same way it removes the pkg/ dir when the -R flag is
used?
I've lost count of the amount of times I've had a build fail (especially with big packages like gcc, glibc and kernels) for one reason or another, fixed the PKGBUILD then had the build fail again because I forgot to remove the src/ dir and it's trying to compile an inconsistent source. Removing the src/ dir and starting the build a 3rd time works fine. I understand why it doesn't (eg, for use with the -o flag) so perhaps a config option in /etc/makepkg.conf so users can select. I have builds fail due to this problem more often than I want to use the -o flag to manually change something before building (IMHO it should be done in the PKGBUILD anyway if you want to do that!) |
This task depends upon
Closed by Allan McRae (Allan)
Tuesday, 15 October 2013, 04:26 GMT
Reason for closing: Implemented
Additional comments about closing: makepkg -C/--cleanbuild
commit 043f250d
Tuesday, 15 October 2013, 04:26 GMT
Reason for closing: Implemented
Additional comments about closing: makepkg -C/--cleanbuild
commit 043f250d
However, I agree with Dan that automatically deleting that folder is probably not the best approach. I need to think about this some more.
-1
Anyway, I would also highly dislike src/ being removed, no matter when. I would actually like to investigate how to re-use a current src/ build more easily and safely. This is probably in line with Dan comments, trying to make pkgbuilds as reentrant as possible.
Anyway, as long as the removal of src/ is not enabled by default, we cannot complain.
I'd be happy with a non-default option on makepkg.conf or a command line switch that I can alias since I seem to be the minority here....
Anyway, maybe this fits into the whole VCS package overhaul we have been talking about where we make better use of the prebuilt stuff in $srcdir instead of just deleting it all...
Sometimes, we need to apply a patch which would create a new file or rename an existing file, if we do not prune the exsiting src directory before the extraction and just overwrite the one in the src tarball, these newly created files by the patch applied in the previous building would cause the current patch failed to apply.
For a none vcs package, it is better remove the existing src directory before building, or at less the src tarball destination if it exists.
For a vcs package, the vcs-build directory need to be recreated before the building process.
I've had several problems with packages that had the same name directory
If prepare() is happening after the source extraction (and skipped is source extraction doesn't happen), then how can it 'clean' src/?
That does seem a little backwards; almost "easter egg" like.