Switch from `python3` to `python` on Windows

and just make other things nicer I dunno
This commit is contained in:
Ben Visness 2023-09-18 22:30:25 -05:00 committed by MartinFouilleul
parent ab3280ed4e
commit 43273cc170
3 changed files with 13 additions and 6 deletions

View File

@ -23,15 +23,15 @@ To learn more about the project and its goals, read the [announcement post](http
The Orca command-line tools must be installed to your system in order to use them in your own projects.
**At this early stage, you must build Orca yourself - in the future, this installation process will be streamlined.**
**At this early stage, you must build Orca yourself - in the future, there will be fewer dependencies and this installation process will be streamlined.**
### Requirements
- Windows or Mac (Linux is not yet supported)
- [Python 3](https://www.python.org/) (for command line tools)
- [Python 3.8](https://www.python.org/) or newer (for command line tools)
- Clang
- **Windows users:** `clang` can be installed via the Visual Studio installer. Search for "C++ Clang Compiler".
- **Mac users:** Apple's built-in `clang` does not support WebAssembly. We recommend installing `clang` via [Homebrew](https://brew.sh/) with `brew install clang`.
- **Mac users:** Apple's built-in `clang` does not support WebAssembly. We recommend installing `clang` via [Homebrew](https://brew.sh/) with `brew install llvm`.
- MSVC (Visual Studio 2022 17.5 or newer) (Windows only)
- This can be installed through the [Visual Studio Community](https://visualstudio.microsoft.com/) installer. Ensure that your Visual Studio installation includes "Desktop development with C++".
- Please note the version requirement! Orca requires C11 atomics, which were only added to MSVC in late 2022.
@ -50,13 +50,13 @@ cd orca
Build the Orca runtime:
```
./orca dev build-runtime
python orca dev build-runtime
```
Install the Orca dev tools. If on Windows, the tool can automatically add `orca` to your PATH. Otherwise, you must manually add the Orca install directory to your PATH, e.g. by updating `.zshrc` or `.bashrc`.
```
./orca dev install
python orca dev install
```
Finally, verify that Orca is successfully installed by running the `orca version` command. Note the lack of `./`!

7
orca
View File

@ -7,10 +7,17 @@ import os
import sys
MAJOR, MINOR = 3, 8
if __name__ != "__main__":
print("why are you importing the orca command-line tool as a Python module, you absolute goofball")
exit(1)
if sys.version_info.major < MAJOR or sys.version_info.minor < MINOR:
print("Your Python version is too old.")
print("Orca requires version {}.{}, but you have version {}.{}.".format(MAJOR, MINOR, sys.version_info.major, sys.version_info.minor))
exit(1)
# If you modify this, be sure to modify the version in scripts/dev.py as well.
def check_if_source():

View File

@ -3,5 +3,5 @@
rem Get the directory of this batch script
set "script_dir=%~dp0"
python3 "%script_dir%orca" %*
python "%script_dir%orca" %*
exit /b %errorlevel%