CauldronDevelopmentLLC / CAMotics

Open-Source Simulation & Computer Aided Machining - A 3-axis CNC GCode simulator
Other
622 stars 143 forks source link

Build fails with SCons 4.2.0 and newer #351

Closed code8buster closed 2 years ago

code8buster commented 3 years ago

I'm using the script in scripts/build to build camotics with embedded_v8 and cbang Keep getting this error and warning: scons: warning: QT5DIR variable is not defined, using moc executable as a hint (QT5DIR=/usr) ... (some stuff in here checking libraries/headers) ... scons: *** [build/camotics/qt/moc_AboutDialog.cc] TypeError _defines() missing 2 required positional arguments: 'target' and 'source'' trying to evaluate${_defines(QT5_MOCDEFPREFIX, CPPDEFINES, QT5_MOCDEFSUFFIX, env)}' scons: building terminated because of errors.

code8buster commented 3 years ago

This is a problem with scons 4.2.0 Downgraded to scons 4.1.0 and the program compiled

dresco commented 3 years ago

Hi, @jcoffland any thoughts on a workaround for this? Am facing the same issue on Fedora 35 (where 4.2.0 is the earliest available scons). Thanks!

code8buster commented 3 years ago

Install it with pip3, as a workaround pip3 install SCons==4.1.0.post1 https://pypi.org/project/SCons/#history

Make sure to uninstall any package-manager installed versions of SCons or user-local pip package

tirithen commented 2 years ago

I'm facing similar problems on Arch Linux from the AUR packages camotics (https://aur.archlinux.org/packages/camotics#comment-849352) and camotics-git (https://aur.archlinux.org/packages/camotics-git#comment-835431).

Is related to a larger task to get it compiling with scons 4.3.0 (and possibly also 4.2.0)?

hpmachining commented 2 years ago

Thanks to the link @jhdub23 provided I came up with this patch to build the latest commit with scons 4.3.0.

--- a/config/qt5/__init__.py
+++ b/config/qt5/__init__.py
@@ -763,7 +763,7 @@ def generate(env):
         QT5_MOCDEFPREFIX = '-D',
         QT5_MOCDEFSUFFIX = '',
         QT5_MOCDEFINES = '${_defines(QT5_MOCDEFPREFIX, CPPDEFINES, '
-        'QT5_MOCDEFSUFFIX, __env__)}',
+        'QT5_MOCDEFSUFFIX, __env__, TARGET, SOURCE)}',
         QT5_MOCCPPPATH = [],
         QT5_MOCINCFLAGS = '$( ${_concat(QT5_MOCINCPREFIX, QT5_MOCCPPPATH, '
         'INCSUFFIX, __env__, RDirs)} $)',
jcoffland commented 2 years ago

I added a fix that should work for both newer and older SCons versions.

tirithen commented 2 years ago

Thanks! :)

code8buster commented 2 years ago

Thank you.