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

Build fails with SCons 4.2.0 and newer #351

Closed
code8buster opened this issue Oct 1, 2021 · 8 comments
Closed

Build fails with SCons 4.2.0 and newer #351

code8buster opened this issue Oct 1, 2021 · 8 comments

Comments

@code8buster
Copy link

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
Copy link
Author

code8buster commented Oct 24, 2021

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

@dresco
Copy link

dresco commented Nov 8, 2021

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
Copy link
Author

code8buster commented Nov 23, 2021

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
Copy link

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
Copy link
Contributor

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 added a commit that referenced this issue Mar 14, 2022
@jcoffland jcoffland changed the title Building camotics with build script fails CAMotics build fails with SCons 4.2.0 and newer Mar 14, 2022
@jcoffland jcoffland changed the title CAMotics build fails with SCons 4.2.0 and newer Build fails with SCons 4.2.0 and newer Mar 14, 2022
@jcoffland
Copy link
Member

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

@tirithen
Copy link

Thanks! :)

@code8buster
Copy link
Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants