Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

For new contributors: here's how to build Node.js with QUIC enabled #183

Open
trivikr opened this issue Oct 17, 2019 · 15 comments
Open

For new contributors: here's how to build Node.js with QUIC enabled #183

trivikr opened this issue Oct 17, 2019 · 15 comments

Comments

@trivikr
Copy link
Member

trivikr commented Oct 17, 2019

The instructions are similar to one given in CONTRIBUTING.md or BUILDING.md in Node.js core repo, but with the following changes:

For example:

Example commands to run coverage:

  • $ git clone git@github.com:trivikr/quic.git
    $ cd quic
  • On Unix/macOS:
    $ ./configure --experimental-quic --coverage
    $ make -j4 coverage
  • On Windows:
    $ .\vcbuild experimental-quic coverage

EDITs:

@OmerHerera
Copy link

This will be great, but in my case, I'm still facing issues building node in local machine.
In my case missing dependencies/wrong versions.

  • It will be great if we will have a Docker image or something like this with all the pre-requisites and then we only will need to clone and mount the code in the image.

  • Or more detailed documentation + troubleshooting for first time contributors how to get your environment working.

Thanks

@trivikr
Copy link
Member Author

trivikr commented Oct 17, 2019

@OmerHerera Can you create a new issue sharing the errors you're getting while building node in your local machine? That way it'll be easy for us to debug.

Here's an example issue I'd created when coverage was failing on my local machine #151

@trivikr
Copy link
Member Author

trivikr commented Oct 17, 2019

It will be great if we will have a Docker image or something like this with all the pre-requisites and then we only will need to clone and mount the code in the image.

Can you create a new issue with this suggestion, so that we can discuss it in detail?

more detailed documentation + troubleshooting for first time contributors how to get your environment working.

We discussed in #175 and decided to create this pinned issue instead which extends detailed documentation from Node.js core main repo. Let us know what problems you're facing in a separate GitHub issue.

@OmerHerera
Copy link

@OmerHerera Can you create a new issue sharing the errors you're getting while building node in your local machine? That way it'll be easy for us to debug.

Here's an example issue I'd created when coverage was failing on my local machine #151

Thanks, I just open a new issue #184

@AttilaDjerdj
Copy link

I didnt want to start a new issue as I think my problem fits in this issue.

Im very interessted in quic but also pretty new to quic and Im trying to build node with quic enabled. As far as I understand, your instructions are for building node with quic on a computer with macOS, or am i wrong? What are the steps for a windows computer?

I have followed the BUILDING.md instructions for windows and I have cloned https://github.com/nodejs/quic instead of https://github.com/nodejs/node. I can run my regular node applications without problems but when I try to run something like trivikr's example from https://github.com/trivikr/node-http-servers.git I always get the error message: No such module: quic. So i guess i missed something on the way to build node with quic correctly, but I have no clue what.

I hope somebody can help me to resolve my problem.

Thanks.

Greetings,
Etzel

@danbev
Copy link
Contributor

danbev commented Nov 11, 2019

@AttilaDjerdj Can you double check that when you specified the experimental-quic when building?
If you run vcbuild.bat help you should see this option in the list of available flags.

I don't have a windows machine to test on but it should be possible to specify this option like this:

.\vcbuild.bat experimental-quic

@trivikr
Copy link
Member Author

trivikr commented Nov 11, 2019

Thank you @AttilaDjerdj for trying out quic
I've updated description to add instructions to build on Windows #183 (comment)

As @danbev pointed out, can you try if the following command works on your Windows machine?

.\vcbuild experimental-quic

@AttilaDjerdj
Copy link

It works, my error message is fixed. This is great, thanks a lot guys : )

@splitice
Copy link

FYI to anyone building on ARM it's not working (#39).

@alexpresss
Copy link

Hi,
I have the same issue as @AttilaDjerdj that when I have build Node with --experimental-quic attached, the module 'quic' can not be found. I have build Node on Linux Mint and I have not a single clue what I have done wrong.

Thanks in advance!

Greetings
Alexander

@danbev
Copy link
Contributor

danbev commented Apr 27, 2020

@alexpresss Can you show us how you are using quic. It might be the case that the function createQuicSocket is now in the net module:

const quic = require('net');
console.log(quic);
$ ./node quic.js
{
  _createServerHandle: [Function: createServerHandle],
  _normalizeArgs: [Function: normalizeArgs],
  _setSimultaneousAccepts: [Function: _setSimultaneousAccepts],
  connect: [Function: connect],
  createConnection: [Function: connect],
  createServer: [Function: createServer],
  isIP: [Function: isIP],
  isIPv4: [Function: isIPv4],
  isIPv6: [Function: isIPv6],
  Server: [Function: Server],
  Socket: [Function: Socket],
  Stream: [Function: Socket],
  createQuicSocket: [Function: createQuicSocket]
}

If node was built with --experimental-quic you should see the createQuicSocket in the output.

@alexpresss
Copy link

@danbev I'm using quic as stated in the example of @trivikr.

const quic = require("quic");

But when I import the net module, I can see the same as what you replied!

@jasnell
Copy link
Member

jasnell commented Apr 27, 2020

The way QUIC is exposed has changed fairly recently to allow it to land in nodejs/node master as a semver-minor. Instead of using require('quic'), it is, as @danbev illustrates, exposed via the net module:

const { createQuicSocket } = require('net')

@akay777
Copy link

akay777 commented Aug 10, 2020

I’m new to quic protocol, can anyone help me with the steps of running this in VS code because I’m not being able to download this code.

Regards.

@akay777
Copy link

akay777 commented Aug 11, 2020

@trivikr can you please help that why the repository is unavailable?

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

No branches or pull requests

8 participants