File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
pet-mac-commandlinetools/src Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,17 @@ impl Locator for MacCmdLineTools {
106
106
symlinks. sort ( ) ;
107
107
symlinks. dedup ( ) ;
108
108
109
+ // Find other exes that are symlinks to the same exe in /Library/Developer/CommandLineTools/usr/bin
110
+ for exe in find_executables ( "/Library/Developer/CommandLineTools/usr/bin" ) {
111
+ if !symlinks. contains ( & exe) {
112
+ if let Some ( symlink) = resolve_symlink ( & exe) {
113
+ if symlinks. contains ( & symlink) {
114
+ symlinks. push ( exe) ;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
109
120
if prefix. is_none ( ) {
110
121
// We would have identified the symlinks by now.
111
122
// Look for the one with the path `/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9`
Original file line number Diff line number Diff line change @@ -305,6 +305,28 @@ fn verify_we_can_get_same_env_inf_using_from(environment: PythonEnvironment) {
305
305
}
306
306
// WIP.
307
307
env. category = environment. category ;
308
+
309
+ if let Some ( prefix) = environment. clone ( ) . prefix {
310
+ if env. clone ( ) . executable == Some ( PathBuf :: from ( "/usr/local/python/current/bin/python" ) )
311
+ && ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/current"
312
+ && env. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/3.10.13" ) ) )
313
+ || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
314
+ && env. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/current" ) ) )
315
+ {
316
+ // known issue https://github.com/microsoft/python-environment-tools/issues/64
317
+ env. prefix = environment. clone ( ) . prefix ;
318
+ } else if env. clone ( ) . executable
319
+ == Some ( PathBuf :: from ( "/home/codespace/.python/current/bin/python" ) )
320
+ && ( prefix. to_str ( ) . unwrap ( ) == "/home/codespace/.python/current"
321
+ && env. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/3.10.13" ) ) )
322
+ || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
323
+ && env. clone ( ) . prefix == Some ( PathBuf :: from ( "/home/codespace/.python/current" ) ) )
324
+ {
325
+ // known issue https://github.com/microsoft/python-environment-tools/issues/64
326
+ env. prefix = environment. clone ( ) . prefix ;
327
+ }
328
+ }
329
+
308
330
assert_eq ! (
309
331
env, environment,
310
332
"Environment mismatch for {:?}" ,
You can’t perform that action at this time.
0 commit comments