Comments (48)
Thanks for bringing this up. I've been fighting distutils lately, so I might give this switch a try.
from ambuild.
@dvander One suggestion I want to make for the switch (if you go for it) is to drop the 'scripts' folder.
Setuptools includes a handy 'entry_points' keyword argument in the 'setup' function, and a special 'console_scripts' entry. for AMBuild2, I recommend an entry like: 'ambuild = ambuild2.run:cli_run'. Setuptools then generates a platform appropriate script (executable on Windows) that'll invoke the entry point.
from ambuild.
Infact @dvander , while quickly checking the setup.py script and setuptools' documentation, theoretically you can just straight up swap the target import from distutils to setuptools and be done with it.
from ambuild.
That's good to know. AMBuild is due for some maintenance (I have a large TODO to fix how to detects MSVC) so I can give this a try soon.
from ambuild.
@dvander If you would allow me, I can quickly get a Pull Request up to pull the trigger on the switch.
from ambuild.
Traceback (most recent call last):
File "/usr/local/bin/ambuild", line 11, in <module>
load_entry_point('AMBuild==2.0', 'console_scripts', 'ambuild')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2851, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'ambuild') not found
Something doesn't work here on Ubuntu 20 for me. The generated "ambuild" script fails with the above error. When I restore the old ambuild script, it works fine.
from ambuild.
That error reads that it was unable to load the entry point.
The entry point is 'cli_run' in run.py, does it exist?
from ambuild.
I was unable to replicate your issue with Ubuntu 20.04 (via Windows Subsystem for Linux):
wildcard65@WildCard65-Laptop:~/ambuild$ python3 ./setup.py install --user
running install
running bdist_egg
running egg_info
writing AMBuild.egg-info/PKG-INFO
writing dependency_links to AMBuild.egg-info/dependency_links.txt
writing entry points to AMBuild.egg-info/entry_points.txt
writing top-level names to AMBuild.egg-info/top_level.txt
reading manifest file 'AMBuild.egg-info/SOURCES.txt'
writing manifest file 'AMBuild.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/database.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/graph.py -> build/bdist.linux-x86_64/egg/ambuild2
creating build/bdist.linux-x86_64/egg/ambuild2/frontend
copying build/lib/ambuild2/frontend/paths.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/amb2
copying build/lib/ambuild2/frontend/v2_0/amb2/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/amb2
copying build/lib/ambuild2/frontend/v2_0/amb2/gen.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/amb2
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/cxx.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/xmlbuilder.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/graph.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/nodes.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/export_vcxproj.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
copying build/lib/ambuild2/frontend/v2_0/vs/gen.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp
copying build/lib/ambuild2/frontend/v2_0/cpp/compilers.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp
copying build/lib/ambuild2/frontend/v2_0/cpp/vendors.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp
copying build/lib/ambuild2/frontend/v2_0/cpp/detect.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp
copying build/lib/ambuild2/frontend/v2_0/cpp/builders.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp
copying build/lib/ambuild2/frontend/v2_0/cpp/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp
copying build/lib/ambuild2/frontend/v2_0/prep.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/base
copying build/lib/ambuild2/frontend/v2_0/base/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/base
copying build/lib/ambuild2/frontend/v2_0/base/gen.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/base
copying build/lib/ambuild2/frontend/v2_0/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0
copying build/lib/ambuild2/frontend/version.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/amb2
copying build/lib/ambuild2/frontend/v2_1/amb2/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/amb2
copying build/lib/ambuild2/frontend/v2_1/amb2/gen.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/amb2
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/cxx.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/xmlbuilder.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/graph.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/nodes.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/export_vcxproj.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
copying build/lib/ambuild2/frontend/v2_1/vs/gen.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/sunpro.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/msvc.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/gcc.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/vendor.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/detect.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/builders.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/cpp/compiler.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp
copying build/lib/ambuild2/frontend/v2_1/prep.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base
copying build/lib/ambuild2/frontend/v2_1/base/context.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base
copying build/lib/ambuild2/frontend/v2_1/base/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base
copying build/lib/ambuild2/frontend/v2_1/base/gen.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base
copying build/lib/ambuild2/frontend/v2_1/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1
creating build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/tools
copying build/lib/ambuild2/frontend/v2_1/tools/fxc.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/tools
copying build/lib/ambuild2/frontend/v2_1/tools/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/tools
copying build/lib/ambuild2/frontend/system.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend
copying build/lib/ambuild2/frontend/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/frontend
creating build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/linux.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/impl.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/process.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/bsd.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/posix_proc.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/generic_poll.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/windows.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/winapi.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/ipc/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2/ipc
copying build/lib/ambuild2/util.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/run.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/task.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/builder.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/context.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/nodetypes.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/damage.py -> build/bdist.linux-x86_64/egg/ambuild2
copying build/lib/ambuild2/__init__.py -> build/bdist.linux-x86_64/egg/ambuild2
creating build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/cpp.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/cache.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/job.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/worker.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/runner.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/osutil.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/__init__.py -> build/bdist.linux-x86_64/egg/ambuild
copying build/lib/ambuild/command.py -> build/bdist.linux-x86_64/egg/ambuild
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/database.py to database.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/graph.py to graph.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/paths.py to paths.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/amb2/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/amb2/gen.py to gen.cpython-38.pyc
build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/amb2/gen.py:735: SyntaxWarning: "is" with a literal. Did you mean "=="?
if folder is -1:
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/cxx.py to cxx.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/xmlbuilder.py to xmlbuilder.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/graph.py to graph.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/nodes.py to nodes.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/export_vcxproj.py to export_vcxproj.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/vs/gen.py to gen.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/compilers.py to compilers.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/vendors.py to vendors.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/detect.py to detect.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/builders.py to builders.cpython-38.pyc
build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/builders.py:269: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target_platform is 'mac':
build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/builders.py:285: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target_platform is 'linux':
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/cpp/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/prep.py to prep.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/base/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/base/gen.py to gen.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_0/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/version.py to version.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/amb2/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/amb2/gen.py to gen.cpython-38.pyc
build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/amb2/gen.py:745: SyntaxWarning: "is" with a literal. Did you mean "=="?
if folder is -1:
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/cxx.py to cxx.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/xmlbuilder.py to xmlbuilder.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/graph.py to graph.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/nodes.py to nodes.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/export_vcxproj.py to export_vcxproj.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/vs/gen.py to gen.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/sunpro.py to sunpro.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/msvc.py to msvc.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/gcc.py to gcc.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/vendor.py to vendor.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/detect.py to detect.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/builders.py to builders.cpython-38.pyc
build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/builders.py:482: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target.platform is 'mac':
build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/builders.py:498: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target.platform is 'linux':
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/cpp/compiler.py to compiler.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/prep.py to prep.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base/context.py to context.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/base/gen.py to gen.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/tools/fxc.py to fxc.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/v2_1/tools/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/system.py to system.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/frontend/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/linux.py to linux.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/impl.py to impl.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/process.py to process.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/bsd.py to bsd.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/posix_proc.py to posix_proc.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/generic_poll.py to generic_poll.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/windows.py to windows.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/winapi.py to winapi.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/ipc/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/util.py to util.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/run.py to run.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/task.py to task.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/builder.py to builder.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/context.py to context.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/nodetypes.py to nodetypes.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/damage.py to damage.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild2/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/cpp.py to cpp.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/cache.py to cache.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/job.py to job.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/worker.py to worker.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/runner.py to runner.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/osutil.py to osutil.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/__init__.py to __init__.cpython-38.pyc
byte-compiling build/bdist.linux-x86_64/egg/ambuild/command.py to command.cpython-38.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-3.8/ambuild_objcopy_wrapper.sh -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/ambuild_objcopy_wrapper.sh to 755
copying AMBuild.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying AMBuild.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying AMBuild.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying AMBuild.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying AMBuild.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying AMBuild.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/AMBuild-2.0-py3.8.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing AMBuild-2.0-py3.8.egg
creating /home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg
Extracting AMBuild-2.0-py3.8.egg to /home/wildcard65/.local/lib/python3.8/site-packages
/home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg/ambuild2/frontend/v2_0/amb2/gen.py:735: SyntaxWarning: "is" with a literal. Did you mean "=="?
if folder is -1:
/home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg/ambuild2/frontend/v2_0/cpp/builders.py:269: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target_platform is 'mac':
/home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg/ambuild2/frontend/v2_0/cpp/builders.py:285: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target_platform is 'linux':
/home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg/ambuild2/frontend/v2_1/amb2/gen.py:745: SyntaxWarning: "is" with a literal. Did you mean "=="?
if folder is -1:
/home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg/ambuild2/frontend/v2_1/cpp/builders.py:482: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target.platform is 'mac':
/home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg/ambuild2/frontend/v2_1/cpp/builders.py:498: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif cx.target.platform is 'linux':
Adding AMBuild 2.0 to easy-install.pth file
Installing ambuild_objcopy_wrapper.sh script to /home/wildcard65/.local/bin
Installing ambuild script to /home/wildcard65/.local/bin
Installed /home/wildcard65/.local/lib/python3.8/site-packages/AMBuild-2.0-py3.8.egg
Processing dependencies for AMBuild==2.0
Finished processing dependencies for AMBuild==2.0
wildcard65@WildCard65-Laptop:~/ambuild$ cd ../
wildcard65@WildCard65-Laptop:~$ command -v ambuild
/home/wildcard65/.local/bin/ambuild
wildcard65@WildCard65-Laptop:~$ ambuild
Error: folder was not configured for AMBuild.
wildcard65@WildCard65-Laptop:~$
I was only able to replicate after running the following command:
pip3 uninstall ambuild
from ambuild.
@dvander Managed to actually replicate the issue you have:
wildcard65@WildCard65-Laptop:~/ambuild$ ambuild
Traceback (most recent call last):
File "/home/wildcard65/.local/bin/ambuild", line 11, in <module>
load_entry_point('AMBuild==2.0', 'console_scripts', 'ambuild')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2853, in load_entry_point
raise ImportError("Entry point %r not found" % ((group, name),))
ImportError: Entry point ('console_scripts', 'ambuild') not found
The cause: Your prior installation of AMBuild
Solution: Clean out everything AMBuild related (egg stuff as well!) and remove AMBuild's entry from 'easy_install.pth' in your site-packages directory.
from ambuild.
Clarification:
When 'setuptools'/'pip' goes to replace an existing installation, it first has to uninstall the existing installation.
This will ALWAYS fail for disutils installed packages.
from ambuild.
How do we fix this?
from ambuild.
Unfortunately, it's a limitation of pip and setuptools, they explicitly complain that disutils installed packages can't be reliabily uninstalled.
Mitigation wise is warning people about having preinstalled previous versions.
from ambuild.
It seems like the setuptools script should error if there is a distutils version installed. I wound up with a broken installation which is not very good.
from ambuild.
from ambuild.
There's no way to have the new installer check that a version was installed with the previous installer? Why are we using this new installer, then? :)
from ambuild.
from ambuild.
If there is literally no way to have the new installer check and error on a distutils install - I'd like to revert this change. A warning is good in principle, but will get lost in the gratuitous installation spew - it has to be an error.
It seems hard to believe setuptools is missing a basic principle of package management - there's no way to run an arbitrary script as a prerequisite, where we could check if there is a distutils version of the same package?
from ambuild.
from ambuild.
I'd be fine moving to pip, but no matter what we do, we need some breaker to make sure we don't create two conflicting installs. It's just a terrible experience - I lost an hour trying to figure out what was going on, and I'm sure someone less involved than me would give up and conclude AMBuild was broken.
Looking at setup.py, it's just a normal Python script. It seems like we should be able to throw some detection logic in there and prevent it from running.
from ambuild.
I can look tonight to see if there's anything in the distutils API for doing this.
from ambuild.
from ambuild.
@dvander There may not even be API for that other than potentially utilizing pip's code, the easiest solution would be adding an easy to access advisory warning and heavily request people install AMBuild using 'pip'
example pip command: 'pip install <path_to_ambuild_dir>'
This is also preferred for when install source distributions (.zip/.tar.gz files) or wheel files (.whl).
Another thing to note, should distutils become depreciated and removed, only setuptools will provide a copy of it, and even then, they'll most likely redirect ALL utilizations to setuptools itself. Pip already does this when it goes and installs distutils packages.
from ambuild.
That's all fine, but the current behavior isn't acceptable, so either we have to revert or prevent the double install.
from ambuild.
The double install is only possible for people who have already installed AMBuild before the switch was made.
Installs done after the switch will work as intended.
The least work involve solution would again be to warn about the issue and advise that people install AMBuild using pip. This would also be inline with how packages are usually installed in Python.
Another thing we can do is provide a migratory "wheel" package that people with a previous installation can use, these can only be installed with pip as they're "built" packages (IE: Ready to install, no framework other than pip is required). I have attached a wheel we can use.
AMBuild-2.0-py2.py3-none-any.zip
Note: Wheels are just plain zip files with '.whl' instead of '.zip', GitHub doesn't support '.whl" files.
from ambuild.
"The double install is only possible for people who have already installed AMBuild before the switch was made."
Yes: someone updating (like me) will be broken. Warning isn't acceptable, because warnings are ignored and there is a lot of spew in the install process. This conflict has to be prevented.
from ambuild.
The only option I can think of is to force people to use pip and not 'setup.py', this could also potentially prepare us should PEP 517 ever get fully accepted.
I may ask on the bpo if the setuptools provided 'distutils' will still be usable or if it's a planned depreciation for even farther into the future.
One way or another, AMBuild is gonna depend on setuptools, whether we do it ourselves or it gets forced on us. (last message in the BPO suggests importing 'distutils' will actually import setuptools modified version) Either way, we may end up with this issue later even while using distutils, but I can't garuntee that.
The wheel can serve as a stop-gap solution as again, only pip can install those which also raises the error if it detects a distutils package. The issue with distutils as it stands is A) It doesn't write what files it installs, forcing pip to bail when handling them & B) it extremely rarely receives updates, this is what spawned the idea of removing it in the first place.
from ambuild.
Again, that's all fine. All I'm saying is: setup.py has to error out if there will be a conflicting install. It's hard to imagine that being impossible. Anyone affected by the migration can then go and rm -rf the old installation. But having it install both copies and then neither work is not a game plan.
from ambuild.
@dvander I'm gonna raise a question on setuptools GitHub repository to see if they can provide assistance, I'll ping you to it as well.
Edit: Until we get a response on the referenced issue, the wheel stop-gap is the best I can come up with.
from ambuild.
A really dumb solution would be just looking through the system package path and seeing if "ambuild2" is there, and aborting. The setuptools installed paths look pretty different.
from ambuild.
@dvander I think I may have found a more reliable "dummy solution":
distutils creates a file with the extension ".egg-info" and plops it alongside the ambuild packages, wheel/egg installs on the otherhand keep this file in a sub-folder instead.
from ambuild.
If in the objdir/sourcedir, that sounds unideal since then a second copy would break.
from ambuild.
I was talking about the site_packages folder.
Anyway, incase you didn't look at the setuptools issue I created, there is plans to depreciate the use of 'setup.py install' and that using that can break Python environments...
from ambuild.
@dvander Is it alright if I file pull requests with all projects that install AMBuild if it's not already installed, these pull requests will swap the checkout-deps scripts to using pip
/pip3
instead of straight invoking setup.py install
from ambuild.
Yup, that's fine, we should change the AMBuild documentation as well.
from ambuild.
And, if "setup.py install" shouldn't be used, we should forbid using it.
from ambuild.
Ok, I'll begin setting up PRs for the repos who's checkout-deps scripts install AMBuild.
from ambuild.
@dvander PRs are done, AMTL gave me the worst headache to deal with though...
Edit: Sorry if I may of ended up flooding your inbox.
from ambuild.
Only SourceMod's remains (It also has a SM issue tied to it)
from ambuild.
I think this can now officially be closed. Any further issues regarding this change should go into it's own issue now.
from ambuild.
Remaining: need to block CLI setup.py installs and change documentation. I can do the latter pretty quickly, not sure about the former.
from ambuild.
The former has to be done on the pip/setuptools end, the only other thing we could do is switch to PEP 517 format, but that is experimental at best.
from ambuild.
@dvander I also made some documentation changes for AMBuild, I also fixed the 'pip install' command on it as what you wrote fails (as PIP would look on PyPi instead of locally)
from ambuild.
This remains open (and reverts possible) until we've addressed all the installation issues. I'll take a look tonight.
from ambuild.
On the Pull Request I opened for Steamworks, you mentioned that CI should be using tagged releases of AMBuild and not straight git cloning, I propose we switched to tagged releases and provide universal wheels that can be downloaded and installed.
This will accomplish restricting the usage of setup.py
as it's not being distributed while the "source" zip GitHub automatically provides can also be downloaded and installed by PIP (testing required) which will include setup.py
Building wheels requires setuptools as distutils doesn't include 'bdist_wheel' command
Edit: Yes, install source zips is supported by PIP.
PS C:\Users\lollo\Downloads> pip install ./ambuild-master.zip
Defaulting to user installation because normal site-packages is not writeable
Processing c:\users\lollo\downloads\ambuild-master.zip
Building wheels for collected packages: AMBuild
Building wheel for AMBuild (setup.py) ... done
Created wheel for AMBuild: filename=AMBuild-2.0-py3-none-any.whl size=144128 sha256=8f88d893a5819dacf57ff7e9e3653db6c0288c82fd9ce7fc8ee7069035c20208
Stored in directory: c:\users\lollo\appdata\local\pip\cache\wheels\77\21\2c\2f4b889ddfdf5a9608a3baf9f194b2fd43a2b7763f2ff4219f
Successfully built AMBuild
Installing collected packages: AMBuild
WARNING: The script ambuild.exe is installed in 'C:\Users\lollo\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed AMBuild-2.0
from ambuild.
I don't particularly care how CIs install ambuild, as long as it works. They always have the option of pinning to a specific rev. I just created the "2.1-distutils" tag so SteamWorks can checkout to that version as a quick fix if desired.
from ambuild.
Actually, you needed to checkout the commit first before creating the tag.
I managed to create one that actually is pinned to the last commit you're referencing (If you want to look):
https://github.com/WildCard65/ambuild/releases/tag/2.1_distutils
Here's the command:
git checkout 0db7a7d8d0869c1d70159d9d0fa168ae48e615be
from ambuild.
Is my attempt to fix this. I've tested it locally, and I get:
You have a previous installation of AMBuild. AMBuild must
now be installed by pip (see README.md). To prevent
conflicts, please remove the old distutils install. You can
do this by inspecting the following locations and removing
any ambuild folders:
/usr/local/lib/python3.8/dist-packages
Aborting installation.
It's by no means perfect but unless there's anything better, I'm happy to settle it at that.
from ambuild.
Thanks for updating the doc. Aside from third-party CI (which can check out an older rev), I think this is all in a much better state now. pip is much better than distutils.
from ambuild.
Related Issues (20)
- Windows can't generate configs for ambuild. HOT 2
- How to change to vs ? i wanna debug project HOT 1
- [clang/macOS/2.2 API] does not output build errors from individual source files HOT 1
- Visual Studio project generation broken after Dep removal HOT 1
- Can't compile with MSVC in normal command prompt HOT 2
- [Question] Could i upgrade AMBuild to use other compiler, e.g. Sourcepawn? HOT 1
- Add copy-all-files-in-directory version of builder.AddCopy
- Compiler has no attribute preprocessArgs
- pip future deprecation: inplace built HOT 2
- Add support for msvc17 "2022" gen
- Add full rebuild option HOT 1
- error when installing on Windows 11 HOT 5
- how to enable exceptions? HOT 1
- test-c.exe and test-cxx.exe detected as trojans HOT 1
- PicklingError under python 3.9.13
- Custom tools are ignored in project generators
- Console color doesn't reset properly on windows cmd/terminal if protoc is used HOT 1
- Can't specify path in hl2sdk-manifests option HOT 2
- [Suggestion] Generate compilation database
- Configure script fails if compiler is in PATH on Windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ambuild.