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

Vendoring build/lambda/ files #7

Open
cafkafk opened this issue Oct 6, 2023 · 8 comments
Open

Vendoring build/lambda/ files #7

cafkafk opened this issue Oct 6, 2023 · 8 comments

Comments

@cafkafk
Copy link
Contributor

cafkafk commented Oct 6, 2023

Hi, over at NixOS/nixpkgs#242101 (review), we wanted to make use of the make file more directly when building lambda-lisp.

It would be very helpful if lambdalisp could vendor those files, or at least check for their existence before calling wget, as we can't make network requests from the nix sandbox.

@woodrush
Copy link
Owner

woodrush commented Oct 7, 2023

I have an interpreter that I wrote by myself which I can include in this repo, except it's written in Haskell, so it would create a Haskell dependency. Would that still help?

@cafkafk
Copy link
Contributor Author

cafkafk commented Oct 8, 2023

Hmm, probably not I'm afraid

@woodrush
Copy link
Owner

woodrush commented Oct 9, 2023

I see. I'll be adding existence checks before wget. Would throwing an error if the files are nonexistent be enough?

@cafkafk
Copy link
Contributor Author

cafkafk commented Oct 10, 2023

I think so, as long as it would skip the wget in those cases, probably should be good

@woodrush
Copy link
Owner

woodrush commented Oct 10, 2023

I tried running wget with a nonexistent URL (returns 404), and it returned a nonzero return code. Running it within a Makefile stopped the Make process at wget. So essentially, there's already an existence check in wget, since if the URL starts returning a 404 it would stop Make. I could add wget --spider ... for another explicit check, but I'm not sure if that's what we want here.

@cafkafk
Copy link
Contributor Author

cafkafk commented Oct 10, 2023

Wait no, sorry, I'm pretty sure I got confused. What I need is for it to check if the file already exists, and if it does, skip wget. The problem right now is that we wanna provide those files ourselves, because we can't have network access, and when we try to use make it fails because it tries to reach the internet.

Sorry for the confusion!

@woodrush
Copy link
Owner

Oh I see! No problem, thanks for the clarification. In that case, the local existence check is done by the Makefile itself. Right now, the recipe for "making" the interpreter source files (*.c) is to wget it. So if *.c already exists, make won't run the recipe for *.c, so the wget would not be triggered.

So to prevent wget from running, I believe it should be enough if the source files are manually placed in build/ before running make.

@cafkafk
Copy link
Contributor Author

cafkafk commented Oct 10, 2023

Ohh I see, I'll try that, thanks!

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

2 participants