Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allows for proper building of LuaJit on Windows x64 #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ def use_bundled_luajit(path, macros):
build_env = dict(os.environ)
src_dir = os.path.join(path, "src")
if platform.startswith('win'):
try:
subprocess.run(["C:\\Program Files(x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat", "x86_x64",])
Comment on lines +231 to +232
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it helps to do this. IIUC, the batch file sets up environment variables, so it needs to run in the same command shell that then executes the build.

Also, I don't think it's a good idea to use a hard coded path. There must be a way to figure it out programmatically. It might also be that the batch file is simply on the search PATH already and can be started as is.

Note that appveyor isn't really used any more since we use GHA also for the Windows builds. I should disable it.

except FileNotFoundError:
print("vcvarsall not found in the location spesified by appveyor.yml. If you are not building on CI, this can safely be ignored.")

build_script = [os.path.join(src_dir, "msvcbuild.bat"), "static"]
lib_file = "lua51.lib"
else:
Expand Down Expand Up @@ -365,10 +370,6 @@ def has_option(name):
# http://t-p-j.blogspot.com/2010/11/lupa-on-os-x-with-macports-python-26.html
# LuaJIT 2.1-alpha3 fails at runtime.
or (platform == 'darwin' and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
# Couldn't get the Windows build to work. See
# https://luajit.org/install.html#windows
or (platform.startswith('win') and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
# Let's restrict LuaJIT to x86_64 for now.
or (get_machine() not in ("x86_64", "AMD64") and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
)
]
Expand Down