Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aa9050e
Add detection support for macos12/darwin21.
aaditya-chandrasekhar Jul 3, 2021
4ec2568
Fix test for darwin in setup.py.
aaditya-chandrasekhar Aug 21, 2021
68a31be
Forward LIBPYTHON if specified to module builds.
aaditya-chandrasekhar Nov 11, 2021
fa31b25
Add platform triple definitions for mingw targets.
aaditya-chandrasekhar Nov 18, 2021
e9d7fd7
Add missing winerror.h include in PC/errmap.h.
aaditya-chandrasekhar Nov 11, 2021
c46043d
Fix path to errmap.h (PC/errmap.h) in Objects/exceptions.c.
aaditya-chandrasekhar Nov 11, 2021
23be75a
Fix missing import of netioapi.h in Modules.socketmodule.c.
aaditya-chandrasekhar Nov 11, 2021
ee5a845
Add equivalent for setenv::LC_TYPE for windows via setlocale::LC_TYPE.
aaditya-chandrasekhar Nov 11, 2021
3be4dac
Add winconsoleio.c to _io module build.
aaditya-chandrasekhar Nov 11, 2021
eec23b8
Add implementation for PyThread_get_thread_native_id on windows.
aaditya-chandrasekhar Nov 11, 2021
3e2de84
Remove incorrect IPPROTO enum definition block and instead rely on wi…
aaditya-chandrasekhar Nov 11, 2021
bc016d5
Remove undefined PyInitFrozenExtensions function and compile PC/froze…
aaditya-chandrasekhar Nov 11, 2021
adc1095
Enable _Py_isabs on windows targets and implement via PathIsRelativeW…
aaditya-chandrasekhar Nov 20, 2021
bf9d15c
Guard out ./ prefix to bare filename on windows targets in Python/dyn…
aaditya-chandrasekhar Nov 20, 2021
73b8af0
Guard out usages of resolve_symlinks in Modules/getpath.c.
aaditya-chandrasekhar Nov 11, 2021
21961e9
Guard windows specific paths in posixmodule.c with _WIN32 instead of …
aaditya-chandrasekhar Nov 11, 2021
40f81b1
Use wcsncasecmp in place of _wcsnicmp on windows targets.
aaditya-chandrasekhar Nov 20, 2021
3a941d2
Convert MS_WIN32 -> MS_WINDOWS to port ctypes module to windows targets.
aaditya-chandrasekhar Nov 11, 2021
b9bc708
Stub out pwdmodule on windows targets.
aaditya-chandrasekhar Nov 11, 2021
c4f3fdf
Import windows.h in curses module when targeting windows.
aaditya-chandrasekhar Nov 11, 2021
048d546
Properly stringify PY3_DLLNAME argument to GetModuleHandleW in _PyPat…
aaditya-chandrasekhar Nov 11, 2021
8abab10
Fix windows build for _testembed internal program.
aaditya-chandrasekhar Nov 11, 2021
aabe5ac
Cast arguments to putenv/unsetenv on windows targets to strings in Li…
aaditya-chandrasekhar Nov 11, 2021
168fdd2
Avoid using getpwuid on windows targets in Lib/posixpath.py.
aaditya-chandrasekhar Nov 11, 2021
50b3a56
Define MS_COREDLL in Python/sysmodule.c to export version helpers for…
aaditya-chandrasekhar Nov 19, 2021
15e9d49
Enable PC/dl_nt.c on windows targets.
aaditya-chandrasekhar Nov 19, 2021
254449c
Disable builtin posix module by default so nt/posix can be chosen via…
aaditya-chandrasekhar Nov 19, 2021
6e4777d
Add dll import lib detection to distutils.
aaditya-chandrasekhar Nov 19, 2021
7b38a33
Fix naming convention for mingw32 dlls in Python/dynload_win.c.
aaditya-chandrasekhar Nov 20, 2021
d8d0bf1
Fix importing naming convention for python dll modules in Python/dynl…
aaditya-chandrasekhar Nov 20, 2021
1edbda0
Unify unix and windows target handling of module imports.
aaditya-chandrasekhar Nov 20, 2021
36fbdb4
Add dynload_shlib.c port for mingw32 windows target.
aaditya-chandrasekhar Nov 20, 2021
511d186
Unify site-packages calculation on unix and windows targets by using …
aaditya-chandrasekhar Nov 20, 2021
228cd08
Use MS_WINDOWS instead of _MSC_VER in Modules/_ssl.c.
aaditya-chandrasekhar Nov 20, 2021
5e8e90f
Add musl detection support to configure.ac.
aaditya-chandrasekhar Dec 14, 2021
e59dc03
Remove resetting MULTIARCH to empty on darwin targets.
aaditya-chandrasekhar Jan 22, 2022
7e88029
Fix BUILDPYTHON specification in Makefiles for Mac and Mac/PythonLaun…
aaditya-chandrasekhar Feb 9, 2022
c0c2307
Replace use of FRAMEWORKALTINSTALLFIRST/FRAMEWORKALTINSTALLLAST with …
aaditya-chandrasekhar Feb 11, 2022
4a01892
Expand check for windows from mingw32 to mingw* to allow mingw64 spec…
aaditya-chandrasekhar Mar 14, 2022
0286324
Add i486-i786 32-bit x86 variant detection to configure.ac for linux …
aaditya-chandrasekhar Jun 24, 2022
3fe4bc3
Add i486-i786 32-bit x86 variant detection to configure.ac for window…
aaditya-chandrasekhar Jun 24, 2022
aa5d7e0
build(deps): bump actions/cache from 3.0.2 to 3.0.4
dependabot[bot] Jul 1, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v3.0.2
uses: actions/cache@v3.0.4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v3.0.2
uses: actions/cache@v3.0.4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
Expand Down
2 changes: 0 additions & 2 deletions Include/cpython/fileutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ PyAPI_FUNC(wchar_t*) _Py_wrealpath(
size_t resolved_path_len);
#endif

#ifndef MS_WINDOWS
PyAPI_FUNC(int) _Py_isabs(const wchar_t *path);
#endif

PyAPI_FUNC(int) _Py_abspath(const wchar_t *path, wchar_t **abspath_p);

Expand Down
4 changes: 2 additions & 2 deletions Lib/distutils/ccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,9 @@ def executable_filename(self, basename, strip_dir=0, output_dir=''):
def library_filename(self, libname, lib_type='static', # or 'shared'
strip_dir=0, output_dir=''):
assert output_dir is not None
if lib_type not in ("static", "shared", "dylib", "xcode_stub"):
if lib_type not in ("static", "shared", "dll", "dylib", "xcode_stub"):
raise ValueError(
"'lib_type' must be \"static\", \"shared\", \"dylib\", or \"xcode_stub\"")
"'lib_type' must be \"static\", \"shared\", \"dll\", \"dylib\", or \"xcode_stub\"")
fmt = getattr(self, lib_type + "_lib_format")
ext = getattr(self, lib_type + "_lib_extension")

Expand Down
9 changes: 7 additions & 2 deletions Lib/distutils/unixccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ class UnixCCompiler(CCompiler):
obj_extension = ".o"
static_lib_extension = ".a"
shared_lib_extension = ".so"
dll_lib_extension = ".dll.a"
dylib_lib_extension = ".dylib"
xcode_stub_lib_extension = ".tbd"
static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s"
static_lib_format = shared_lib_format = dll_lib_format = dylib_lib_format = "lib%s%s"
xcode_stub_lib_format = dylib_lib_format
if sys.platform == "cygwin":
exe_extension = ".exe"
Expand Down Expand Up @@ -265,6 +266,7 @@ def library_option(self, lib):

def find_library_file(self, dirs, lib, debug=0):
shared_f = self.library_filename(lib, lib_type='shared')
dll_f = self.library_filename(lib, lib_type='dll')
dylib_f = self.library_filename(lib, lib_type='dylib')
xcode_stub_f = self.library_filename(lib, lib_type='xcode_stub')
static_f = self.library_filename(lib, lib_type='static')
Expand Down Expand Up @@ -299,6 +301,7 @@ def find_library_file(self, dirs, lib, debug=0):

for dir in dirs:
shared = os.path.join(dir, shared_f)
dll = os.path.join(dir, dll_f)
dylib = os.path.join(dir, dylib_f)
static = os.path.join(dir, static_f)
xcode_stub = os.path.join(dir, xcode_stub_f)
Expand All @@ -316,7 +319,9 @@ def find_library_file(self, dirs, lib, debug=0):
# data to go on: GCC seems to prefer the shared library, so I'm
# assuming that *all* Unix C compilers do. And of course I'm
# ignoring even GCC's "-static" option. So sue me.
if os.path.exists(dylib):
if os.path.exists(dll):
return dll
elif os.path.exists(dylib):
return dylib
elif os.path.exists(xcode_stub):
return xcode_stub
Expand Down
10 changes: 8 additions & 2 deletions Lib/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,18 @@ def __getitem__(self, key):
def __setitem__(self, key, value):
key = self.encodekey(key)
value = self.encodevalue(value)
putenv(key, value)
if sys.platform.startswith('win'):
putenv(str(key), str(value))
else:
putenv(key, value)
self._data[key] = value

def __delitem__(self, key):
encodedkey = self.encodekey(key)
unsetenv(encodedkey)
if sys.platform.startswith('win'):
unsetenv(str(encodedkey))
else:
unsetenv(encodedkey)
try:
del self._data[encodedkey]
except KeyError:
Expand Down
4 changes: 3 additions & 1 deletion Lib/posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,13 @@ def expanduser(path):
if 'HOME' not in os.environ:
import pwd
try:
userhome = pwd.getpwuid(os.getuid()).pw_dir
if not sys.platform.startswith('win'):
userhome = pwd.getpwuid(os.getuid()).pw_dir
except KeyError:
# bpo-10496: if the current user identifier doesn't exist in the
# password database, return the path unchanged
return path
return path
else:
userhome = os.environ['HOME']
else:
Expand Down
21 changes: 5 additions & 16 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ def joinuser(*args):
def _get_path(userbase):
version = sys.version_info

if os.name == 'nt':
ver_nodot = sys.winver.replace('.', '')
return f'{userbase}\\Python{ver_nodot}\\site-packages'

if sys.platform == 'darwin' and sys._framework:
return f'{userbase}/lib/python/site-packages'

Expand Down Expand Up @@ -365,18 +361,11 @@ def getsitepackages(prefixes=None):
if sys.platlibdir != "lib":
libdirs.append("lib")

if os.sep == '/':
for libdir in libdirs:
path = os.path.join(prefix, libdir,
"python%d.%d" % sys.version_info[:2],
"site-packages")
sitepackages.append(path)
else:
sitepackages.append(prefix)

for libdir in libdirs:
path = os.path.join(prefix, libdir, "site-packages")
sitepackages.append(path)
for libdir in libdirs:
path = os.path.join(prefix, libdir,
"python%d.%d" % sys.version_info[:2],
"site-packages")
sitepackages.append(path)
return sitepackages

def addsitepackages(known_paths, prefixes=None):
Expand Down
4 changes: 2 additions & 2 deletions Mac/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exec_prefix=@exec_prefix@
LIBDEST=$(prefix)/lib/python$(VERSION)
RUNSHARED=@RUNSHARED@
BUILDEXE=@BUILDEXEEXT@
BUILDPYTHON=$(builddir)/python$(BUILDEXE)
BUILDPYTHON=python$(BUILDEXE)
DESTDIR=
LDFLAGS=@LDFLAGS@
FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
Expand Down Expand Up @@ -226,7 +226,7 @@ install_Python:
esac; \
done; \
done
$(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
$(INSTALL_PROGRAM) $(STRIPFLAG) $(builddir)/$(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
sed -e "s!%bundleid%!$(PYTHONFRAMEWORKIDENTIFIER)!g" \
-e "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) \
-c 'import platform; print(platform.python_version())'`!g" \
Expand Down
2 changes: 1 addition & 1 deletion Mac/PythonLauncher/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builddir= ../..

RUNSHARED= @RUNSHARED@
BUILDEXE= @BUILDEXEEXT@
BUILDPYTHON= $(builddir)/python$(BUILDEXE)
BUILDPYTHON= python$(BUILDEXE)
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@

# Deployment target selected during configure, to be checked
Expand Down
20 changes: 14 additions & 6 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ IO_OBJS= \
Modules/_io/bufferedio.o \
Modules/_io/textio.o \
Modules/_io/bytesio.o \
Modules/_io/stringio.o
Modules/_io/stringio.o \
Modules/_io/winconsoleio.o

##########################################################################

Expand Down Expand Up @@ -456,7 +457,9 @@ LIBRARY_OBJS_OMIT_FROZEN= \

LIBRARY_OBJS= \
$(LIBRARY_OBJS_OMIT_FROZEN) \
Python/frozen.o
Python/frozen.o \
PC/frozen_dllmain.o \
PC/dl_nt.o

##########################################################################
# DTrace
Expand Down Expand Up @@ -626,10 +629,10 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
*\ -s*|s*) quiet="-q";; \
*) quiet="";; \
esac; \
echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED) $(LIBPYTHON)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED) $(LIBPYTHON)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build

Expand Down Expand Up @@ -823,6 +826,11 @@ Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
-DSHLIB_EXT='"$(EXT_SUFFIX)"' \
-o $@ $(srcdir)/Python/dynload_hpux.c

Python/dynload_win.o: $(srcdir)/Python/dynload_win.c Makefile
$(CC) -c $(PY_CORE_CFLAGS) \
-DSOABI='"$(SOABI)"' \
-o $@ $(srcdir)/Python/dynload_win.c

Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
$(CC) -c $(PY_CORE_CFLAGS) \
-DABIFLAGS='"$(ABIFLAGS)"' \
Expand Down Expand Up @@ -1284,10 +1292,10 @@ altinstall: commoninstall
$$ensurepip --root=$(DESTDIR)/ ; \
fi

commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
commoninstall: check-clean-src @FRAMEWORKINSTALLFIRST@ \
altbininstall libinstall inclinstall libainstall \
sharedinstall oldsharedinstall altmaninstall \
@FRAMEWORKALTINSTALLLAST@
@FRAMEWORKINSTALLLAST@

# Install shared libraries enabled by Setup
DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
Expand Down
4 changes: 2 additions & 2 deletions Modules/Setup
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ PYTHONPATH=$(COREPYTHONPATH)
# This only contains the minimal set of modules required to run the
# setup.py script in the root of the Python source tree.

posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
# posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
errno errnomodule.c # posix (UNIX) errno values
pwd pwdmodule.c # this is needed to find out the user's home dir
# if $HOME is not set
Expand All @@ -123,7 +123,7 @@ _thread -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _threadmodule.c # l
_locale -DPy_BUILD_CORE_BUILTIN _localemodule.c # -lintl

# Standard I/O baseline
_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c _io/winconsoleio.c

# faulthandler module
faulthandler faulthandler.c
Expand Down
Loading