-
Notifications
You must be signed in to change notification settings - Fork 78
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
Move protos to sdk-core-protos #638
Move protos to sdk-core-protos #638
Conversation
I'm fine with this, but Core's dependencies often reach into this directory as well in order to generate their own protos. The symlink should largely deal with that, but, possibly not on Windows where git doesn't always create them properly. I'll run this by the other people on my team before merging it just to make sure it's not going to be disruptive to dependencies |
That's true, I forgot that Windows doesn't always play well with git+symlinks... If you have any ideas on how to improve this case, I'd be willing to give it a shot! But also, no worries if this is something you don't want to deal with right now -- we'll only need to rebase this branch whenever we update any of these dependencies, which isn't that big of a deal. (I feel like that could be taken sarcastically, so please know that I am being 100% genuine: it's no big deal!) |
@cole-h We're fine with this, but let's actually not even use the symlink at all. It's easy enough for us to just handle the new directory when we update the core dependency and it avoids having things seem like they work on one platform and not another. Will merge after that |
Nix sandboxes builds such that they cannot escape their manifest directory. By moving the `protos` into `sdk-core-protos`, Nix will be able to build crates that depend on `sdk-core-protos`. Otherwise, the build script will fail: Error: Custom { kind: Other, error: "protoc failed: Could not make proto path relative: ../protos/local/temporal/sdk/core/core_interface.proto: No such file or directory\n" }
OK, I've removed the symlink and updated the tests to point at the new location under |
Thanks for being open to this! You guys are awesome! |
What was changed
I moved the
protos
folder from the root of the project into thesdk-core-protos
directory,and added a symlink to this new location at the root of the repository.Why?
Without this change, Nix builds of Rust projects that depend on this will fail with the following error:
This is because the way Nix builds dependency crates is to separate each crate into its source (so
sdk-core-protos
would be its own directory, and would be in an environment totally unlike the current repository's structure). Its parent directory..
would not contain aprotos
directory to rely on.With this change, the
protos
directory is insidesdk-core-protos
, and accessing child files and directories is allowed, so accessing./protos
works and the build succeeds!Checklist
How was this tested:
nix build github:cole-h/sdk-core-test/failure
to see the errored build before this change, andnix build github:cole-h/sdk-core-test/success
to see the successful build after this change. (And you can visit https://github.com/cole-h/sdk-core-test to see the source code involved in reproducing.)cargo check
and all the tests pass withcargo test
(I noticed some testsinclude_str
some protocols directly -- those still work for me).Any docs updates needed?
I don't think this is a significant code change that would require opening an issue, however, I would gladly be told otherwise!