sapling/eden/scm
Jun Wu 60ae5c218a nodeipc: test send/recv stdio
Summary:
Tested variations mentioned in the added README, especially the
nodejs -> parent -> child case:

Windows:

  $ node hello_parent.js
  [Parent] Got message from child: HELLO FROM CHILD
  [Child] Got message from parent: String("HELLO FROM PARENT 1")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 1' ]
  [Child] Got message from parent: String("HELLO FROM PARENT 2")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 2' ]
  [Child] Got message from parent: String("BYE")
  [Parent] Child process has exited

  $ cargo run --example spawn_sendfd
  Parent: spawning child
  Parent: sending hello
  Parent: sending a.txt file descriptor
  Parent: sending stdio
  Parent: waiting for child to exit
  Child: started with IPC handle 100
  Child: got message Some("hello")
  Child: got sendfd payload SendFdPayload { pid: 41528, raw_fds: [0x118] }
  Child: writing "something\n" to fd 0x118
  Child: got stdio
  Child: write to stderr
  Child: no IPC singleton

  $ node hello_parent.js spawn_sendfd
  Parent: spawning child
  Parent: sending hello
  Parent: sending a.txt file descriptor
  Parent: sending stdio
  Parent: waiting for child to exit
  Child: started with IPC handle 100
  Child: got message Some("hello")
  Child: got sendfd payload SendFdPayload { pid: 49952, raw_fds: [0x118] }
  Child: writing "something\n" to fd 0x118
  Child: got stdio
  Child: write to stderr
  Child: has IPC singleton
  [Parent] Got message from child: HELLO FROM CHILD
  Child: Got message: String("HELLO FROM PARENT 1")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 1' ]
  Child: Got message: String("HELLO FROM PARENT 2")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 2' ]
  Child: Got message: String("BYE")
  [Parent] Child process has exited

Linux:

  % node hello_parent.js
  [Parent] Got message from child: HELLO FROM CHILD
  [Child] Got message from parent: String("HELLO FROM PARENT 1")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 1' ]
  [Child] Got message from parent: String("HELLO FROM PARENT 2")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 2' ]
  [Child] Got message from parent: String("BYE")
  [Parent] Child process has exited

  % cargo run --example spawn_sendfd
  Parent: spawning child
  Parent: sending hello
  Parent: sending a.txt file descriptor
  Parent: sending stdio
  Parent: waiting for child to exit
  Child: started with IPC handle 4
  Child: got message Some("hello")
  Child: got sendfd payload SendFdPayload { raw_fds: [3] }
  Child: writing "something\n" to fd 3
  Child: got stdio
  Child: write to stderr
  Child: no IPC singleton

  % node hello_parent.js spawn_sendfd
  Parent: spawning child
  Parent: sending hello
  Parent: sending a.txt file descriptor
  Parent: sending stdio
  Parent: waiting for child to exit
  Child: started with IPC handle 5
  Child: got message Some("hello")
  Child: got sendfd payload SendFdPayload { raw_fds: [4] }
  Child: writing "something\n" to fd 4
  Child: got stdio
  Child: write to stderr
  Child: has IPC singleton
  [Parent] Got message from child: HELLO FROM CHILD
  Child: Got message: String("HELLO FROM PARENT 1")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 1' ]
  Child: Got message: String("HELLO FROM PARENT 2")
  [Parent] Got message from child: [ 'Echo from child', 'HELLO FROM PARENT 2' ]
  Child: Got message: String("BYE")
  [Parent] Child process has exited

Reviewed By: muirdm

Differential Revision: D46811170

fbshipit-source-id: 96b2d4a7a3c5f8599058faea949ea3ee7be962be
2023-06-21 14:49:59 -07:00
..
contrib add shell completion for hg {hide,unhide,show} 2023-05-08 12:55:33 -07:00
distutils_rust distutils_rust: fix Windows detection 2023-03-16 16:50:14 -07:00
doc collapse edenscm.mercurial package into edenscm 2022-08-24 13:45:53 -07:00
edenscm status: use Rust status in test-casecollision.t 2023-06-21 08:29:03 -07:00
edenscmnative nodeipc: move singleton to a method 2023-06-21 14:49:59 -07:00
exec Upgrade plist 2023-05-23 08:49:53 -07:00
ghstack upgrade pyre version in fbcode/eden - batch 1 2023-03-28 23:22:23 -07:00
hgcache_size_logger Build for aarch64 in addition to x86_64 2022-08-03 07:09:58 -07:00
i18n docs: clarify help for "-I" and "-X" flags 2022-11-13 23:38:55 -08:00
lib nodeipc: test send/recv stdio 2023-06-21 14:49:59 -07:00
newdoc newdoc: remove outdated content 2022-12-01 14:33:34 -08:00
packaging bump macOS python CI to 3.11.3 (#605) 2023-04-18 10:12:23 -07:00
pystubs upgrade pyre version in fbcode/eden - batch 1 2023-02-06 11:55:20 -08:00
slides collapse edenscm.mercurial package into edenscm 2022-08-24 13:45:53 -07:00
tests tests: use Rust status in test-audit-path.t 2023-06-21 08:29:03 -07:00
.editorconfig
.flake8 localrepo: expose tonodes in dageval 2023-03-06 10:23:37 -08:00
.gitignore git: respect 'default-push' path if present (#469) 2023-02-17 12:04:00 -08:00
.rustfmt.toml rustfmt: set group_imports to StdExternalCrate 2021-10-19 11:07:24 -07:00
Cargo.toml tests: move environment related utils to their own crate 2023-06-01 05:52:37 -07:00
COPYING
fsprobe.sh codemod: update license headers 2022-01-05 14:43:32 -08:00
gen_version.py Add annotations to eden 2022-02-14 12:17:43 -08:00
hgeditor
Makefile delete Python 2 specific checks 2023-04-25 14:54:44 -07:00
README.md migrate README.rst to README.md 2022-07-20 09:19:09 -07:00
setup.py mdiff: switch to Rust xdiff binding 2023-04-26 18:02:41 -07:00

Mercurial

Mercurial is a fast, easy to use, distributed revision control tool for software developers.

Basic install:

$ make            # see install targets
$ make install    # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg              # see help

Running without installing:

$ make local      # build for inplace usage
$ ./hg --version  # should show the latest version

See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.