Open Mfk-Xkj opened 10 months ago
@shahmishal Please transfer this to swiftpm.
I believe this can be done today with --config-path
Hi @Mfk-Xkj, would you be able to confirm that the proposed solution is sufficient for this issue to be closed? Thanks!
@MaxDesiatov @neonichu I first delete the ~/.swiftpm directory, and then use the latest version of swiftpm (the latest main branch) to compile the project and add the --config-path parameter. The instructions I use are as follows: swift build --config-path ~/.config_swiftpm_path . After the above instructions are compiled, .swiftpm and .config_swiftpm_path will be created in the ~/ directory. The expectation is to create only the .config_swiftpm_path directory and not the .swiftpm directory. (For the convenience of testing here, in actual use, .config_swiftpm_path will be configured as the path that the androidT sandbox mechanism has access rights to)
Motivation
I compile Swift projects in the Android system using genrule and a shell script. However, in Android T, there are restrictions imposed on genrule, prohibiting access to the ~/ directory when it is executed in a sandbox. On the other hand, during swift build, ~/.swiftpm is a fixed directory that cannot be configured. The combination of these two cases leads to an inability to compile.
Solution
make ~/.swiftpm dir configable
Alternatives considered