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

waf / wscript cleanup #663

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

waf / wscript cleanup #663

wants to merge 11 commits into from

Conversation

kiilerix
Copy link
Contributor

This adds consistency but shouldn't cause any functional change.

See the individual changesets and commit messages for clearest review, and cherry-pick any good parts.

@x42
Copy link
Member

x42 commented Jan 26, 2022

Looks good at a quick glance, and wow that's is a nice cleanup!

It's rather larger, so please allow for a few days to review it in full.

@kiilerix
Copy link
Contributor Author

Thanks. Let me know if you have questions - I might have stared at it so long that I fail to see what isn't obvious.

@kiilerix
Copy link
Contributor Author

kiilerix commented Feb 3, 2022

@x42 - a gentle ping ;-)

@x42
Copy link
Member

x42 commented Apr 8, 2022

I still have a hard time to digest this. It's huge!
I would also have to test if it is compatible with python2 (macOS still ships that)

It is apparently only used in gtk2_ardour/wscript - and it seems to be
enough to load it in configure(), even though it is used in build().
autowaf has no real shutdown functionality anyway. The automatic
shutdown function that could have been called wouldn't work anyway, as
it takes an argument.

The only reason it doesn't fail is that the top level wscript has no
shutdown handling and doesn't recurse to other scripts, so it is all
dead code.
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.
Put it in the "children" list instead of recursing explicitly.

The only difference is that the (empty) options function in
libs/clearlooks-newer/wscript now will be invoked - before it wasn't.
The sub_config_and_use function recursed, but it also invoked
autowaf.set_local_lib , which however didn't do anything useful. The
HAVE_ defines are not used anywhere, and the AUTOWAF_LOCAL defines are
only used in autowaf.use_lib, which however isn't used anywhere.

Dropping these defines simplify the build environment and makes the
compiler command line half as long and thus makes debugging much more
manageable.
It will already have been converted to str in sanitize(), and even
python2 is fine without the extra str.
CC is already set to a string. (And if it ever should be None, we want
to handle that explicitly.)

(And #autowaf.display_msg handle Booleans just fine.)
… applying str() all over

This can perhaps be simplified further when Python2 support is dropped.
@kiilerix
Copy link
Contributor Author

@pauldavisthefirst how about landing this now, after 8.0 has been released?

@pauldavisthefirst
Copy link
Contributor

manually rebased and merged.

@pauldavisthefirst
Copy link
Contributor

Alas, these changes broke the Windows builds:

https://nightly.ardour.org/i/A_WIN_x86_64/build_log.txt

We will try reverting "wscript: drop unnecessary str() on configure variable"

@x42
Copy link
Member

x42 commented Oct 16, 2023

Since the server's build-log is not persistent. waf configure fails:

  File "/home/ardour/ardour-w64/.waf-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Scripting.py", line 119, in waf_entry_point
    run_commands()
  File "/home/ardour/ardour-w64/.waf-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Scripting.py", line 182, in run_commands
    ctx=run_command(cmd_name)
  File "/home/ardour/ardour-w64/.waf-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Scripting.py", line 173, in run_command
    ctx.execute()
  File "/home/ardour/ardour-w64/.waf-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Configure.py", line 85, in execute
    super(ConfigurationContext,self).execute()
  File "/home/ardour/ardour-w64/.waf-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Context.py", line 92, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/home/ardour/ardour-w64/.waf-2.0.26-44bc421a5f6bb452d70d83cbd5abc3fa/waflib/Context.py", line 133, in recurse
    user_function(self)
  File "/home/ardour/ardour-w64/wscript", line 1462, in configure
    set_compiler_flags (conf, Options.options)
  File "/home/ardour/ardour-w64/wscript", line 522, in set_compiler_flags
    if re.search ('x86_64-w64', conf.env['CC']) is not None:
  File "/usr/lib/python2.7/re.py", line 146, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

@x42
Copy link
Member

x42 commented Oct 16, 2023

I have reverted 615326b to get builds going again.

@x42 x42 closed this Oct 16, 2023
@x42 x42 reopened this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants