Thread overview
DMD test suite not runnable on Debian/Linux
Jun 09, 2017
H. S. Teoh
Jun 09, 2017
Seb
Jun 10, 2017
Jacob Carlborg
Jun 09, 2017
ketmar
June 09, 2017
I'm trying to track down an autotester failure in a DMD PR, and getting very frustrated that the DMD test suite does not run on Debian/Linux because of the whole PIE-by-default fiasco that necessitates compiling everything with -fPIC.

(1) Currently, there is no way to customize how test/Makefile compiles d_do_tests.d, so there is no way to insert -fPIC into the offending compile line.

(2) d_do_tests itself runs compile commands with `-conf=`, so putting -fPIC inside dmd.conf has no effect (where otherwise it does the right thing when dmd is invoked "normally"). There's no obvious way to make customize the compile command used for each test: I tried setting the environment variable ARGS but that just messed up the test runner's expected outputs. Tried to add -fPIC to the DMD environment variable but that blew up in a different way.

So basically, I'm stuck up PIE creek without a paddle, and have no way to locally test DMD changes without hogging more load on the autotester.

Why is something so simple so hard to do?!


T

-- 
Жил-был король когда-то, при нём блоха жила.
June 09, 2017
On Friday, 9 June 2017 at 22:14:30 UTC, H. S. Teoh wrote:
> I'm trying to track down an autotester failure in a DMD PR, and getting very frustrated that the DMD test suite does not run on Debian/Linux because of the whole PIE-by-default fiasco that necessitates compiling everything with -fPIC.
>
> (1) Currently, there is no way to customize how test/Makefile compiles d_do_tests.d, so there is no way to insert -fPIC into the offending compile line.

Once this PR is merged, it will at least use the default conf file:

https://github.com/dlang/dmd/pull/6870

(the config file is now in generated and this lead to nice errors on my machine)

> (2) d_do_tests itself runs compile commands with `-conf=`, so putting -fPIC inside dmd.conf has no effect (where otherwise it does the right thing when dmd is invoked "normally"). There's no obvious way to make customize the compile command used for each test: I tried setting the environment variable ARGS but that just messed up the test runner's expected outputs. Tried to add -fPIC to the DMD environment variable but that blew up in a different way.

Do you mean DFLAGS with DMD environment variable?

> So basically, I'm stuck up PIE creek without a paddle, and have no way to locally test DMD changes without hogging more load on the autotester.

Don't worry about that. It's just a computer. As a temporary workaround, docker might be worth considering.

> Why is something so simple so hard to do?!

I think it's simply because not many people use the DMD test suite and those who do are used to the pain or have their custom-built tricks.
Also I guess that there are two groups of people:

A) wow that's complicated and frustrating -> move on to the next great thing in life
B) eh what the heck. I have seen worse...

(And not many in-between).


June 10, 2017
it's even worser than that: unittests ultimatively fails with binutils 2.28 (at least on x86 without PIC), so i was forced to downgrade binutils to 2.26.
June 10, 2017
On 2017-06-10 00:34, Seb wrote:

> Don't worry about that. It's just a computer. As a temporary workaround,
> docker might be worth considering.

Wow. Just modify the Makefile.

-- 
/Jacob Carlborg