Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b4fd331
Remove /usr/local/lib and /usr/local/include default compiler paths.
aaditya-chandrasekhar Mar 17, 2021
ce16bb5
Move ac_sys_release check before os checks.
aaditya-chandrasekhar Jul 3, 2021
3ccbd9c
Add detection support for macos12/darwin21.
aaditya-chandrasekhar Jul 3, 2021
b231d73
Fix test for darwin in setup.py.
aaditya-chandrasekhar Aug 21, 2021
d95ebd7
Forward LIBPYTHON if specified to module builds.
aaditya-chandrasekhar Nov 11, 2021
45cc589
Add platform triple definitions for mingw targets.
aaditya-chandrasekhar Nov 18, 2021
6c740c7
Add missing winerror.h include in PC/errmap.h.
aaditya-chandrasekhar Nov 11, 2021
42b08e6
Fix path to errmap.h (PC/errmap.h) in Objects/exceptions.c.
aaditya-chandrasekhar Nov 11, 2021
22a4fbe
Fix missing import of netioapi.h in Modules.socketmodule.c.
aaditya-chandrasekhar Nov 11, 2021
8c6ea80
Add equivalent for setenv::LC_TYPE for windows via setlocale::LC_TYPE.
aaditya-chandrasekhar Nov 11, 2021
af19b29
Add winconsoleio.c to _io module build.
aaditya-chandrasekhar Nov 11, 2021
68fd8e7
Add implementation for PyThread_get_thread_native_id on windows.
aaditya-chandrasekhar Nov 11, 2021
a64c5df
Remove incorrect IPPROTO enum definition block and instead rely on wi…
aaditya-chandrasekhar Nov 11, 2021
23fb913
Remove undefined PyInitFrozenExtensions function and compile PC/froze…
aaditya-chandrasekhar Nov 11, 2021
c2e2d60
Enable _Py_isabs on windows targets and implement via PathIsRelativeW…
aaditya-chandrasekhar Nov 20, 2021
1271e9c
Guard out ./ prefix to bare filename on windows targets in Python/dyn…
aaditya-chandrasekhar Nov 20, 2021
0f13e7c
Guard out usages of resolve_symlinks in Modules/getpath.c.
aaditya-chandrasekhar Nov 11, 2021
5f1ee27
Guard windows specific paths in posixmodule.c with _WIN32 instead of …
aaditya-chandrasekhar Nov 11, 2021
28a83b8
Use wcsncasecmp in place of _wcsnicmp on windows targets.
aaditya-chandrasekhar Nov 20, 2021
0ca8ad6
Convert MS_WIN32 -> MS_WINDOWS to port ctypes module to windows targets.
aaditya-chandrasekhar Nov 11, 2021
f13bc4b
Stub out pwdmodule on windows targets.
aaditya-chandrasekhar Nov 11, 2021
f72ce4a
Import windows.h in curses module when targeting windows.
aaditya-chandrasekhar Nov 11, 2021
31b5aa0
Properly stringify PY3_DLLNAME argument to GetModuleHandleW in _PyPat…
aaditya-chandrasekhar Nov 11, 2021
0f68f93
Fix windows build for _testembed internal program.
aaditya-chandrasekhar Nov 11, 2021
912dfb5
Cast arguments to putenv/unsetenv on windows targets to strings in Li…
aaditya-chandrasekhar Nov 11, 2021
9333fb7
Avoid using getpwuid on windows targets in Lib/posixpath.py.
aaditya-chandrasekhar Nov 11, 2021
87c018f
Define MS_COREDLL in Python/sysmodule.c to export version helpers for…
aaditya-chandrasekhar Nov 19, 2021
1e6b0d9
Enable PC/dl_nt.c on windows targets.
aaditya-chandrasekhar Nov 19, 2021
0370a5f
Disable builtin posix module by default so nt/posix can be chosen via…
aaditya-chandrasekhar Nov 19, 2021
7b770e3
Add dll import lib detection to distutils.
aaditya-chandrasekhar Nov 19, 2021
6e4e973
Fix naming convention for mingw32 dlls in Python/dynload_win.c.
aaditya-chandrasekhar Nov 20, 2021
a50ef34
Fix importing naming convention for python dll modules in Python/dynl…
aaditya-chandrasekhar Nov 20, 2021
f84d2d9
Unify unix and windows target handling of module imports.
aaditya-chandrasekhar Nov 20, 2021
7067919
Add dynload_shlib.c port for mingw32 windows target.
aaditya-chandrasekhar Nov 20, 2021
5c59903
Unify site-packages calculation on unix and windows targets by using …
aaditya-chandrasekhar Nov 20, 2021
25557ea
Use MS_WINDOWS instead of _MSC_VER in Modules/_ssl.c.
aaditya-chandrasekhar Nov 20, 2021
8d29a1a
Add musl detection support to configure.ac.
aaditya-chandrasekhar Dec 14, 2021
8940462
Fix BUILDPYTHON specification in Makefiles for Mac and Mac/PythonLaun…
aaditya-chandrasekhar Feb 9, 2022
ffdb307
Replace use of FRAMEWORKALTINSTALLFIRST/FRAMEWORKALTINSTALLLAST with …
aaditya-chandrasekhar Feb 11, 2022
2f03359
Expand check for windows from mingw32 to mingw* to allow mingw64 spec…
aaditya-chandrasekhar Mar 14, 2022
b7e1b29
Add i486-i786 32-bit x86 variant detection to configure.ac for linux …
aaditya-chandrasekhar Jun 24, 2022
9325a6e
Add i486-i786 32-bit x86 variant detection to configure.ac for window…
aaditya-chandrasekhar Jun 24, 2022
56ffa65
Skip MULTIARCH check for linux and mingw targets and assume PLATFORM_…
aaditya-chandrasekhar Jul 22, 2022
63d3eb2
Add MULTIARCH detection for android targets in configure.ac.
aaditya-chandrasekhar Jul 26, 2022
e98a83e
Bump actions/stale from 5 to 6
dependabot[bot] Oct 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
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: "Check PRs"
uses: actions/stale@v5
uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'
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