-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agnostic way to call dub #1959
Comments
Did you find a resolution for this ? |
Even WIP are welcome as PR. Feel free to ping a few contributors (me included) if you need advice. In order to test it, all you should have to do would be:
Personally, I think of If you want to debug a bit more (errors can be very user unfriendly), you can use |
Thanks. Just created PR. I only have access to a Windows machine right now. The only way to install docker right now is to do a non-standard OS upgrade. This makes everything more difficult, so I will probably wait until after next week when I will have more access. Are you sure that last "docker run -it..." is right? I get errors with that (as in more basic ones than the ones I get from being on Windows and trying to us docker). |
Oh, the last command is missing the image to use! It should be
You can run docker in WSL2. I haven't used that myself though. |
@Geod24 I'll need to try that later. To get docker to run on Windows requires first getting WSL2 working, which is what required the non-standard OS update. You can't just can't to the Windows updater to get it. I found a link on superuser that took me to the MS site you could get it. It apparently only became available outside of a beta-like thing in May. I should be able to try it in WSL2 instead of Powershell. I was getting some errors about bash not being available that might go away in WSL2. |
I've got WSL2 working properly with docker. The So I also tried Do I need to have
|
Looks like you edited the script in a Windows editor and |
@Geod24 Would have never thought of that! Thanks! I gotta start normal work now for today, but I'll try to get back to this. |
@Geod24 Hmm, it looks like that didn't work. I think I'm better off just waiting until I can use linux instead of trying to figure it out with WSL. |
I'm making an effort on this again. I was able to get my Linux up and running with the latest version. However, it seems as if I am having some issues with the dmd install script when running docker build.
I got the same issue when I ran the install script myself (before I just used the package). I am running Linux Mint 20. |
@Geod24 The issue above was due to problems with the
It looks like the line in
|
What's the failure ? |
Sorry, the failure is at the end:
|
Oh my bad, didn't read the full log 🤦 |
@Geod24 I will try that. If that doesn't work, then I might try to just delete the docker container and start a new one. |
@Geod24 Thanks, that helps with the build step. What I'm trying to do now is just run the
|
Look at the usage examples: https://github.com/dlang-tour/core-exec#usage |
The source of truth are the CI scripts. tl;dr: build a docker image and name it with
|
Yup, but the test.sh handles the base64 bit -> https://github.com/dlang-tour/core-exec/blob/master/test.sh |
@wilzbach It's now running using those commands (after adding sudo to both). |
FYI: you shouldn't need to use Details: https://docs.docker.com/engine/install/linux-postinstall/ |
@wilzbach Thanks, that works. So now I'm trying to track down the source of the errors using the shell approach that @Geod24 mentioned, using the command
and there is no issue with the first three lines, but the last line says
Any idea what I need to do differently? |
The test script requires bash, so this error likely means that it wasn't executed with bash (/bin/sh != /bin/bash).
You can't run the test script inside the built D container as there's no docker installed. Is this what you were trying to do?
If you want to connect to the docker container (i.e. open up a shell to it):
Does this help? |
@wilzbach I'd say that my underlying issue currently is to get a better error message than just "Error on line 15". I know line 15 of myTest.sh has the error, I need to trace it back a bit further than that. Anyway, when I run your code above I get
but I'm still getting errors. In this case it is that
If I instead change the last line to |
Sorry, I didn't test it as I was replying from a laptop without my D setup.
|
Thanks a bunch for that. There were two issues that were tripping me up that you made clearer. The first was the order, if I put the source and bsource first, then that helps. Second, was putting quotes around things properly. Below works without error
After doing this, I tried to add a dub.sdl file and that failed, but this was only on my branch, not on master. So this at least now gives me some direction on figuring out what the issue is. Thanks again! |
run.dlang.org
currently has an issue with compiler flags being ignored when dependencies are added.One simple issue is that the dflags are not passed to dub through the
dub.sdl
. However, the underlying issue is that even if you do manually write the dflags todub.sdl
, then if you have something like-unittest
then you get a big message that you should be usingdub test
instead ofdub run
. This is becauserun.dlang.org
usesdub run
everywhere.So one potential solution would be to have special casing in
run.dlang.org
so that it reads the compiler flags and if it sees a-unittest
then it re-writes it into adub test
instead ofdub run
.However, it seems silly to me to have this behavior only in
run.dlang.org
. It makes more sense for this to be indub
itself so that other libraries can take advantage of it.My proposed solution is something like
dub exec -dflags
(ignoring the specific name), which will re-write a call todub exec
intodub run
,dub test
, etc in an agnostic fashion based on the flags that an agnostic fashion. So for instance,dub exec
is equivalent todub run
anddub exec -unittest
is equivalent todub test
. Commands passed on the compile-line will override anything in the dub.sdl, but otherwise treated the same.This is a bit similar to the relation between
ldc2
andldmd2
in providing a consistent interface. However, it should also be possible to writedub exec --compiler=ldc2 -someldcspecificflag
.The text was updated successfully, but these errors were encountered: