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

jetzig init error #57

Closed
linc01 opened this issue Apr 20, 2024 · 6 comments
Closed

jetzig init error #57

linc01 opened this issue Apr 20, 2024 · 6 comments

Comments

@linc01
Copy link

linc01 commented Apr 20, 2024

Hello, I got this error:

`[exec] zig fetch --save https://github.com/jetzig-framework/jetzig/archive/3f6c1a49199e3a3841a710d69f6525a72a744bb7.tar.gz

Error running command: zig fetch --save https://github.com/jetzig-framework/jetzig/archive/3f6c1a49199e3a3841a710d69f6525a72a744bb7.tar.gz

[stdout]:

[stderr]:

error: invalid HTTP response: EndOfStream`

I tried all solutions here zig http/socks5 proxy support, the dirty script works for zig build directly for other projects. I manually wget https://github.com/jetzig-framework/jetzig/archive/3f6c1a49199e3a3841a710d69f6525a72a744bb7.tar.gz and saved it into the same folder ~/.cache/zig/p and renamed the file with the hash, it's not work. Is there a way to bypass this error for jetzig init? Thanks.

The OS is Arch, environment variables http_proxy https_proxy and no_proxy are works well for all the others except zig.

@linc01 linc01 changed the title Socks5 proxy jetzig init error Apr 20, 2024
@Deecellar
Copy link
Collaborator

We cannot fix the zig fetch error! but we can skip the saving of it @bobf .

We should add a --no-fetch or something like that flag on the init

Will add it in a sec, available to change the name to anything else lol

@z1fire
Copy link
Collaborator

z1fire commented Apr 20, 2024

maybe --cant-teach-an-old-dog-new-tricks

@linc01
Copy link
Author

linc01 commented Apr 20, 2024

We cannot fix the zig fetch error! but we can skip the saving of it @bobf .

We should add a --no-fetch or something like that flag on the init

Will add it in a sec, available to change the name to anything else lol

Thanks, looking forward, I'd like to try jetzig.

@linc01
Copy link
Author

linc01 commented Apr 20, 2024

maybe --cant-teach-an-old-dog-new-tricks

I tried to redirect jetzig init to socks5 with graftcp, but it seems not work for zig fetch

@bobf
Copy link
Contributor

bobf commented Apr 21, 2024

@linc01 That's a shame that zig fetch doesn't seem to work for you. As @Deecellar mentioned, fixing this is out of our control, however you can still use Jetzig without much extra manual work:

  • Create a new Zig project with zig init
  • Copy the build.zig from the demo project in the Jetzig repository
  • Add jetzig to your build.zig.zon using the latest commit on main (the workaround you mentioned above makes me think that you will know what to do here but let me know if not)

Basically the only difference between a Jetzig project and a regular Zig project is this line in build.zig:

try jetzig.jetzigInit(b, exe, .{});

You should hopefully then be able to run jetzig generate view <view-name> to create everything you need.

Let us know how you get on, hopefully you can get a project up and running and this GH issue might help other people in future.

It might also be a good idea to file a bug/feature request with Zig itself. Feel free to join us on our Discord if you're still having issues, we'll be happy to help !

@linc01
Copy link
Author

linc01 commented Apr 22, 2024

@linc01 That's a shame that zig fetch doesn't seem to work for you. As @Deecellar mentioned, fixing this is out of our control, however you can still use Jetzig without much extra manual work:

* Create a new Zig project with `zig init`

* Copy the [build.zig](https://github.com/jetzig-framework/jetzig/blob/main/demo/build.zig) from the demo project in the Jetzig repository

* Add `jetzig` to your build.zig.zon using the latest commit on `main` (the workaround you mentioned above makes me think that you will know what to do here but let me know if not)

Basically the only difference between a Jetzig project and a regular Zig project is this line in build.zig:

try jetzig.jetzigInit(b, exe, .{});

You should hopefully then be able to run jetzig generate view <view-name> to create everything you need.

Let us know how you get on, hopefully you can get a project up and running and this GH issue might help other people in future.

It might also be a good idea to file a bug/feature request with Zig itself. Feel free to join us on our Discord if you're still having issues, we'll be happy to help !

Thanks @bobf , I've bypassed this error with a proxy variables disabled env. Now I can see a lizard on a jet at 127.0.0.1:8080.

Already joined discord, also opened an issue at the zig repo.

@linc01 linc01 closed this as completed Apr 22, 2024
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