-
Notifications
You must be signed in to change notification settings - Fork 584
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
switch to consuming bindgen from realm-core repo #5769
Conversation
@@ -1,6 +1,6 @@ | |||
[submodule "docs/jsdoc-template"] | |||
path = docs/jsdoc-template | |||
url = https://github.com/realm/realm-jsdoc.git | |||
[submodule "vendor/realm-core"] | |||
path = vendor/realm-core | |||
[submodule "packages/realm/bindgen/vendor/realm-core"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git mv
didn't change this line and I wasn't 100% sure if I should, but I decided to do it manually. Let me know if I shouldn't have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It worked wonderfully when I pulled and did a git submodule update --init --recursive
locally.
@@ -78,6 +78,7 @@ if(DEFINED CMAKE_JS_VERSION) | |||
include(NodeJSTargets) | |||
endif() | |||
|
|||
# TODO is this option dead? Do we want to support compiling with it set to OFF? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never ended up implementing building from Core prebuilds so we might as well kill it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep that option open as a potential optimization when we'd eventually start exploring moving back to deferring compilation to the developer's machine, instead of shipping a prebuilt binary for RN (to remove our strong dependency on the jsi.h ABI)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this setup is wrong either way. This (used to) let you import a binary realm-core lib, but then still build the realm-js C++ code. I think we need to defer building both, rather than just realm-core. So I propose removing this option for now*, to make room for reintroducing deferred building correctly later
*Not right now though. I'd rather land this PR, and have separate work to clean up the CML.txt file now that we no longer need to be concerned with merging changes with the non-bindgen version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with that 👍 Prebuilding Core with a particular NDK does introduce a dependency on the stdlib ABI as we've noticed before, so I'm fine with doing this correctly later.
@kraenhansen How do I tell GHA to not lint every js file in realm-core? https://github.com/realm/realm-js/actions/runs/4807896465/jobs/8557223717?pr=5769#step:5:26. I think we either want it to lint nothing, or only lint the bindgen dir. |
@RedBeard0531 I've pushed a commit adding a .lintignore file to the |
I pulled this back to a draft. I'm going to move the package.json up to the root of realm-core, and that will have some effects on how we consume it from realm-js. |
Out of draft now that realm/realm-core#6546 has been merged into the realm-core:bindgen branch. There is still a weird linting issue that @kraenhansen said he would look into, but I think this is generally ready to review. |
@@ -3,6 +3,6 @@ | |||
"private": true, | |||
"type": "module", | |||
"workspaces": [ | |||
"packages/realm/bindgen/vendor/realm-core/bindgen/" | |||
"packages/realm/bindgen/vendor/realm-core/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Any particular reason this needed to be moved to the root?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without that, npm run foo
and npx bar
would only work when run from a subdirectory of bindgen
. I thought it would be best if they worked when run from anywhere in the realm-core repo. realm/realm-core@3bad9ef should solve this for commands run by cmake in the $repo_root/build
directory, but it seemed better to just make those commands work from anywhere in the repo.
In theory, I could have made a root package.json, with bindgen as a subworkspace, but that seems silly for realm-core which isn't really a JS project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npx bar
in particular would have the odd behavior of "working", but using the latest version of bar
and its deps, rather than considering the versions from package.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. When not invoked through an NPM script in the package.json, npx
use a "globally" installed package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see that we are transferring it to Core 😌
I was going to delete the whole |
8dbdcc5
to
1e84910
Compare
Running a
Which doesn't include anything from the |
* main: switch to consuming bindgen from realm-core repo (#5769) # Conflicts: # packages/realm/bindgen/vendor/bindgen-lib/spec.yml
Now we are tracking https://github.com/realm/realm-core/tree/bindgen which has what used to be
packages/realm/bindgen/vendor/bindgen-lib
atbindgen
. There is still some separating to do, such as moving the wireit tasks out of realm-core's bindgen package.json, and making that package.json freestanding, but I want to lock in this progress first.(Adding Yavor and Nikola mostly as an FYI)