Draft
Conversation
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
brooksmtownsend
commented
Jan 22, 2025
Comment on lines
+1
to
+24
| fn main() { | ||
| println!("cargo:rerun-if-changed=./go"); | ||
| println!("cargo:rerun-if-changed=build.rs"); | ||
|
|
||
| std::env::set_current_dir("./go").expect("should be able to find go directory"); | ||
| std::process::Command::new("go") | ||
| .args([ | ||
| "build", | ||
| "-buildmode=c-shared", | ||
| "-o", | ||
| "../build/librustnats.so", | ||
| "main.go", | ||
| ]) | ||
| .output() | ||
| .expect("should be able to build go library"); | ||
| std::env::set_current_dir("../").expect("should be able to find go directory"); | ||
| let path = std::env::current_dir() | ||
| .expect("should get current dir") | ||
| .join("build"); | ||
| let lib = "rustnats"; | ||
|
|
||
| println!("cargo:rustc-link-lib=dylib={}", lib); | ||
| println!("cargo:rustc-link-search=native={}", path.to_string_lossy()); | ||
| } |
Member
Author
There was a problem hiding this comment.
This only works for dynamic linking as far as I could tell, and doesn't search the rustc-link-lib directory properly
Comment on lines
+31
to
+33
| var args []string = []string{"-js"} | ||
| // Configure the options from the flags/config file | ||
| opts, err := server.ConfigureOptions(fs, os.Args[1:], | ||
| opts, err := server.ConfigureOptions(fs, args, |
Member
Author
There was a problem hiding this comment.
Need to be able to take a config file here I think instead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR just moves a bunch of files and code around to use this library for embedding wash. There's still some TODOs which I'll note as comments at least. I'm just getting this off my local for the time being while I work on other things, so it's not quite ready for review.