bug(build): `sl` binary not correctly moved when using multiple versions of Python
vegerot opened this issue · comments
I actually noticed this last year and I could have sworn I'd opened an issue but didn't.
Steps to reproduce:
- build sapling:
make oss
- switch your version of Python and build again:
make oss && ./sl
1
Expected:
successfully builds and shows log
Actual:
Finished release [optimized] target(s) in 4m 06s
Packaging assets into /Users/m0c0j7y/workspace/github.com/facebook/sapling/eden/scm/build/edenscmdeps3.zip
rm -f sl
cp build/scripts-3*/sl sl
cp: sl is not a directory
make: *** [oss] Error 1
Workaround:
Manually copy the file from build/scripts-3x
Probable cause:
We use a trick to grab the sl
we just built: cp build/scripts-3*/sl sl
. This works fine when there's only one version of python, because it expands to cp build/scripts-38/sl sl
, but breaks when there's multiple versions: cp build/scripts-38/sl build/scripts-39/sl sl
.
The fix should be to look at which version of Python we just used and select that specific binary.
Footnotes
-
would be nice if the Makefile supported
PYTHON3=my/py/3 make oss
↩
would be nice if the Makefile supported PYTHON3=my/py/3 make oss
How about PYTHON_SYS_EXECUTABLE=$(which python3.8) make oss
?