Re: Using DUB packages with Meson
On Thursday, 27 April 2023 at 20:48:45 UTC, Richard (Rikki) Andrew Cattermole wrote: On 28/04/2023 1:43 AM, Denis Feklushkin wrote: On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky wrote: And I did fetch & build What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub fetch? On dubs end yes, and yes. $ dub build package@version I guess I didn't express myself that way How to get list of packages that can be passed to DUB by this way as above?
Re: Using DUB packages with Meson
On 28/04/2023 1:43 AM, Denis Feklushkin wrote: On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky wrote: And I did fetch & build What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub fetch? On dubs end yes, and yes. $ dub build package@version ``` $ dub search knocker registry at https://code.dlang.org/ (fallbacks registry at https://codemirror.dlang.org/, registry at https://dub.byt ecraft.nl/, registry at https://code-mirror.dlang.io/) knocker (1.0.3) Knocks on ports to open up another. Compatible with Knockd. ``` You can also get the entire manifest from dub-registry directly if you want it (you shouldn't need it).
Re: Using DUB packages with Meson
On Wednesday, 12 April 2023 at 10:06:22 UTC, Dmitry Olshansky wrote: And I did fetch & build What are possible ways to automate such download? Meson knows exactly which versions of packages suit to build. Is it possible, for example, to get somehow packages list and then download using dub fetch?
Re: Using DUB packages with Meson
On Wednesday, 12 April 2023 at 11:07:56 UTC, Richard (Rikki) Andrew Cattermole wrote: Did you compile the library with dub using ldc2? Yup, I do not have other compilers installed. -- Dmitry Olshansky
Re: Using DUB packages with Meson
Did you compile the library with dub using ldc2?
Re: Using DUB packages with Meson
On Wednesday, 12 April 2023 at 10:24:48 UTC, Richard (Rikki) Andrew Cattermole wrote: I'm going to guess that you need to use the version specifier in the package name. Because I'm not seeing anything there to handle it specifically. https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/dub.py i.e. ``dub build [[@]] []`` So use ``package:sub@1.0.2``. Also I just noticed meson doesn't support shared libraries from dub, so something to keep in mind. I'm getting closer. I'm stuck with this at the moment: Found DUB: /home/d.olshanskiy/bin/dub (DUB version 1.31.1, built on Mar 12 2023) ERROR: strand found but it wasn't compiled with ldc Run-time dependency strand found: NO src/meson.build:22:0: ERROR: Dependency "strand" not found -- Dmitry Olshansky
Re: Using DUB packages with Meson
On Wednesday, 12 April 2023 at 10:24:48 UTC, Richard (Rikki) Andrew Cattermole wrote: I'm going to guess that you need to use the version specifier in the package name. Because I'm not seeing anything there to handle it specifically. https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/dub.py i.e. ``dub build [[@]] []`` So use ``package:sub@1.0.2``. Also I just noticed meson doesn't support shared libraries from dub, so something to keep in mind. Oh, Rikki, you are so helpful. Thanks! -- Dmitry Olshansky
Re: Using DUB packages with Meson
I'm going to guess that you need to use the version specifier in the package name. Because I'm not seeing anything there to handle it specifically. https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/dub.py i.e. ``dub build [[@]] []`` So use ``package:sub@1.0.2``. Also I just noticed meson doesn't support shared libraries from dub, so something to keep in mind.
Using DUB packages with Meson
I'm trying to use my new DUB package from Photon, which is polyglot project and is built with Meson. Have anyone worked with DUB packages in Meson? I've found this bit of documentation: https://mesonbuild.com/Dependencies.html#dub And I did fetch & build but I do not understand how to introduce library dependency on a specific DUB package. -- Dmitry Olshansky
Re: Local module dependancy using dub
On Friday, 1 October 2021 at 20:59:40 UTC, Winfred Raj wrote: Hello all, I created a project using dub init and got it successfully built with main as the entry point. Dxml was a dependency which was used here. Now I have started another gtkd project using dub init and here I would like to import the first project. How do I go about doing this?? Best regards, Winfred Raj Correction - > I meant import xml_test_d.source.app and not import xml_test_d.source.d Best regards, Winfred Raj
Re: Local module dependancy using dub
On Friday, 1 October 2021 at 21:15:54 UTC, Imperatorn wrote: On Friday, 1 October 2021 at 20:59:40 UTC, Winfred Raj wrote: Hello all, I created a project using dub init and got it successfully built with main as the entry point. Dxml was a dependency which was used here. Now I have started another gtkd project using dub init and here I would like to import the first project. How do I go about doing this?? Best regards, Winfred Raj iirc, something like: ```json "dependencies": { "your-proj":{"path":"../your-proj/"} } ``` Thanks for the reply. ../xml_test_d/source/app.d is the relative path of the file which I want to reuse. In the dependency, I have entered the path (as explained by you) pointing to the xml_test_d folder. Now in my current project what should I import? Should it be "import xml_test_d" or "import app" or import xml_test_d.source.d" or something else?? Best regards, Winfred Raj
Re: Local module dependancy using dub
On Friday, 1 October 2021 at 20:59:40 UTC, Winfred Raj wrote: Hello all, I created a project using dub init and got it successfully built with main as the entry point. Dxml was a dependency which was used here. Now I have started another gtkd project using dub init and here I would like to import the first project. How do I go about doing this?? Best regards, Winfred Raj iirc, something like: ```json "dependencies": { "your-proj":{"path":"../your-proj/"} } ```
Local module dependancy using dub
Hello all, I created a project using dub init and got it successfully built with main as the entry point. Dxml was a dependency which was used here. Now I have started another gtkd project using dub init and here I would like to import the first project. How do I go about doing this?? Best regards, Winfred Raj
Re: How Add Local modules mymodule.d using DUB?
On Monday, 9 August 2021 at 16:32:13 UTC, Marcone wrote: My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you. Let’s assume you just created a dub project in `myproject` with `dub init`. Place `mymodule.d` alongside `app.d` in `myproject/source`. Now you can `import mymodule` in `app.d`. Dub takes care of the linking. — Bastiaan.
Re: How Add Local modules mymodule.d using DUB?
On Monday, 9 August 2021 at 16:37:10 UTC, Steven Schveighoffer wrote: On 8/9/21 12:32 PM, Marcone wrote: My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you. You mean how to add a local project (that isn't on code.dlang.org)? `dub add-local .` inside the project directory. I don't think you can add a file directly without a project, but possibly. -Steve Add module to linker.
Re: How Add Local modules mymodule.d using DUB?
On Monday, 9 August 2021 at 16:37:10 UTC, Steven Schveighoffer wrote: On 8/9/21 12:32 PM, Marcone wrote: My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you. You mean how to add a local project (that isn't on code.dlang.org)? `dub add-local .` inside the project directory. I don't think you can add a file directly without a project, but possibly. -Steve I want add modules as phobos modules, but custom modules.
Re: How Add Local modules mymodule.d using DUB?
On 8/9/21 12:32 PM, Marcone wrote: My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you. You mean how to add a local project (that isn't on code.dlang.org)? `dub add-local .` inside the project directory. I don't think you can add a file directly without a project, but possibly. -Steve
How Add Local modules mymodule.d using DUB?
My main program need import a local module called mymodule.d. How can I add this module using DUB? Thank you.
Re: How send parameters to DMD when using DUB
/+ dub.sdl: dependency "telega" version="~>0.2.0" lflags "C:\\Users\\Usuario\\Arquivos\\Sublime Text Build 3211\\Data\\Packages\\resources.res" platform="dmd" +/ Solved replaceing dflags to lflags
Re: How send parameters to DMD when using DUB
I'm trying this code but do not work. /+ dub.sdl: dependency "telega" version="~>0.2.0" dflags "C:\\Users\\Usuario\\Arquivos\\Sublime Text Build 3211\\Data\\Packages\\resources.res" platform="dmd" +/
How send parameters to DMD when using DUB
I need add resources. But how can I make it using DUB?
Re: using dub and -checkaction=context
On 1/18/21 7:48 AM, Mathias LANG wrote: On Sunday, 17 January 2021 at 20:42:06 UTC, Steven Schveighoffer wrote: On 1/17/21 2:27 PM, Anonymouse wrote: On Sunday, 17 January 2021 at 15:41:45 UTC, Steven Schveighoffer wrote: I'm trying to run unittests using `dub test`, and I wanted to use the new -checkaction=context feature to avoid having to instrument my unittests to print out the string comparison failure that's happening. But I tried adding this to my dub.sdl file: dflags "-checkaction=context" platform="dmd" But now I get linker errors: /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/appmain.d:(.text._D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv]+0x5c): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' https://issues.dlang.org/show_bug.cgi?id=19937 ? Slightly different error message though. Yeah, that's probably it. Hm... this feature isn't very usable if I can't use it with dub. And the bug report you linked to also has an example that fails with straight dmd (even without unittests). Yeah, it's currently not usable, because DMD thinks the template is already instantiated in Phobos / druntime. I tried to work around it in my projects and it didn't work out. OK, good to know. I didn't spend too much time on it. I want to enable it by default but there's 2 issues blocking it ATM (see https://github.com/dlang/dmd/pull/11925). Once that PR is green, we can enable it when compiling druntime / Phobos and your linker errors will disappear. Looking forward to that! Also, dub-wise, you can't really use `-preview` before the latest release. That's why we added https://github.com/dlang/dub/commit/cd9b30e04813108c05abf97d97a42daf466eabdb ... Yeah, this isn't exactly a preview switch, but the dub feature is definitely necessary. Another thought -- can the frontend specially treat these assert templates with -allinst even when that switch isn't present? Would that solve the problem? -Steve
Re: using dub and -checkaction=context
On Sunday, 17 January 2021 at 20:42:06 UTC, Steven Schveighoffer wrote: On 1/17/21 2:27 PM, Anonymouse wrote: On Sunday, 17 January 2021 at 15:41:45 UTC, Steven Schveighoffer wrote: I'm trying to run unittests using `dub test`, and I wanted to use the new -checkaction=context feature to avoid having to instrument my unittests to print out the string comparison failure that's happening. But I tried adding this to my dub.sdl file: dflags "-checkaction=context" platform="dmd" But now I get linker errors: /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/appmain.d:(.text._D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv]+0x5c): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' https://issues.dlang.org/show_bug.cgi?id=19937 ? Slightly different error message though. Yeah, that's probably it. Hm... this feature isn't very usable if I can't use it with dub. And the bug report you linked to also has an example that fails with straight dmd (even without unittests). -Steve Yeah, it's currently not usable, because DMD thinks the template is already instantiated in Phobos / druntime. I tried to work around it in my projects and it didn't work out. I want to enable it by default but there's 2 issues blocking it ATM (see https://github.com/dlang/dmd/pull/11925). Once that PR is green, we can enable it when compiling druntime / Phobos and your linker errors will disappear. Also, dub-wise, you can't really use `-preview` before the latest release. That's why we added https://github.com/dlang/dub/commit/cd9b30e04813108c05abf97d97a42daf466eabdb ...
Re: using dub and -checkaction=context
On 1/17/21 2:27 PM, Anonymouse wrote: On Sunday, 17 January 2021 at 15:41:45 UTC, Steven Schveighoffer wrote: I'm trying to run unittests using `dub test`, and I wanted to use the new -checkaction=context feature to avoid having to instrument my unittests to print out the string comparison failure that's happening. But I tried adding this to my dub.sdl file: dflags "-checkaction=context" platform="dmd" But now I get linker errors: /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/appmain.d:(.text._D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv]+0x5c): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' https://issues.dlang.org/show_bug.cgi?id=19937 ? Slightly different error message though. Yeah, that's probably it. Hm... this feature isn't very usable if I can't use it with dub. And the bug report you linked to also has an example that fails with straight dmd (even without unittests). -Steve
Re: using dub and -checkaction=context
On Sunday, 17 January 2021 at 15:41:45 UTC, Steven Schveighoffer wrote: I'm trying to run unittests using `dub test`, and I wanted to use the new -checkaction=context feature to avoid having to instrument my unittests to print out the string comparison failure that's happening. But I tried adding this to my dub.sdl file: dflags "-checkaction=context" platform="dmd" But now I get linker errors: /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/appmain.d:(.text._D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv]+0x5c): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' https://issues.dlang.org/show_bug.cgi?id=19937 ? Slightly different error message though.
using dub and -checkaction=context
I'm trying to run unittests using `dub test`, and I wanted to use the new -checkaction=context feature to avoid having to instrument my unittests to print out the string comparison failure that's happening. But I tried adding this to my dub.sdl file: dflags "-checkaction=context" platform="dmd" But now I get linker errors: /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/appmain.d:(.text._D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCg7PayloadVEQEtQEs24RefCountedAutoInitializei0ZQFm6__dtorMFNaNbNiZv]+0x5c): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/.dub/build/epoll-$DFLAGS-linux.posix-x86_64-dmd_2093-6D60905058E56B7C24E84CCDF9B29FD3/libvibe_core.a(sync_1456_5e95.o): In function `_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi0ZQBd6unlockMFNeZ9__lambda1MFNbNfZv': /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/core/sync.d:(.text._D4vibe4core4sync__T22RecursiveTaskMutexImplVbi0ZQBd6unlockMFNeZ9__lambda1MFNbNfZv[_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi0ZQBd6unlockMFNeZ9__lambda1MFNbNfZv]+0xb7): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/.dub/build/epoll-$DFLAGS-linux.posix-x86_64-dmd_2093-6D60905058E56B7C24E84CCDF9B29FD3/libvibe_core.a(sync_145a_5e95.o): In function `_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi1ZQBd6unlockMFNeZ9__lambda1MFNbNfZv': /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/source/vibe/core/sync.d:(.text._D4vibe4core4sync__T22RecursiveTaskMutexImplVbi1ZQBd6unlockMFNeZ9__lambda1MFNbNfZv[_D4vibe4core4sync__T22RecursiveTaskMutexImplVbi1ZQBd6unlockMFNeZ9__lambda1MFNbNfZv]+0xb7): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' /home/steves/.dub/packages/vibe-core-1.10.1/vibe-core/.dub/build/epoll-$DFLAGS-linux.posix-x86_64-dmd_2093-6D60905058E56B7C24E84CCDF9B29FD3/libvibe_core.a(typecons_91_11ed.o): In function `_D3std8typecons__T10RefCountedTSQBe9container10binaryheap__T10BinaryHeapTSQCuQBq5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCgS_DQCeQCcQCaQBy3ascFNfKQCzKQDdZbZQEt4DataVEQHjQHi24RefCountedAutoInitializei0ZQIc6__dtorMFNaNbNiZv': /home/steves/.dvm/compilers/dmd-2.093.1/linux/bin/../../src/phobos/std/typecons.d:(.text._D3std8typecons__T10RefCountedTSQBe9container10binaryheap__T10BinaryHeapTSQCuQBq5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCgS_DQCeQCcQCaQBy3ascFNfKQCzKQDdZbZQEt4DataVEQHjQHi24RefCountedAutoInitializei0ZQIc6__dtorMFNaNbNiZv[_D3std8typecons__T10RefCountedTSQBe9container10binaryheap__T10BinaryHeapTSQCuQBq5array__T5ArrayTS4vibe4core4sync18LocalTaskSemaphore12ThreadWaiterZQCgS_DQCeQCcQCaQBy3ascFNfKQCzKQDdZbZQEt4DataVEQHjQHi24RefCountedAutoInitializei0ZQIc6__dtorMFNaNbNiZv]+0x5c): undefined reference to `_D4core8internal7dassert__T14_d_assert_failVAyaa1_3eTmTiZQBeFNaNbNiNfKxmxiZQBf' How am I supposed to do this? I tried setting DFLAGS and LDFLAGS and still linker errors. What am I doing wrong? -Steve
Re: How do I statically build a project using DUB?
On Sunday, 30 August 2020 at 02:38:52 UTC, Kirill wrote: I am trying to link the GTK library. I have the GTK Runtime installed on Windows 10 pc. Unless things have changed in the last few years, GTK is not intended to be linked statically on Windows. You'll have to figure out how to compile it yourself as a static library. I recall reading about this a while back. IIRC, there were also some source changes required. Then there's also the matter of licensing. GTK is released under the LGPL, which means if you statically link then your executable is considered a derivative work and must abide by the distribution terms of the LGPL. Do I need to build the static GTK library from the source? Then how do I tell DUB to include that library? DUB has a "libs" directive in the build settings: https://dub.pm/package-format-sdl.html#build-settings https://dub.pm/package-format-json.html#build-settings
Re: How do I statically build a project using DUB?
On Saturday, 29 August 2020 at 12:06:38 UTC, Andre Pany wrote: On Saturday, 29 August 2020 at 11:27:28 UTC, Kirill wrote: I need a stand-alone executable that does not require the user to install any libraries on their computer. Everything should be packed into the executable. I understand that I need to statically link all of the libraries I use in my project, but how do I do this? What do I need to add to dub.json file? What compiler flags do I need to use? Thanks in advance. This highly depends on your actual project: - which 3rd party dependencies do you have - are these dependencies d source code only or wrapping C libraries - is the c source code of your dependencies available and you are able to create a static library of them - does the license of the c dependencies allows static linking Kind regards Andre I am trying to link the GTK library. I have the GTK Runtime installed on Windows 10 pc. Do I need to build the static GTK library from the source? Then how do I tell DUB to include that library?
Re: How do I statically build a project using DUB?
On Saturday, 29 August 2020 at 11:27:28 UTC, Kirill wrote: I need a stand-alone executable that does not require the user to install any libraries on their computer. Everything should be packed into the executable. I understand that I need to statically link all of the libraries I use in my project, but how do I do this? What do I need to add to dub.json file? What compiler flags do I need to use? Thanks in advance. It may be extremely difficult if you intend to also link libc; the gethostbyname DNS functions in glibc do not support static linking. OTOH you can create a fairly portably binary by static linking everything EXCEPT libc (I.e., do not pass -static flag to linker) — here you would need to link to the .a files of all your projects library deps as well as your dependencies dependencies...
Re: How do I statically build a project using DUB?
On Saturday, 29 August 2020 at 11:27:28 UTC, Kirill wrote: I need a stand-alone executable that does not require the user to install any libraries on their computer. Everything should be packed into the executable. I understand that I need to statically link all of the libraries I use in my project, but how do I do this? What do I need to add to dub.json file? What compiler flags do I need to use? Thanks in advance. In dub.json: "libs": ["exlib1", "exlib2"], For any libexlib1.a or exlib2.lib, omit the extensions. You can also do it like: "lflags": ["-lstdc++"],
Re: How do I statically build a project using DUB?
On Saturday, 29 August 2020 at 11:27:28 UTC, Kirill wrote: I need a stand-alone executable that does not require the user to install any libraries on their computer. Everything should be packed into the executable. I understand that I need to statically link all of the libraries I use in my project, but how do I do this? What do I need to add to dub.json file? What compiler flags do I need to use? Thanks in advance. This highly depends on your actual project: - which 3rd party dependencies do you have - are these dependencies d source code only or wrapping C libraries - is the c source code of your dependencies available and you are able to create a static library of them - does the license of the c dependencies allows static linking Kind regards Andre
How do I statically build a project using DUB?
I need a stand-alone executable that does not require the user to install any libraries on their computer. Everything should be packed into the executable. I understand that I need to statically link all of the libraries I use in my project, but how do I do this? What do I need to add to dub.json file? What compiler flags do I need to use? Thanks in advance.
Re: How to organize a project with local scripts in subdirectories using dub?
On Wednesday, 11 December 2019 at 16:06:30 UTC, drug wrote: Add to dub.json: "targetType": "executable" and it will build executable. Or rename evaluator.d to app.d It is confused that there is no app.d so it thinks that you build a library. I added "targetType" and now everything works without renaming to the script to "app.d". Thank you!
Re: How to organize a project with local scripts in subdirectories using dub?
On 12/11/19 6:52 PM, Pavel Shkadzko wrote: It works like this, yes. However, by default it builds a "library" while I want to run "evaluator" as a script which uses other scripts by calling their functions. Doing: dub --compiler=ldc2 --single evaluator.d // throws an error source\evaluator.d(93,12): Error: module runme_1 is in file 'runme_1.d' which cannot be read Add to dub.json: "targetType": "executable" and it will build executable. Or rename evaluator.d to app.d It is confused that there is no app.d so it thinks that you build a library.
Re: How to organize a project with local scripts in subdirectories using dub?
On Wednesday, 11 December 2019 at 13:00:32 UTC, drug wrote: I would restructure your folders this way: my_proj/ source/ script_1/runme_1.d script_2/runme_2.d evaluator.d then using `dub --compiler=ldc2` It works like this, yes. However, by default it builds a "library" while I want to run "evaluator" as a script which uses other scripts by calling their functions. Doing: dub --compiler=ldc2 --single evaluator.d // throws an error source\evaluator.d(93,12): Error: module runme_1 is in file 'runme_1.d' which cannot be read
Re: How to organize a project with local scripts in subdirectories using dub?
On 12/11/19 2:18 PM, Pavel Shkadzko wrote: I have the following project structure. my_proj/ script_1/runme_1.d script_2/runme_2.d evaluator.d The project has a library dependency: "dependencies": { "mir": "~>3.2.0", }, The "evaluator.d" script contains some general functions that convert dataset and pass it to "runme_1.d" and "runme_2.d" scripts the following way: import mir.ndslice; void main() { import script_1.runme_1 : runTask1; import script_2.runme_2 : runTask2; mir_slice!(real*, 1LU, cast(mir_slice_kind)2)[]) dataset = convertDataset("data.txt"); runTask1(dataset); //runTask2(dataset); //disable for now } So, basically what I need is to be able to run "./evaluator" and get the results by running the corresponding scripts. I am trying to build the project the following way: dub build --compiler=ldc2 --single evaluator.d I get the following error: Performing "debug" build using ldc2 for x86_64. mir-core 1.0.2: target for configuration "library" is up to date. mir-algorithm 3.7.2: target for configuration "default" is up to date. mir-linux-kernel 1.0.1: target for configuration "library" is up to date. mir-random 2.2.8: target for configuration "extended" is up to date. survey ~master: building configuration "application"... lld-link: error: undefined symbol: _D5runme_114runTask1FS3mir7ndslice5slice__T9mir_sliceTPeVmi2VEQBoQBnQBi14mir_slice_kindi2ZQBvZv referenced by C:\Users\user\my_proj\evaluator.d:89 .dub\obj\evaluator.obj:(_Dmain) Error: linking with LLD failed ldc2 failed with exit code 1. How should I organize my project for this kind of setup? (I am sorry for the absence of code formatting. I could not find any quick howto here) I would restructure your folders this way: my_proj/ source/ script_1/runme_1.d script_2/runme_2.d evaluator.d then using `dub --compiler=ldc2`
How to organize a project with local scripts in subdirectories using dub?
I have the following project structure. my_proj/ script_1/runme_1.d script_2/runme_2.d evaluator.d The project has a library dependency: "dependencies": { "mir": "~>3.2.0", }, The "evaluator.d" script contains some general functions that convert dataset and pass it to "runme_1.d" and "runme_2.d" scripts the following way: import mir.ndslice; void main() { import script_1.runme_1 : runTask1; import script_2.runme_2 : runTask2; mir_slice!(real*, 1LU, cast(mir_slice_kind)2)[]) dataset = convertDataset("data.txt"); runTask1(dataset); //runTask2(dataset); //disable for now } So, basically what I need is to be able to run "./evaluator" and get the results by running the corresponding scripts. I am trying to build the project the following way: dub build --compiler=ldc2 --single evaluator.d I get the following error: Performing "debug" build using ldc2 for x86_64. mir-core 1.0.2: target for configuration "library" is up to date. mir-algorithm 3.7.2: target for configuration "default" is up to date. mir-linux-kernel 1.0.1: target for configuration "library" is up to date. mir-random 2.2.8: target for configuration "extended" is up to date. survey ~master: building configuration "application"... lld-link: error: undefined symbol: _D5runme_114runTask1FS3mir7ndslice5slice__T9mir_sliceTPeVmi2VEQBoQBnQBi14mir_slice_kindi2ZQBvZv referenced by C:\Users\user\my_proj\evaluator.d:89 .dub\obj\evaluator.obj:(_Dmain) Error: linking with LLD failed ldc2 failed with exit code 1. How should I organize my project for this kind of setup? (I am sorry for the absence of code formatting. I could not find any quick howto here)
Re: using dub to compile plugins
On Fri, 21 Dec 2018 10:56:39 +, Atila Neves wrote: > I don't see how you can do this with dub, and I wouldn't attempt it > either. Just use make, and have make call dub for the main project (and > potentially any plugins that need it). Remember to make the dub targets > `.PHONY` since you don't want to be managing the D dependencies by hand. Or you could have it depend on dub.sdl, dub.selections.json, your D source files, and your string import files. Which is a bit more work but will result in a little less recompilation.
Re: using dub to compile plugins
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote: I am currently using this dub.sdl name"runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin source directory to be separate from main source directory and compile the plugins (.so) to a (binary) plugins directory (the plugins will be dynamically loaded at runtime - I've previously done this in C so I don't anticipate any particular issues - famous last words!) I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub. can someone show me a concrete example of doing this ? Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file... Unless the plugins have dub dependencies, don't use dub for it. Plugins that do can have their own dub.sdl/json with targetType "dynamicLibrary". Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file... I don't see how you can do this with dub, and I wouldn't attempt it either. Just use make, and have make call dub for the main project (and potentially any plugins that need it). Remember to make the dub targets `.PHONY` since you don't want to be managing the D dependencies by hand.
Re: using dub to compile plugins
On Wednesday, 19 December 2018 at 16:31:57 UTC, Andre Pany wrote: On Wednesday, 19 December 2018 at 14:08:10 UTC, Codifies wrote: On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote: On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote: [...] You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre how could I have multiple dub files in the same directory for each plugin ??? You have sub folders in which you create the dub.sdl files. In your main dub.sdl you include these folders as sub packages. Regarding the automatic logic you ideally want to have: there is the plan to add dub extension plugins. Unfortunately a hero is needed to implement it. Kind regards Andre I was planning to have all the plugin sources in one directory otherwise I'd have loads of folders all over the place... I think Make is the way forward!
Re: using dub to compile plugins
On Wednesday, 19 December 2018 at 14:08:10 UTC, Codifies wrote: On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote: On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote: [...] You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre how could I have multiple dub files in the same directory for each plugin ??? You have sub folders in which you create the dub.sdl files. In your main dub.sdl you include these folders as sub packages. Regarding the automatic logic you ideally want to have: there is the plan to add dub extension plugins. Unfortunately a hero is needed to implement it. Kind regards Andre
Re: using dub to compile plugins
On Wed, 19 Dec 2018 12:57:14 +, Codifies wrote: > I could do this with a few simple rules in a Makefile, but I have no > clue how to achieve this using dub. If you need dub, you can create a wrapper script that generates the dub file for the plugins directory. Make is a lot better for this kind of thing.
Re: using dub to compile plugins
On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote: On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote: [...] You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre how could I have multiple dub files in the same directory for each plugin ???
Re: using dub to compile plugins
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote: I am currently using this dub.sdl name"runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin source directory to be separate from main source directory and compile the plugins (.so) to a (binary) plugins directory (the plugins will be dynamically loaded at runtime - I've previously done this in C so I don't anticipate any particular issues - famous last words!) I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub. can someone show me a concrete example of doing this ? Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file... You can use dub sub packages. Each plugin will be a dub package with its own dub descriptor (sdl) file. For your main dub sdl you set targetType to None. Kind regards Andre
Re: using dub to compile plugins
oh forgot to add just for extra pain while the main application won't need gtk, most of the plugins will...
using dub to compile plugins
I am currently using this dub.sdl name"runz80" targetType "executable" lflags "libz80/libz80.a" however I will be creating a number of plugins, each plugin will consist of a single source file, I'd like the plugin source directory to be separate from main source directory and compile the plugins (.so) to a (binary) plugins directory (the plugins will be dynamically loaded at runtime - I've previously done this in C so I don't anticipate any particular issues - famous last words!) I could do this with a few simple rules in a Makefile, but I have no clue how to achieve this using dub. can someone show me a concrete example of doing this ? Ideally just dropping a new source file into the plugins source folder should produce a new .so the next time dub is run, without having to explicitly add each plugin to the dub file...
Re: Using dub and rdmd together?
On Wednesday, 11 July 2018 at 16:43:24 UTC, Seb wrote: I don't know of an easy way to do out of the box. However, with dmd's new -i option, it could be as easy as: --- dub fetch requests cat > test.d << EOF import std.stdio; import requests; void main() { auto content = postContent("http://httpbin.org/post";, queryParams("name", "any name", "age", 42)); writeln(content); } EOF dub fetch requests dmd -I~/.dub/packages/requests-0.8.2/requests/source -i -run tests.d --- However, dmd itself doesn't do any caching (though it would work similarly with rdmd). But, of course, this won't work for more complex dub packages. There's `dub describe` (and a backend generator) for which they might be used. So this is kind of similar to what dub does already? Would be nice if dub could cache such compiled scripts somewhere. I mean dub already caches inside .dub folder in a dub project. Why not also cache compiled scripts somewhere?
Re: Using dub and rdmd together?
On Wednesday, 11 July 2018 at 16:13:56 UTC, Matthew OConnor wrote: Hi, I'm new to D and trying to make some command line tools that are run with `#!/usr/bin/env rdmd`. But I would also like to reference external packages from dub. I know I can do this with: #!/usr/bin/env dub /+ dub.sdl: name "get" dependency "requests" version="~>0.3.2" +/ But when I run it (with `dub get.d` on Windows), it rebuilds every time. Is there a way to integrate the two so that `rdmd` is used for the builds, but `dub` is used to download the necessary packages? Thanks, Matthew I don't know of an easy way to do out of the box. However, with dmd's new -i option, it could be as easy as: --- dub fetch requests cat > test.d << EOF import std.stdio; import requests; void main() { auto content = postContent("http://httpbin.org/post";, queryParams("name", "any name", "age", 42)); writeln(content); } EOF dub fetch requests dmd -I~/.dub/packages/requests-0.8.2/requests/source -i -run tests.d --- However, dmd itself doesn't do any caching (though it would work similarly with rdmd). But, of course, this won't work for more complex dub packages. There's `dub describe` (and a backend generator) for which they might be used.
Using dub and rdmd together?
Hi, I'm new to D and trying to make some command line tools that are run with `#!/usr/bin/env rdmd`. But I would also like to reference external packages from dub. I know I can do this with: #!/usr/bin/env dub /+ dub.sdl: name "get" dependency "requests" version="~>0.3.2" +/ But when I run it (with `dub get.d` on Windows), it rebuilds every time. Is there a way to integrate the two so that `rdmd` is used for the builds, but `dub` is used to download the necessary packages? Thanks, Matthew
Re: how to link self made lib using dub
On Friday, 6 July 2018 at 21:13:37 UTC, Timoses wrote: Shouldn't this be 'import output'? nah, because I didn't import source directly, I import experiment so in order to use it, I do source/output.d, which when importing module means, source.output and this '...\\experiment\\source\\'? (I'm not accustomed to Windows..) nope, because I want to do make some sort of a package thing You could also add a dependency to your other dub project and dub should automatically add the import and linker flags. Add this to your dub.json: "dependencies": { "experiment": {"version": "*", "path": "../experiment"} } I didn't test this now, but it should work something like that (again, not sure about Windows path...). See also: http://code.dlang.org/package-format?lang=json#version-specs huh, didn't know I could do that
Re: how to link self made lib using dub
On Friday, 6 July 2018 at 17:08:48 UTC, Flaze07 wrote: [...] then, I made a project, with this main in this path : Z:\programming\D\experimentLib\source\main.d it contains this module main; import std.stdio; import source.output; Shouldn't this be 'import output'? void main( string[] args ) { Output.write( "lol" ); readln(); } and then, I have a dub file in this path : Z:\programming\D\experimentLib\dub.json it contains : { "name" : "experimentlib", "targetType": "executable", "targetPath": "bin", "importPaths": [ "Z:\\programming\\D\\usefulFiles\\experiment\\", and this '...\\experiment\\source\\'? (I'm not accustomed to Windows..) ], "lflags": [ "+Z:\\programming\\D\\usefulFiles\\experiment\\lib\\", ], } so, I have made lflags to include the lib in experiment, but still, it failed to linker ( it compiles fine, but the linker fails ) You could also add a dependency to your other dub project and dub should automatically add the import and linker flags. Add this to your dub.json: "dependencies": { "experiment": {"version": "*", "path": "../experiment"} } I didn't test this now, but it should work something like that (again, not sure about Windows path...). See also: http://code.dlang.org/package-format?lang=json#version-specs
how to link self made lib using dub
I have been trying to link self made .lib, and have tried to use it several times, I failed.. so, here I have a file in this path : Z:\programming\D\usefulFiles\experiment\source\output.d it has module output; class Output { public: static void write( string msg ) { import std.stdio; writeln( msg ); } } and then I compiled it into library using dub project with this file in a path : Z:\programming\D\usefulFiles\experiment\dub.json { "name" : "experiment", "targetType": "library", "targetPath": "lib", "sourcePaths": [ "source", ], } then, I made a project, with this main in this path : Z:\programming\D\experimentLib\source\main.d it contains this module main; import std.stdio; import source.output; void main( string[] args ) { Output.write( "lol" ); readln(); } and then, I have a dub file in this path : Z:\programming\D\experimentLib\dub.json it contains : { "name" : "experimentlib", "targetType": "executable", "targetPath": "bin", "importPaths": [ "Z:\\programming\\D\\usefulFiles\\experiment\\", ], "lflags": [ "+Z:\\programming\\D\\usefulFiles\\experiment\\lib\\", ], } so, I have made lflags to include the lib in experiment, but still, it failed to linker ( it compiles fine, but the linker fails )
Re: Need advice on using DUB registry
02.04.2017 17:43, Eric пишет: On Sunday, 2 April 2017 at 04:14:56 UTC, rikki cattermole wrote: On 02/04/2017 2:37 AM, Eric wrote: I'm planning on some day putting a package in the DUB registry. My package is dependent on my "util" package which is a collection of stuff I use across all my projects. Does this mean I also have to put my util package in the DUB registry? Could I just make "util" a git sub module of the package I want to release? Dub can't use git submodules. In fact it doesn't know anything about git! So is the answer to my question, "yes, you need to put your util package in the DUB registry also?" You can clone git submodules using preBuildCommands in dub.sdl. Also you can use add-local and add this package to dub locally (but of course it won't work for others). And the finally put your package to dub registry. I do all of them depending on the situation.
Re: Need advice on using DUB registry
On Sunday, 2 April 2017 at 04:14:56 UTC, rikki cattermole wrote: On 02/04/2017 2:37 AM, Eric wrote: I'm planning on some day putting a package in the DUB registry. My package is dependent on my "util" package which is a collection of stuff I use across all my projects. Does this mean I also have to put my util package in the DUB registry? Could I just make "util" a git sub module of the package I want to release? Dub can't use git submodules. In fact it doesn't know anything about git! So is the answer to my question, "yes, you need to put your util package in the DUB registry also?"
Re: Need advice on using DUB registry
On 02/04/2017 2:37 AM, Eric wrote: I'm planning on some day putting a package in the DUB registry. My package is dependent on my "util" package which is a collection of stuff I use across all my projects. Does this mean I also have to put my util package in the DUB registry? Could I just make "util" a git sub module of the package I want to release? Dub can't use git submodules. In fact it doesn't know anything about git!
Need advice on using DUB registry
I'm planning on some day putting a package in the DUB registry. My package is dependent on my "util" package which is a collection of stuff I use across all my projects. Does this mean I also have to put my util package in the DUB registry? Could I just make "util" a git sub module of the package I want to release?
Re: Using Dub
On Mon, 2017-01-16 at 16:47 +, cym13 via Digitalmars-d-learn wrote: > […] > > What do you mean it failed? I did that on another computer to > test and it works flawlessly for me. > > […] trying a settings.sdl file failed setting.json works. -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a digitally signed message part
Re: Using Dub
On Mon, 2017-01-16 at 16:51 +, cym13 via Digitalmars-d-learn wrote: > […] > Oh, maybe you're on windows, in which case the settings.json file > must be placed in either $ProgramData\dub or in $APPDATA\dub. > Relevant lines of dub.d: > https://github.com/dlang/dub/blob/master/source/dub/dub.d#L165 Windows is anathema. -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a digitally signed message part
Re: Using Dub
On Monday, 16 January 2017 at 16:47:29 UTC, cym13 wrote: On Monday, 16 January 2017 at 10:59:33 UTC, Russel Winder wrote: On Mon, 2017-01-16 at 10:47 +, cym13 via Digitalmars-d-learn wrote: On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder wrote: > On Sun, 2017-01-15 at 17:44 +, cym13 via > Digitalmars-d-learn wrote: > > [...] > > Will an SDL file also work? I don't think so, but as that's about the only option you can put in that file it's ok to use JSON. I tried it, it failed. :-( Humans should never have to manually write XML or JSON. What do you mean it failed? I did that on another computer to test and it works flawlessly for me. This configuration file can contain only two options: default compiler and urls to reach when looking for packets. It's litterally 3 lines, while I support the fact that one should never have to write XML that's about as concise as it can get. Oh, maybe you're on windows, in which case the settings.json file must be placed in either $ProgramData\dub or in $APPDATA\dub. Relevant lines of dub.d: https://github.com/dlang/dub/blob/master/source/dub/dub.d#L165
Re: Using Dub
On Monday, 16 January 2017 at 10:59:33 UTC, Russel Winder wrote: On Mon, 2017-01-16 at 10:47 +, cym13 via Digitalmars-d-learn wrote: On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder wrote: > On Sun, 2017-01-15 at 17:44 +, cym13 via > Digitalmars-d-learn wrote: > > On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder > > wrote: > > > Is there any way of setting dub to default to ldc2 > > > rather than dmd as the compiler of use? (I do not want > > > to have to put --compiler ldc2 on every dub command.) > > > > Create a file ~/.dub/settings.json with the following > > content: > > > > { > > "defaultCompiler": "ldc2" > > } > > Will an SDL file also work? I don't think so, but as that's about the only option you can put in that file it's ok to use JSON. I tried it, it failed. :-( Humans should never have to manually write XML or JSON. What do you mean it failed? I did that on another computer to test and it works flawlessly for me. This configuration file can contain only two options: default compiler and urls to reach when looking for packets. It's litterally 3 lines, while I support the fact that one should never have to write XML that's about as concise as it can get.
Re: Using Dub
On Monday, 16 January 2017 at 09:40:55 UTC, Russel Winder wrote: On the one hand Cargo works wonderfully with Rust so I had hoped Dub would work wonderfully with D. Sadly I am finding it doesn't. Possibly my fault, but still annoying. Cargo does not have multiple Rust compilers as an option. Dub could look to find for compiler if it is not set, but that may disappoint users who have multiple compilers installed (myself included)...
Re: Using Dub
On Mon, 2017-01-16 at 10:47 +, cym13 via Digitalmars-d-learn wrote: > On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder wrote: > > On Sun, 2017-01-15 at 17:44 +, cym13 via > > Digitalmars-d-learn wrote: > > > On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder > > > wrote: > > > > Is there any way of setting dub to default to ldc2 rather > > > > than dmd as the compiler of use? (I do not want to have to > > > > put --compiler ldc2 on every dub command.) > > > > > > Create a file ~/.dub/settings.json with the following content: > > > > > > { > > > "defaultCompiler": "ldc2" > > > } > > > > Will an SDL file also work? > > I don't think so, but as that's about the only option you can put > in that file it's ok to use JSON. I tried it, it failed. :-( Humans should never have to manually write XML or JSON. -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a digitally signed message part
Re: Using Dub
On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder wrote: On Sun, 2017-01-15 at 17:44 +, cym13 via Digitalmars-d-learn wrote: On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote: > Is there any way of setting dub to default to ldc2 rather > than dmd as the compiler of use? (I do not want to have to > put --compiler ldc2 on every dub command.) Create a file ~/.dub/settings.json with the following content: { "defaultCompiler": "ldc2" } Will an SDL file also work? I don't think so, but as that's about the only option you can put in that file it's ok to use JSON.
Re: Using Dub
On Sun, 2017-01-15 at 17:44 +, cym13 via Digitalmars-d-learn wrote: > On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote: > > Is there any way of setting dub to default to ldc2 rather than > > dmd as the compiler of use? (I do not want to have to put > > --compiler ldc2 on every dub command.) > > Create a file ~/.dub/settings.json with the following content: > > { > "defaultCompiler": "ldc2" > } Will an SDL file also work? -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a digitally signed message part
Re: Using Dub
On Sun, 2017-01-15 at 17:25 +, Daniel N via Digitalmars-d-learn wrote: > On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote: > > Is there any way of setting dub to default to ldc2 rather than > > dmd as the compiler of use? (I do not want to have to put > > --compiler ldc2 on every dub command.) > > I have never used dub, but I know it's now also bundled with ldc2. On the one hand Cargo works wonderfully with Rust so I had hoped Dub would work wonderfully with D. Sadly I am finding it doesn't. Possibly my fault, but still annoying. There is a Dub package in Debian. It seems to default to GDC rather than LDC, which is annoying. Meson defaults to LDC, but getting it to handle the Dub repository is going to be impossible I suspect. > I would assume that if your PATH to ldc2 comes before that of > dmd, it would find the ldc2 bundled version of dub and it would > do the smart thing(if not, that's a bug). No DMD installed. Seemingly Dub chooses /usr/bin/gdc over /usr/bin/ldc2. :-( -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a digitally signed message part
Re: Using Dub
On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote: Is there any way of setting dub to default to ldc2 rather than dmd as the compiler of use? (I do not want to have to put --compiler ldc2 on every dub command.) Create a file ~/.dub/settings.json with the following content: { "defaultCompiler": "ldc2" }
Re: Using Dub
On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote: Is there any way of setting dub to default to ldc2 rather than dmd as the compiler of use? (I do not want to have to put --compiler ldc2 on every dub command.) I have never used dub, but I know it's now also bundled with ldc2. I would assume that if your PATH to ldc2 comes before that of dmd, it would find the ldc2 bundled version of dub and it would do the smart thing(if not, that's a bug).
Using Dub
Is there any way of setting dub to default to ldc2 rather than dmd as the compiler of use? (I do not want to have to put --compiler ldc2 on every dub command.) -- Russel. = Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Roadm: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder signature.asc Description: This is a digitally signed message part
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Saturday, 17 December 2016 at 04:58:45 UTC, Mike Parker wrote: On Friday, 16 December 2016 at 22:37:13 UTC, hardreset wrote: To be honest I was having some odd linking problems anyway. I initially wrapped the FT init function in plain D function and that kept causing "_FT_ not found" link errors. As soon as I took all the actual D functions out and left just FT declarations in there it stopped. Even now if I add... int foo() { return 0; } to my freetype.d (contains just FT interface declarations) and call it from font.d (my font class) i start getting linker errors. Why would adding a plain D function suddenly make it sound the linker cant find what it needs in the freetype.lib? The only thing I can think of offhand: did you compile and link your freetype.d? As long as it's just interface declarations, there's no need to -- it only needs to be on the import path. But once you start adding implementations, it needs to be compiled and linked into the executable. Yeah that was it. I had it in a separate folder for libs and mistakenly assumed that because it was importing OK that mean it was being compiled and linked too. I moved it into the source folder and it worked fine! It makes sense now. thanks for the help!
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Friday, 16 December 2016 at 22:37:13 UTC, hardreset wrote: To be honest I was having some odd linking problems anyway. I initially wrapped the FT init function in plain D function and that kept causing "_FT_ not found" link errors. As soon as I took all the actual D functions out and left just FT declarations in there it stopped. Even now if I add... int foo() { return 0; } to my freetype.d (contains just FT interface declarations) and call it from font.d (my font class) i start getting linker errors. Why would adding a plain D function suddenly make it sound the linker cant find what it needs in the freetype.lib? The only thing I can think of offhand: did you compile and link your freetype.d? As long as it's just interface declarations, there's no need to -- it only needs to be on the import path. But once you start adding implementations, it needs to be compiled and linked into the executable.
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Friday, 16 December 2016 at 00:40:07 UTC, Mike Parker wrote: On Thursday, 15 December 2016 at 20:34:47 UTC, hardreset wrote: On Thursday, 15 December 2016 at 18:30:14 UTC, hardreset wrote: I have pragma(lib,**fullpath**) in my freetype.d file, is that the correct way? Never mind, figured it out, I needer to add "libs": ["libs/freetype27ST"] to dub.json The pragma alone should have been enough. Did you get the path right? At any rate, if you're adding that line to dub.json, then the pragma is redundant. They both do the same thing. Im pretty sure i did, i tried absolute path, relative, just filename, copied from address bar, etc.. To be honest I was having some odd linking problems anyway. I initially wrapped the FT init function in plain D function and that kept causing "_FT_ not found" link errors. As soon as I took all the actual D functions out and left just FT declarations in there it stopped. Even now if I add... int foo() { return 0; } to my freetype.d (contains just FT interface declarations) and call it from font.d (my font class) i start getting linker errors. Why would adding a plain D function suddenly make it sound the linker cant find what it needs in the freetype.lib?
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Thursday, 15 December 2016 at 20:34:47 UTC, hardreset wrote: On Thursday, 15 December 2016 at 18:30:14 UTC, hardreset wrote: I have pragma(lib,**fullpath**) in my freetype.d file, is that the correct way? Never mind, figured it out, I needer to add "libs": ["libs/freetype27ST"] to dub.json The pragma alone should have been enough. Did you get the path right? At any rate, if you're adding that line to dub.json, then the pragma is redundant. They both do the same thing.
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Thursday, 15 December 2016 at 18:30:14 UTC, hardreset wrote: On Thursday, 15 December 2016 at 03:47:27 UTC, Mike Parker wrote: [1] https://github.com/DerelictOrg/DerelictFT Thanks, I'm trying the "-m32mscoff" method for now, but I get "error LNK2019: unresolved external symbol _FT_Init_FreeType referenced" I have pragma(lib,**fullpath**) in my freetype.d file, is that the correct way? Never mind, figured it out, I needer to add "libs": ["libs/freetype27ST"] to dub.json
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Thursday, 15 December 2016 at 03:47:27 UTC, Mike Parker wrote: On Wednesday, 14 December 2016 at 23:08:30 UTC, hardreset wrote: As Basile recommended, DerelictFT[1] will save you from the hassle of object formats. It's a dynamic binding, so you don't need to link with FreeType at all during compilation. You simply call DerelictFT.load during initialization and it will load the FreeType DLL for you. However, if your goal is to use DLLs, then you either have to use the MS linker as I described above or get FreeType into the OMF format (either by compiling with DMC or using an object converter). [1] https://github.com/DerelictOrg/DerelictFT Thanks, I'm trying the "-m32mscoff" method for now, but I get "error LNK2019: unresolved external symbol _FT_Init_FreeType referenced" I have pragma(lib,**fullpath**) in my freetype.d file, is that the correct way?
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Wednesday, 14 December 2016 at 23:08:30 UTC, hardreset wrote: I built Freetype with MSVC13 and tried to link it but DMD didnt like the format, so what should compiler (free) should I use for building DMD compatible static libs? The MS linker produces COFF format. By default, DMD uses the OPTLINK linker, which only understands OMF. Assuming DMD is configured to find your MSVC installation, you can link directly with COFF libraries and objects by passing -m64 or -m32mscoff on the DMD command line. With DUB, use -ax86_64 on the command line to make it use -m64. Unfortunately, there is currently no such option for it to use -m32mscoff, so you need to configure it in your dub configuration with a "dflags" directive and make sure any dependencies are compiled that way as well. Once I've build the lib, made a di file, where do I put these things in the dub directory structure? Where ever you want. If you put the di file in your source directory, DUB will pick it up automatically. For libraries, I usually put them in a 'lib' subdirectory and add this in the module with my main method: version(Windows) pragma(lib, `lib\foo.lib`); As Basile recommended, DerelictFT[1] will save you from the hassle of object formats. It's a dynamic binding, so you don't need to link with FreeType at all during compilation. You simply call DerelictFT.load during initialization and it will load the FreeType DLL for you. However, if your goal is to use DLLs, then you either have to use the MS linker as I described above or get FreeType into the OMF format (either by compiling with DMC or using an object converter). [1] https://github.com/DerelictOrg/DerelictFT
Re: Simplest way to build a DMD compatible C lib, and how to link using DUB.
On Wednesday, 14 December 2016 at 23:08:30 UTC, hardreset wrote: I built Freetype with MSVC13 and tried to link it but DMD didnt like the format, so what should compiler (free) should I use for building DMD compatible static libs? Once I've build the lib, made a di file, where do I put these things in the dub directory structure? thanks, Yes under win32 you must use Digital Mars C++ compiler, "DMC", because it produces OMF objects. That's also the default format produced by DMD. DMC is here: http://www.digitalmars.com/download/freecompiler.html However note that there's DerelictFT or Deimos freetype if you don't want to mess with this problem.
Simplest way to build a DMD compatible C lib, and how to link using DUB.
I built Freetype with MSVC13 and tried to link it but DMD didnt like the format, so what should compiler (free) should I use for building DMD compatible static libs? Once I've build the lib, made a di file, where do I put these things in the dub directory structure? thanks,
Using dub to build tutorials
Hello, everyone! I was directed here after asking around on reddit. (https://www.reddit.com/r/d_language/comments/500rdx/complete_beginner_to_game_dev_and_d/) To get straight to the point, I have practically no programming experience, but I did just finish going through Programming in D and I would like to learn how to make games. My plan so far is to learn how to use dub and build the samples here: https://github.com/d-gamedev-team/opengl-tutorials/tree/master/ports/opengl-tutorial.org I'm using the DMD compiler and I have downloaded DUB and know that "init" makes a project and that's about it. So, here are some questions! 1) I've downloaded the binaries of the dependencies listed. Do I need to do anything with them to get them to work? I don't know how to add these to the PATH (I'm on Windows 10), but it mentions copying them to a bin folder. Does it matter where the bin folder is added? I'm guessing I only need to include files for code I'm using, but maybe dub does that for me? 2) Does dub automatically download bindings so I can use the libraries with D? (I hope I'm getting the terminology correct here) 3) Do I copy and paste the tutorial code into the app.d file, and replace the contents of the dub.json file with the associated .json of the tutorial? I apologise for asking for a thorough step-by-step of what I need to do to get these running. I'm sure it's second nature to most of you but it's quite bewildering for a newcomer like me to try getting this stuff to work and keep running into problems. I'm thinking of starting a blog to help people get into using D once I know what to do, because I really like the language! The best I've used by far. And if anyone feels like writing guides and documentation for complete newbies, I don't mind being a test subject and hopefully bring in more people interested in programming. Thank you for your time and patience. :)
Using dub configurations with libraries
Let's say I have two dub packages: A and B. A is a library. B is library or application (does not matter) and depends on A. A has several configurations in dub.json. How to build the B package that way it will use non-default configuration of A?
Re: How to make a standalone .a using dub?
On Thursday, 30 July 2015 at 00:14:23 UTC, Yuxuan Shui wrote: Is there a way to have dub pack the library along with all its dependencies into a single .a? And if not, is there any D build system capable of doing this? reggae maybe?
How to make a standalone .a using dub?
Is there a way to have dub pack the library along with all its dependencies into a single .a?
Re: Using dub
[0] http://brew.sh/ Do I just put 'brew dub'? First install brew then $ brew install dub From that it should just be dub to run. Don't forget to restart terminal afterwards or just rerun bash. If dub isn't found, PATH variable will need to be changed via .bashrc. But I'm doubting its needed to be done. Yay! Seems to be working well! Though, I didn't rerun the terminal or any thing. Thanks Rikki!
Re: Using dub
On 29/01/2015 1:24 p.m., Joel wrote: On Wednesday, 28 January 2015 at 23:48:52 UTC, Rikki Cattermole wrote: On 29/01/2015 11:27 a.m., Joel wrote: When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable. What packages? I'm new to Mac OS. Ohh, I was meaning a dmg. But ugh looks like I lied, my bad, only had to do it once. Looks like I used brew[0]. Just install dub, dmd will go along right with it as a dependency. [0] http://brew.sh/ Do I just put 'brew dub'? First install brew then $ brew install dub From that it should just be dub to run. Don't forget to restart terminal afterwards or just rerun bash. If dub isn't found, PATH variable will need to be changed via .bashrc. But I'm doubting its needed to be done.
Re: Using dub
On Wednesday, 28 January 2015 at 23:48:52 UTC, Rikki Cattermole wrote: On 29/01/2015 11:27 a.m., Joel wrote: When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable. What packages? I'm new to Mac OS. Ohh, I was meaning a dmg. But ugh looks like I lied, my bad, only had to do it once. Looks like I used brew[0]. Just install dub, dmd will go along right with it as a dependency. [0] http://brew.sh/ Do I just put 'brew dub'?
Re: Using dub
On 29/01/2015 11:27 a.m., Joel wrote: When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable. What packages? I'm new to Mac OS. Ohh, I was meaning a dmg. But ugh looks like I lied, my bad, only had to do it once. Looks like I used brew[0]. Just install dub, dmd will go along right with it as a dependency. [0] http://brew.sh/
Re: Using dub
When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable. What packages? I'm new to Mac OS.
Re: Using dub
On 28/01/2015 1:34 p.m., Joel wrote: On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. I don't now how to set up the dub executable to work with out doing stuff like this - '../dub' (Mac OS 10.10.1) Joels-MacBook-Pro:window joelcnz$ ../../dub build de_window:test Building package de_window:test in /Users/joelcnz/jpro/dpro2/OtherPeoples/window/ Fetching de_util 0.0.4 (getting selected version)... Placing de_util 0.0.4 to /Users/joelcnz/.dub/packages/... Fetching x11 1.0.5 (getting selected version)... Placing x11 1.0.5 to /Users/joelcnz/.dub/packages/... Fetching de_image 0.3.4 (getting selected version)... Placing de_image 0.3.4 to /Users/joelcnz/.dub/packages/... Fetching derelict-util 1.9.0 (getting selected version)... Placing derelict-util 1.9.0 to /Users/joelcnz/.dub/packages/... Fetching derelict-gl3 1.0.12 (getting selected version)... Placing derelict-gl3 1.0.12 to /Users/joelcnz/.dub/packages/... Building de_util:core 0.0.4 configuration "library", build type debug. Running dmd... Building de_image:interfaces 0.3.4 configuration "library", build type debug. Running dmd... Building de_image:mutable 0.3.4 configuration "library", build type debug. Running dmd... Building x11 1.0.5 configuration "library", build type debug. Running dmd... Building de_window:interfaces 0.0.8 configuration "library", build type debug. Running dmd... Building derelict-util 1.9.0 configuration "library", build type debug. Running dmd... Building derelict-gl3 1.0.12 configuration "library", build type debug. Running dmd... Building de_window:test 0.0.8 configuration "application", build type debug. Compiling using dmd... Linking... Joels-MacBook-Pro:window joelcnz$ ls LICENSEdub.json README.mddub.selections.json WindowsAPIinterfaces cocoa_librarylibde_window_interfaces.a de_window_testplatforms dubtest When I setup dub/dmd on my OSX install, I used the OSX packages and it should already be on the PATH variable.
Re: Using dub
On 28/01/2015 2:14 p.m., Joel wrote: On Wednesday, 28 January 2015 at 00:34:13 UTC, Joel wrote: On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. Actually I got this with dlangui, (I followed the instructions on the announce post): Joels-MacBook-Pro:dlangui joelcnz$ ../../dub run dlangui:example1 Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/dlangui Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/dlangui Error executing command run: Expected version number in version spec: * Ehhh check dub version. * should work fine.
Re: Using dub
On Wednesday, 28 January 2015 at 00:34:13 UTC, Joel wrote: On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. Actually I got this with dlangui, (I followed the instructions on the announce post): Joels-MacBook-Pro:dlangui joelcnz$ ../../dub run dlangui:example1 Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/dlangui Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/dlangui Error executing command run: Expected version number in version spec: *
Re: Using dub
On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. I don't now how to set up the dub executable to work with out doing stuff like this - '../dub' (Mac OS 10.10.1) Joels-MacBook-Pro:window joelcnz$ ../../dub build de_window:test Building package de_window:test in /Users/joelcnz/jpro/dpro2/OtherPeoples/window/ Fetching de_util 0.0.4 (getting selected version)... Placing de_util 0.0.4 to /Users/joelcnz/.dub/packages/... Fetching x11 1.0.5 (getting selected version)... Placing x11 1.0.5 to /Users/joelcnz/.dub/packages/... Fetching de_image 0.3.4 (getting selected version)... Placing de_image 0.3.4 to /Users/joelcnz/.dub/packages/... Fetching derelict-util 1.9.0 (getting selected version)... Placing derelict-util 1.9.0 to /Users/joelcnz/.dub/packages/... Fetching derelict-gl3 1.0.12 (getting selected version)... Placing derelict-gl3 1.0.12 to /Users/joelcnz/.dub/packages/... Building de_util:core 0.0.4 configuration "library", build type debug. Running dmd... Building de_image:interfaces 0.3.4 configuration "library", build type debug. Running dmd... Building de_image:mutable 0.3.4 configuration "library", build type debug. Running dmd... Building x11 1.0.5 configuration "library", build type debug. Running dmd... Building de_window:interfaces 0.0.8 configuration "library", build type debug. Running dmd... Building derelict-util 1.9.0 configuration "library", build type debug. Running dmd... Building derelict-gl3 1.0.12 configuration "library", build type debug. Running dmd... Building de_window:test 0.0.8 configuration "application", build type debug. Compiling using dmd... Linking... Joels-MacBook-Pro:window joelcnz$ ls LICENSE dub.json README.md dub.selections.json WindowsAPI interfaces cocoa_library libde_window_interfaces.a de_window_test platforms dub test
Re: Using dub
Oope, yeah, and it ran.
Re: Using dub
On Tuesday, 27 January 2015 at 07:44:12 UTC, Rikki Cattermole wrote: On 27/01/2015 8:40 p.m., Joel wrote: On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole wrote: On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS. Lets use Devisualization.Window as an example. Assuming in a safe directory and dmd/dub on PATH variable: $ git clone https://github.com/Devisualization/window.git $ cd window $ dub build de_window:test $ ./de_window_test For simple test app: $ mkdir myapp $ cd myapp $ dub init $ nano source/app.d // edit // ctrl + x, y $ dub build $ ./myapp // or $ dub run I get this (dub isn't in the path): Joels-MacBook-Pro:window joelcnz$ ../dub build de_window:test Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Error executing command build: Expected version number in version spec: * Try again after doing: $ rm -rf ~/.dub Something seems ugh, weird. If that doesn't, than its time for dub bug reporting. I've tried an earlier version of dub, similar problem. It was better another time I tried it. I got this now (I didn't do any thing to the dub file): Joels-MacBook-Pro:window joelcnz$ ../../dub build de_window:test Failed to parse package description for dil in /Users/joelcnz/.dub/packages/dil-master/. Failed to load package in /Users/joelcnz/.dub/packages/dil-master/: Got .excludedSourceFiles of type string - expected array. Failed to parse package description for dil in /Users/joelcnz/.dub/packages/dil-master/. Failed to load package in /Users/joelcnz/.dub/packages/dil-master/: Got .excludedSourceFiles of type str
Re: Using dub
On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole wrote: On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS. Lets use Devisualization.Window as an example. Assuming in a safe directory and dmd/dub on PATH variable: $ git clone https://github.com/Devisualization/window.git $ cd window $ dub build de_window:test $ ./de_window_test For simple test app: $ mkdir myapp $ cd myapp $ dub init $ nano source/app.d // edit // ctrl + x, y $ dub build $ ./myapp // or $ dub run I get this (dub isn't in the path): Joels-MacBook-Pro:window joelcnz$ ../dub build de_window:test Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Error executing command build: Expected version number in version spec: *
Re: Using dub
On 27/01/2015 8:40 p.m., Joel wrote: On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole wrote: On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS. Lets use Devisualization.Window as an example. Assuming in a safe directory and dmd/dub on PATH variable: $ git clone https://github.com/Devisualization/window.git $ cd window $ dub build de_window:test $ ./de_window_test For simple test app: $ mkdir myapp $ cd myapp $ dub init $ nano source/app.d // edit // ctrl + x, y $ dub build $ ./myapp // or $ dub run I get this (dub isn't in the path): Joels-MacBook-Pro:window joelcnz$ ../dub build de_window:test Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Error executing command build: Expected version number in version spec: * Try again after doing: $ rm -rf ~/.dub Something seems ugh, weird. If that doesn't, than its time for dub bug reporting.
Re: Using dub
On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS. Lets use Devisualization.Window as an example. Assuming in a safe directory and dmd/dub on PATH variable: $ git clone https://github.com/Devisualization/window.git $ cd window $ dub build de_window:test $ ./de_window_test For simple test app: $ mkdir myapp $ cd myapp $ dub init $ nano source/app.d // edit // ctrl + x, y $ dub build $ ./myapp // or $ dub run
Using dub
I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS.
Re: simple question about using dub to import CyberShadow's aeutils
On Saturday, 3 January 2015 at 12:08:16 UTC, Vladimir Panteleev wrote: On Saturday, 3 January 2015 at 11:58:48 UTC, Laeeth Isharc wrote: import ae.utils; ae.utils is a package, perhaps you meant to import ae.utils.xml? aha. schoolboy error on my part. thank you for your help, and especially for writing such a useful library and sharing it with the world. Laeeth.
Re: simple question about using dub to import CyberShadow's aeutils
On Saturday, 3 January 2015 at 11:58:48 UTC, Laeeth Isharc wrote: import ae.utils; ae.utils is a package, perhaps you meant to import ae.utils.xml?
simple question about using dub to import CyberShadow's aeutils
Hi. I would like to use the XML parser from CyberShadow's ae.utils - I am building a tool to index RSS feeds in elasticsearch (something like rssriver but with more complete functionality). I am using dub to build the code. So far I just have an empty boilerplate app.d with the line import ae.utils; Using the suggestion from code.dlang.org: { ... "dependencies": { "ae": ">=1.0.1" } } It cannot find ae/utils.d If I try replacing the >= with > or just ~master it still does not build. Error text below this message. I suppose this might be because dub is designed to import a single package, and not just part of the hierarchy. But if I change the import to just plain import ae, I still have problems. What am I doing wrong? I could just copy the file over, but I would like to try to do it properly. Do let me know if you do not see this as the right forum to ask about dub. Thanks. Laeeth. Selected package openssl 1.0.0+1.0.0e does not match the dependency specification in package ae (>=1.1.3+1.0.1g (optional)). Need to "dub upgrade"? Target vibe-d 0.7.21 is up to date. Use --force to rebuild. Building rsselastic ~master configuration "application", build type debug. Compiling using dmd... source/app.d(1): Error: module utils is in file 'ae/utils.d' which cannot be read import path[0] = source/ import path[1] = ../../../root/.dub/packages/ae-1.0.1 import path[2] = ../../../root/.dub/packages/openssl-1.0.0_1.0.0e import path[3] = ../../../root/.dub/packages/vibe-d-0.7.21/source/ import path[4] = ../../../root/.dub/packages/libevent-2.0.1_2.0.16 import path[5] = /usr/include/dmd/phobos import path[6] = /usr/include/dmd/druntime/import FAIL .dub/build/application-debug-linux.posix-x86_64-dmd_2067-6DD7C73322D93ABC7BBACEAF4B4E0E3D/ rsselastic executable Error executing command run: dmd failed with exit code 1. === Selected package openssl 1.0.0+1.0.0e does not match the dependency specification in package ae (>=1.1.3+1.0.1g (optional)). Need to "dub upgrade"? Target vibe-d 0.7.21 is up to date. Use --force to rebuild. Building rsselastic ~master configuration "application", build type debug. Compiling using dmd... source/app.d(1): Error: module ae is in file 'ae.d' which cannot be read import path[0] = source/ import path[1] = ../../../root/.dub/packages/ae-1.0.1 import path[2] = ../../../root/.dub/packages/openssl-1.0.0_1.0.0e import path[3] = ../../../root/.dub/packages/vibe-d-0.7.21/source/ import path[4] = ../../../root/.dub/packages/libevent-2.0.1_2.0.16 import path[5] = /usr/include/dmd/phobos import path[6] = /usr/include/dmd/druntime/import FAIL .dub/build/application-debug-linux.posix-x86_64-dmd_2067-6DD7C73322D93ABC7BBACEAF4B4E0E3D/ rsselastic executable Error executing command run: dmd failed with exit code 1.
Re: LuaD linker problems using dub
It is a DMD bug, fixed in 2.065[1]. [1] http://d.puremagic.com/issues/show_bug.cgi?id=12144 Oh my gosh! I can't thank you enough for the quick answer.