Skip to content

Instantly share code, notes, and snippets.

@dherman
Created September 14, 2017 17:06
Show Gist options
  • Save dherman/fbfb05526de90ed8c3abe4fd27662210 to your computer and use it in GitHub Desktop.
Save dherman/fbfb05526de90ed8c3abe4fd27662210 to your computer and use it in GitHub Desktop.
cargo extensibility discussion topics

Neon

Goal: eliminate the necessity for neon-cli to wrap cargo so Neon projects can directly use all cargo commands in the Rust source directory.

Ideas:

  1. Specify link flags in manifest
  • On macOS need to pass -C link-args=-Wl,-undefined,dynamic_lookup
  • Want users to be able to just type cargo build
  1. Post-build hook
  • Need to generate the final dylib as a .node file in the right path (by copying from the Cargo output)
  1. Infer target from environment

Neon developer ends up specifying it once for npm via env var and once for cargo via --target. Would like this to be DRY.

  1. Custom cache validation
  • Want to store various build settings in a config file to determine whether cached code is invalid.
  • Needs to be based on several inputs including environment variables and Cargo settings.
  • Wants to augment not replace existing Cargo invalidation policy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment