`target_directory` refuses to overwrite files
The following recipe.yaml errors:
package:
name: icu
version: "75.1"
source:
- url: https://github.com/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-src.tgz
sha256: cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef
patches:
# Omit lib prefix on libraries.
- if: osx
then: mach-port-t.patch
- url: https://github.com/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-data.zip
sha256: a5104212dc317a64f9b035723ea706f2f4fd5a0f37b7923fae7aeb9d1d0061b1
target_directory: source/data
with:
× error File already exists: "F:\\projects\\icu-feedstock\\output\\bld\\rattler-build_icu_1745870626\\work\\source/data\\build.xml"
× error File already exists: "F:\\projects\\icu-feedstock\\output\\bld\\rattler-build_icu_1745870626\\work\\source/data\\BUILDRULES.py"
× error File already exists: "F:\\projects\\icu-feedstock\\output\\bld\\rattler-build_icu_1745870626\\work\\source/data\\cldr-icu-readme.txt"
The first source checkout already contains a folder called source/data to which the second source is extracted. I like that this yields an error because it clarifies that files will be overwritten, but currently, there is no workaround. I see three solutions in order of preference.
- Apply a
filterto the first source to exclude the other folder. This is currently only supported for thepathsource, would be very useful in this case. - Allow indicating that files should be overwritten.
- Simply ignore any files that are already present
I am not sure I like either option too much.
Wouldn't it be better to let the user figure out how to fix it as part of the build script?
E.g. use a different target_directory for the second download, and then move / copy / rename / delete files in the way they see fit?
Perhaps but at least for configuring this in yaml is easier than the manual step.