#480 Merged at c30b586
Repository
Deleted repository
Branch
default (c30b586a779e)
Repository
SCons
Branch
default

Fix some longstanding bugs with D tooling

Author
  1. Russel Winder
Reviewers
Description

The principal change here is never to allow DC not to have a value. Detect can sometimes fail to detect the executable and does so silently. Also now that DMD and LDC support shared objects on OSX/MacOS allow those tests to run.

  • DMD and LDC do now support shared objects on MacOS. A couple of corrections.
  • Always provide a value for DC, never leave it unset: Detect can fail to find an executable.

Added some additional commits to this changeset to deal with shared object handling on OSX. LDC has been able to do this for a while now. As indeed has DMD, except that rpath works with LDC but not DMD. Thus only LDC shared objects on OSX and macOS is enabled and tested.

Comments (4)

  1. William Deegan

    How do other tools handle not finding the tools they require? Are we consistent with this? Ideally we would be.

    Note that handling not finding an explicitly requested tool is not handled very well at present. Some users may expect that if the tool is not found that the variable would be None, or blank.

  2. Russel Winder author

    All the other tools just specify the name of the compiler and leave it to another stage to generate an error if it is not actually available. I have switched the ldc tool and the gdc tool to follow the same strategy. This stops a really awkward situation for users when they see command lines that make no sense. The dmd tool has three (well actually there are more, but lets leave that for now as they are unlikely to get tested) compilers to choose from, so a Detect is the right thing to do before plumping for dmd using the same strategy as other tools. So I believe what was originally here just solved that. However, I think the changeset has changed.

    I was trying to use bookmarks to line up a few pull requests so as to keep them all small and tightly focused, but BitBucket appears to have merged two bookmarks together in a way I hadn't anticipated. So we have a few more changes in this changeset now. However they are OK, I believe, in that they are exposing new behaviour to tests that were there but not executed. LDC, and supposedly DMD (but…) are now supposed to handle shared objects on OSX/macOS. So I amended the test and corrected the rpath prefix. I am annoyed that these two have been merged together, but it will be more effort to unpick them than to just take them together. I will be more careful with my bookmarks in future – I think I know what happened.

    I have just rerun the 1121 tests on El Capitan and there seems no failure just correctly "no result" (no gdc). All the tests run fine on Debian Sid with dmd, ldc2, and gdc, and on Fedora Rawhide with just ldc2.

  3. Russel Winder author

    All the test pass or don't run exactly as they should on all my platforms. So I think this is now good to go.

    There is the possibility of failure obviously, but I do not think the SCons Buildbot will find the "dark corner" I am suspicious of.