[Issue 23729] ignore custom object.d for CTFE needs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 23 17:05:28 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23729

--- Comment #10 from Dennis <dkorpel at live.nl> ---
> dmd shouldn't use my object.d, it has nothing to do with COMPILING the program, 
> therefore it is a bug

The druntime and phobos sources are not hardwired into the compiler, they are
found using the same lookup mechanism as other d source files, where the
current working directory is the first import path.

If you don't want the compiler to use your own object.d as the implicitly
imported module and source of druntime hooks, then you should name it something
else. However, it's clear that you fully intend to replace object.d because you
want a custom runtime, so that's not the solution.

> So it is a bug in the compiler, because he don't understand that DMD should 
> use its object.d, not mine

Okay, let's say we add a special rule that object.d is only found in the
installation's druntime folder. Then you don't have your custom lightweight
runtime anymore, and all WASM incompatible dependencies are still dragged in.

So what you really want is that your own object.d is used for 'code generation
purposes', and the official object.d is used for 'CTFE purposes'. That's
completely intractable. No compiler developer, let alone D user, is going to
understand how that works.

I don't see anything actionable in this issue, apart from making the druntime
more pay as you go. That has long been a goal already, and would obviate the
need for a custom lightweight druntime in the first place. But that's not a bug
you can fix in an afternoon.

--


More information about the Digitalmars-d-bugs mailing list