Conan-center-index: [question] Build subfolder is useless

Created on 6 Oct 2020  路  6Comments  路  Source: conan-io/conan-center-index

Some packages using cmake (or other build system) use a build subfolder. I think it is totally useless and may cause some path length problems on Windows (Paths are limited to 256 characters by default).

  1. Sources are located in source_subfolder. So build files and sources can't conflict (Except if the source folder contains already a source_subfolder).
  2. Using build_subfolder adds 15 extras characters to the path. The build folder already contains around 90 characters and CMake creates a huge and long file structure. It may cause some path length problems on Windows.
question

Most helpful comment

Not really, build_subfolder isolates all artifacts generated when building. We decided to use it since Bincrafters, because we can check that folder, not mixing with the sources, that's important when you want to validate the copied binaries.

About Windows max path, build_folder is not the problem and it won't fix the situation, we solve for some recipes, but large names will have the same problem. There are other alternatives, like https://docs.microsoft.com/es-es/windows/win32/fileio/naming-a-file#maximum-path-length-limitation. Or it should be fixed in CCI internally, reducing the CI build path for instance.

All 6 comments

Not really, build_subfolder isolates all artifacts generated when building. We decided to use it since Bincrafters, because we can check that folder, not mixing with the sources, that's important when you want to validate the copied binaries.

About Windows max path, build_folder is not the problem and it won't fix the situation, we solve for some recipes, but large names will have the same problem. There are other alternatives, like https://docs.microsoft.com/es-es/windows/win32/fileio/naming-a-file#maximum-path-length-limitation. Or it should be fixed in CCI internally, reducing the CI build path for instance.

Long path is not available on all Windows machines (due to internal company rules for example). I think that reducing the chance of reaching path length threshold on Windows is more important than isolating build artifacts which is just a nice to have for build checks (just mentally filter files generated by conan generators and export_sources files :p)

Is the path length a theoretical problem or did someone of you actual encounter a situation where

  • using the short_paths=True attribute did not help
  • and 15 characters less would have make a difference?

Yes and short_paths=True is terrible on Windows, it's a mess to navigate in short paths and check build/source/package folder. I've also a lot of ghost folders from failed builds. I can't even globally disable it when long path is enabled at Windows level, because of qt recipe...

How many characters was it too much and was it a public recipe?

We could change the actual directory names from source_subfolder -> source and build_subfolder -> build as an intermediate step. This would reduce it by 10 characters

Otherwise I agree with @uilianries and would like to keep them. I also doubt that 5 (or even 15) characters would make a difference in many cases

Renaming build_subfolder sounds plausible.

Was this page helpful?
0 / 5 - 0 ratings