Skip to content
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

Running make produces hard to decipher error messages #720

Open
yuvipanda opened this issue Nov 2, 2023 · 12 comments
Open

Running make produces hard to decipher error messages #720

yuvipanda opened this issue Nov 2, 2023 · 12 comments

Comments

@yuvipanda
Copy link
Contributor

The title could also be because I'm generally scared of make :)

From the master branch, if I type make I get the following error:

$ make
jq: error: Could not open file : No such file or directory
[+] Building 0.0s (0/0)                                                                                           
error: open : no such file or directory
jq: error: Could not open file : No such file or directory
jq: error: Could not open file : No such file or directory
make: Nothing to be done for `all'.

I'm not sure what is wrong nor how exactly to interpret this.

@eitsupi
Copy link
Member

eitsupi commented Nov 2, 2023

I don't think this is a make's failure, just that the default target all is a dummy target where nothing actually happens.

all:

The jq error I have seen many times and am not sure where it is coming from.
Maybe it's because there are a few places where docker command are handled by jq.
Like this:

pull-image-all: $(foreach I, $(shell jq '.target[].tags[]' -r $(BAKE_JSON) | sed -e 's/:/\\:/g'), pull-image/$(I))

@yuvipanda
Copy link
Contributor Author

Yeah, definitely not an issue with make itself - I have updated the title to be clearer that it's running make that provides this output.

make setup also does the same.

And yeah, I too am not sure where it's coming from.

@yuvipanda yuvipanda changed the title make fails with hard to decipher error messages Running make fails with hard to decipher error messages Nov 2, 2023
@yuvipanda yuvipanda changed the title Running make fails with hard to decipher error messages Running make produces hard to decipher error messages Nov 2, 2023
@yuvipanda
Copy link
Contributor Author

I'm also not sure what make target to use to actually locally build all containers.

@eitsupi
Copy link
Member

eitsupi commented Nov 2, 2023

In fact, most parts of this Makefile are intended to be used on CI and are not needed locally.

I'm also not sure what make target to use to actually locally build all containers.

The point here is that r-ver is the only Dockerfile that is copied files into the container.

COPY scripts /rocker_scripts

This means that in order to build other images, we must first build r-ver and bring the updated rocker_scripts into the container.

In practice, this is too much trouble, so we need to write our own Dockerfile that copies the rocker_scripts into the container, overwrites the rocker_scripts in the container, and builds it.

Like this:

ARG base_image="rocker/r-ver"
ARG tag="latest"
FROM ${base_image}:${tag}
COPY tests/rocker_scripts/test.sh /test.sh
COPY scripts /rocker_scripts
ARG script_name=install_rstudio.sh
ARG script_arg=skip
RUN /test.sh ${script_name} ${script_arg}

@eitsupi
Copy link
Member

eitsupi commented Nov 2, 2023

Honestly, I'm tired of using Make for task runners like this, and this Makefile isn't very good since I wrote it when I knew very little about Make...

I would definitely use Task instead of Make now.

@yuvipanda
Copy link
Contributor Author

I'm personally a very large proponent of not using Make in general :D

@eddelbuettel
Copy link
Member

Hm, no, make is rock solid. An ACM Software Systems Award (in 2003, just like S / R in 1998) is rarely wrong. May I point out (cf #719) that this is a fairly complex project and that using JSON (confession time: I actually think that is not a great choice for config files, apparently I am near alone in that view) in all its glory and dependencies may be related ? Anyway.

Famous quip about programming languages (by Stroustrup if memory serves) is that there two kinds: the ones people complain about, and the ones nobody uses. Same for build systems. We all have cmake too but whatyagottado ....

@yuvipanda
Copy link
Contributor Author

@eddelbuettel would love some help with the error message!

@eddelbuettel
Copy link
Member

@yuvipanda I hear you but we have a large JSON shaped gap between the two of us! Those are jq errors so ball in your court (or in @eitsupi for the wide selection of R packages). make runs subshells, I find one can generally substitute direct commands. Would love to help, can't here by toolkit choice.

@yuvipanda
Copy link
Contributor Author

Would love to help, can't here by toolkit choice.

That makes the two of us, from different sides :)

@cboettig

This comment was marked as off-topic.

@eitsupi

This comment was marked as off-topic.

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

No branches or pull requests

4 participants