Skip to content

Commit c4e15cf

Browse files
authored
[elixir] Fix eppo_core package import (#254)
1 parent 2e9573a commit c4e15cf

File tree

6 files changed

+45
-3
lines changed

6 files changed

+45
-3
lines changed

.changeset/chilly-rings-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"elixir-sdk": patch
3+
---
4+
5+
Fix eppo_core import

elixir-sdk/.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
rustflags = [
33
"-C", "link-arg=-undefined",
44
"-C", "link-arg=dynamic_lookup",
5-
]
5+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[target.'cfg(target_os = "macos")']
2+
rustflags = [
3+
"-C", "link-arg=-undefined",
4+
"-C", "link-arg=dynamic_lookup",
5+
]
6+
7+
# Copy this file to .cargo/config.toml (without the .template extension)
8+
# to use the local eppo_core package during development.
9+
[patch.crates-io]
10+
eppo_core = { path = "../eppo_core" }

elixir-sdk/Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elixir-sdk/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,34 @@ Or you can use the client directly:
110110
EppoSdk.Client.wait_for_initialization(client)
111111
```
112112

113-
## Development
113+
114+
115+
### Local Development with eppo_core
116+
117+
When developing the Elixir SDK alongside eppo_core, you can configure Cargo to use the local eppo_core package instead of the published version:
118+
119+
1. Copy the template configuration file:
120+
```bash
121+
cp .cargo/config.toml.template .cargo/config.toml
122+
```
123+
124+
2. This will configure Cargo to use the local eppo_core package located at `../eppo_core` relative to the elixir-sdk directory.
125+
126+
3. Compile the SDK to use your local eppo_core version:
127+
```bash
128+
mix compile
129+
```
130+
131+
4. Any changes to the local eppo_core package will now be reflected when you recompile the Elixir SDK.
132+
133+
For publishing releases, make sure to:
134+
1. Test with the published eppo_core version (remove the .cargo/config.toml)
135+
2. Ensure the version in native/sdk_core/Cargo.toml matches the published eppo_core version
136+
137+
### Testing
114138

115139
To run the tests:
116140
```bash
117141
mix test
118142
```
143+

elixir-sdk/native/sdk_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
rustler = { version = "0.36.1", features = ["serde"] }
13-
eppo_core = { version = "=9.1.1", path = "../../../eppo_core", features = ["rustler"] }
13+
eppo_core = { version = "=9.1.1", features = ["rustler"] }
1414
serde_json = "1.0.138"
1515
tokio = { version = "1.44.1", default-features = false, features = ["time"] }
1616
log = "0.4.21"

0 commit comments

Comments
 (0)