digitalmars.D.learn - How to build a package as application ?
- guiguidu60 (6/6) Jul 02 2019 I'm a newbie with D language, and my first problem ever is:
- Andre Pany (6/12) Jul 02 2019 Executable is automatically chosen if you have a source code file
- guiguidu60 (3/16) Jul 02 2019 It doesn't work...
- Les De Ridder (4/22) Jul 02 2019 What file manager are you using?
- guiguidu60 (4/27) Jul 02 2019 I'm on Debian 10, with Nautilus (v3.30.5) as file explorer.
- Les De Ridder (8/37) Jul 02 2019 As I suspected, it's because it's a PIE executable, so this issue
- guiguidu60 (4/24) Jul 02 2019 Ahh ok, thanks !
- Les De Ridder (21/47) Jul 02 2019 Currently you can't, AFAICT.
- guiguidu60 (4/13) Jul 02 2019 I'm sad... So, it's necessary to update DMD for get around this
- Paul Backus (4/9) Jul 02 2019 It sounds like this is a bug in your file explorer's file-type
- guiguidu60 (2/11) Jul 02 2019 DUB and DMD (for example) are correctly detected as applications.
- guiguidu60 (5/14) Jul 02 2019 After verification, it's not a bug from the file explorer but the
I'm a newbie with D language, and my first problem ever is: I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).
Jul 02 2019
On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:I'm a newbie with D language, and my first problem ever is: I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).Executable is automatically chosen if you have a source code file with name "app.d". Otherwise set targetType to executable in your dub.json. Kind regards André
Jul 02 2019
On Tuesday, 2 July 2019 at 10:43:08 UTC, Andre Pany wrote:On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:It doesn't work... Who decide if a file is an application or a sharedlib ?I'm a newbie with D language, and my first problem ever is: I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).Executable is automatically chosen if you have a source code file with name "app.d". Otherwise set targetType to executable in your dub.json. Kind regards André
Jul 02 2019
On Tuesday, 2 July 2019 at 14:49:49 UTC, guiguidu60 wrote:On Tuesday, 2 July 2019 at 10:43:08 UTC, Andre Pany wrote:What file manager are you using? Could you perhaps upload an example binary that gets detected wrong?On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:It doesn't work... Who decide if a file is an application or a sharedlib ?I'm a newbie with D language, and my first problem ever is: I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).Executable is automatically chosen if you have a source code file with name "app.d". Otherwise set targetType to executable in your dub.json. Kind regards André
Jul 02 2019
On Tuesday, 2 July 2019 at 16:44:12 UTC, Les De Ridder wrote:On Tuesday, 2 July 2019 at 14:49:49 UTC, guiguidu60 wrote:I'm on Debian 10, with Nautilus (v3.30.5) as file explorer. You can download the helloworld program with this link: https://mega.nz/#!rY1QWIhK!lKyIX192OEfKM8MsZ_WW_QNryl39yCQebkXts2qn7E0On Tuesday, 2 July 2019 at 10:43:08 UTC, Andre Pany wrote:What file manager are you using? Could you perhaps upload an example binary that gets detected wrong?On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:It doesn't work... Who decide if a file is an application or a sharedlib ?I'm a newbie with D language, and my first problem ever is: I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).Executable is automatically chosen if you have a source code file with name "app.d". Otherwise set targetType to executable in your dub.json. Kind regards André
Jul 02 2019
On Tuesday, 2 July 2019 at 16:56:52 UTC, guiguidu60 wrote:On Tuesday, 2 July 2019 at 16:44:12 UTC, Les De Ridder wrote:As I suspected, it's because it's a PIE executable, so this issue is not specific to D. Going down the rabbit hole: https://bugzilla.gnome.org/show_bug.cgi?id=737849 https://bugs.freedesktop.org/show_bug.cgi?id=97226 https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/11On Tuesday, 2 July 2019 at 14:49:49 UTC, guiguidu60 wrote:I'm on Debian 10, with Nautilus (v3.30.5) as file explorer. You can download the helloworld program with this link: https://mega.nz/#!rY1QWIhK!lKyIX192OEfKM8MsZ_WW_QNryl39yCQebkXts2qn7E0On Tuesday, 2 July 2019 at 10:43:08 UTC, Andre Pany wrote:What file manager are you using? Could you perhaps upload an example binary that gets detected wrong?On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:It doesn't work... Who decide if a file is an application or a sharedlib ?I'm a newbie with D language, and my first problem ever is: I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).Executable is automatically chosen if you have a source code file with name "app.d". Otherwise set targetType to executable in your dub.json. Kind regards André
Jul 02 2019
On Tuesday, 2 July 2019 at 17:14:23 UTC, Les De Ridder wrote:On Tuesday, 2 July 2019 at 16:56:52 UTC, guiguidu60 wrote:Ahh ok, thanks ! The bug is old... how can I develop D applications without having to suffer this bug ?On Tuesday, 2 July 2019 at 16:44:12 UTC, Les De Ridder wrote:As I suspected, it's because it's a PIE executable, so this issue is not specific to D. Going down the rabbit hole: https://bugzilla.gnome.org/show_bug.cgi?id=737849 https://bugs.freedesktop.org/show_bug.cgi?id=97226 https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/11On Tuesday, 2 July 2019 at 14:49:49 UTC, guiguidu60 wrote:I'm on Debian 10, with Nautilus (v3.30.5) as file explorer. You can download the helloworld program with this link: https://mega.nz/#!rY1QWIhK!lKyIX192OEfKM8MsZ_WW_QNryl39yCQebkXts2qn7E0[...]What file manager are you using? Could you perhaps upload an example binary that gets detected wrong?
Jul 02 2019
On Tuesday, 2 July 2019 at 17:29:51 UTC, guiguidu60 wrote:On Tuesday, 2 July 2019 at 17:14:23 UTC, Les De Ridder wrote:Currently you can't, AFAICT. Many Linux distros these days make PIE the default for Clang/GCC, because PIE allows for more ASLR, a common modern security hardening measure. Because D uses the C compiler to link your application, this default will be passed down to the linker. Because of the order in which D passes args down to the linker, there doesn't seem to be a way to override this (unless you link manually, e.g. by appending `-no-pie` to the clang/gcc command you get with `dmd -v <sources>`). It might make sense to change dmd's behaviour so it explicitly passes `-no-pie` to the C compiler when it's not being called with `-fPIC`. In any case, the bug is still not D's fault and will also occur with e.g. C programs compiled without `-no-pie` (and probably most executables in /usr/bin!).On Tuesday, 2 July 2019 at 16:56:52 UTC, guiguidu60 wrote:Ahh ok, thanks ! The bug is old... how can I develop D applications without having to suffer this bug ?On Tuesday, 2 July 2019 at 16:44:12 UTC, Les De Ridder wrote:As I suspected, it's because it's a PIE executable, so this issue is not specific to D. Going down the rabbit hole: https://bugzilla.gnome.org/show_bug.cgi?id=737849 https://bugs.freedesktop.org/show_bug.cgi?id=97226 https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/11On Tuesday, 2 July 2019 at 14:49:49 UTC, guiguidu60 wrote:I'm on Debian 10, with Nautilus (v3.30.5) as file explorer. You can download the helloworld program with this link: https://mega.nz/#!rY1QWIhK!lKyIX192OEfKM8MsZ_WW_QNryl39yCQebkXts2qn7E0[...]What file manager are you using? Could you perhaps upload an example binary that gets detected wrong?
Jul 02 2019
On Tuesday, 2 July 2019 at 19:49:32 UTC, Les De Ridder wrote:On Tuesday, 2 July 2019 at 17:29:51 UTC, guiguidu60 wrote:I'm sad... So, it's necessary to update DMD for get around this problem :/ Thanks for your help :)[...]Currently you can't, AFAICT. Many Linux distros these days make PIE the default for Clang/GCC, because PIE allows for more ASLR, a common modern security hardening measure. [...]
Jul 02 2019
On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).It sounds like this is a bug in your file explorer's file-type detection code. If it works in the terminal, it should work in the file explorer too.
Jul 02 2019
On Tuesday, 2 July 2019 at 15:29:44 UTC, Paul Backus wrote:On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:DUB and DMD (for example) are correctly detected as applications.I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).It sounds like this is a bug in your file explorer's file-type detection code. If it works in the terminal, it should work in the file explorer too.
Jul 02 2019
On Tuesday, 2 July 2019 at 15:29:44 UTC, Paul Backus wrote:On Tuesday, 2 July 2019 at 08:50:36 UTC, guiguidu60 wrote:After verification, it's not a bug from the file explorer but the problem come from DUB or DMD... because, I'm able to open my program with a file archiver and see its contents (it's not possible with a real application).I have a hello world program build with DUB on Linux, but the program as marked as "application/x-sharedlib" and not "application/x-executable" (in properties of the file): so, I can't able to execute the program from the file explorer (need to do ./helloworld within a terminal).It sounds like this is a bug in your file explorer's file-type detection code. If it works in the terminal, it should work in the file explorer too.
Jul 02 2019