Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Executable file doesnt exist #58

Closed
Ratione opened this issue Apr 20, 2014 · 7 comments
Closed

Executable file doesnt exist #58

Ratione opened this issue Apr 20, 2014 · 7 comments

Comments

@Ratione
Copy link

Ratione commented Apr 20, 2014

I am able to complie D programs via the Terminal (I am running Eclipse on Ubuntu 14.04) but every time i try and run a project it fails to build and gives me this error:
"Executable file (/fakepathto/workspace/test/test) doesnt exist."
Build automatically is already selected, but it refuses to compile.

@bruno-medeiros
Copy link
Contributor

I need more info here. What is the dub.json of your project like? When you save a file (a therefore trigger a build), what is the output of the the "dub build" process that is invoked by Eclipse? This should appear in the console.

@neonsamurai
Copy link

I have the same problem. Here is the console output:

************  Running DUB build  ************
/usr/bin/dub build
@ /home/tim/workspace/tutorial
tutorial: ["tutorial"]
Building tutorial configuration "library", build type debug.
Running dmd...
--------  Terminated, exit code: 0  --------

@neonsamurai
Copy link

Ok I fixed the problem:

The dub.json file does not contain the key "targetType" : "executable". Thus the project is compiled as library and no executable is built.

Hope that helps others.

I think it would be nice if DDT would ask for the type of desired configuration when creating a new project.

@bruno-medeiros
Copy link
Contributor

if the DUB build doesn't produce an executable, there is nothing DDT can do here, other than perhaps show a nicer error message.

If the DUB build produces an executable, but only on certain configurations, then the issue is #49

@neonsamurai
Copy link

There is a misunderstanding it seems.

From what I can see in DDT:

  • I create a new DUB project.
  • This creates a few files in the desired location:
.
├── dub.json
└── source

(source being empty)

dub.json:

{
    "name" : "test",
    "description" : "A minimal D bundle.",
    "dependencies" : {
    }
}

... and following console output:

************  Running DUB build  ************
/usr/bin/dub build --force
@ /home/tim/workspace/test
Package test contains no source files. Please add {"targetType": "none"} to it's package description to avoid building it.
Error executing command build: Main package must have a binary target type, not none. Cannot build.

--------  Terminated, exit code: 2  --------

So in essence, a freshly generated project does not compile, since it seems to be misconfigured. IMHO either the targetType should be none by default (which is kinda crazy) or there should be provided a simple .d file (maybe with a 'hello world' example) so that the project can compile. However even if there would be such a file, dub.json would still be configured in a way that does not produce an executable but a library file.

Which leads me to my previously mentioned point, that DDT should provide choice (executable or library) on project creation and configure the dub.json accordingly.

Unless I am terribly mistaken.

@userxfce
Copy link
Contributor

I thik I just made a similar suggestion in my comments on #63

@bruno-medeiros
Copy link
Contributor

Note that under DUB rules, if a "app.d" file is present, DUB will try to build with application type, so it's not necessary to explicitly state "targetType" in dub.json

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

No branches or pull requests

4 participants