Skip to content

Commit

Permalink
The struggle continues...
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Jul 17, 2023
1 parent 1ad7d19 commit 987fd31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ jobs:
run: |
echo "::group::Configure Python"
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
ls "$(llvm-config-${{ matrix.llvm }} --bindir)"
./configure ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
echo "::endgroup::"
echo "::group::Build Python"
Expand Down
10 changes: 4 additions & 6 deletions Tools/justin/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ def get_llvm_tool_version(name: str) -> int | None:
process = subprocess.run(args, check=True, stdout=subprocess.PIPE)
except FileNotFoundError:
return None
print(name, process.stdout) # XXX
match = re.search(br"version\s+(\d+)\.\d+\.\d+\s+", process.stdout)
return match and int(match.group(1))

def find_llvm_tool(tool: str) -> tuple[str, int]:
versions = {14, 15, 16}
forced_version = os.getenv("PYTHON_LLVM_VERSION")
print(versions, forced_version) # XXX
if forced_version:
versions &= {int(forced_version)}
# Unversioned executables:
Expand All @@ -185,7 +185,6 @@ def find_llvm_tool(tool: str) -> tuple[str, int]:
for version in sorted(versions, reverse=True):
# Versioned executables:
path = f"{tool}-{version}"
print(path, get_llvm_tool_version(path)) # XXX
if get_llvm_tool_version(path) == version:
return path, version
# My homebrew homies:
Expand Down Expand Up @@ -1087,10 +1086,9 @@ def dump(self) -> str:
return "\n".join(lines)

if __name__ == "__main__":
# Clang internal error with musttail + ghccc + aarch64:
ghccc = platform.machine() not in {"aarch64", "arm64"}
print(f"{platform.machine() = }")
engine = Compiler(verbose=True, ghccc=False)#ghccc) # XXX: powerpc64le
# Clang internal error with musttail + ghccc + aarch64, and no support for ghccc + powerpc64le:
ghccc = platform.machine() not in {"aarch64", "arm64", "ppc64le"}
engine = Compiler(verbose=True, ghccc=ghccc)
asyncio.run(engine.build())
with open(sys.argv[2], "w") as file:
file.write(engine.dump())

0 comments on commit 987fd31

Please sign in to comment.