Skip to content

Commit d72b33f

Browse files
committed
node: separate gnd out to a crate (#6167)
1 parent 4f0970a commit d72b33f

File tree

11 files changed

+178
-132
lines changed

11 files changed

+178
-132
lines changed

.github/workflows/gnd-binary-build.yml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,49 +46,17 @@ jobs:
4646
if: startsWith(matrix.runner, 'ubuntu')
4747
run: |
4848
sudo apt-get update
49-
sudo apt-get install -y libpq-dev protobuf-compiler musl-tools libssl-dev
49+
sudo apt-get install -y protobuf-compiler musl-tools
5050
5151
- name: Install dependencies (macOS)
5252
if: startsWith(matrix.runner, 'macos')
5353
run: |
54-
brew install postgresql protobuf
54+
brew install protobuf
5555
5656
- name: Install protobuf (Windows)
5757
if: startsWith(matrix.runner, 'windows')
5858
run: choco install protoc
5959

60-
- name: Cache vcpkg
61-
uses: actions/cache@v4
62-
if: startsWith(matrix.runner, 'windows')
63-
id: vcpkg-cache
64-
with:
65-
path: |
66-
${{ github.workspace }}/vcpkg
67-
C:/vcpkg/installed
68-
C:/vcpkg/packages
69-
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/Cargo.lock') }}
70-
restore-keys: |
71-
${{ runner.os }}-vcpkg-
72-
73-
- name: Install vcpkg and dependencies (Windows)
74-
if: startsWith(matrix.runner, 'windows') && steps.vcpkg-cache.outputs.cache-hit != 'true'
75-
run: |
76-
# Install vcpkg
77-
git clone https://github.com/microsoft/vcpkg.git
78-
cd vcpkg
79-
.\bootstrap-vcpkg.bat
80-
81-
# Install libpq using vcpkg
82-
.\vcpkg.exe install libpq:x64-windows
83-
shell: pwsh
84-
85-
- name: Set Windows environment variables
86-
if: startsWith(matrix.runner, 'windows')
87-
run: |
88-
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Append
89-
echo "LIBPQ_DIR=${{ github.workspace }}/vcpkg/installed/x64-windows" | Out-File -FilePath $env:GITHUB_ENV -Append
90-
echo "RUSTFLAGS=-L ${{ github.workspace }}/vcpkg/installed/x64-windows/lib" | Out-File -FilePath $env:GITHUB_ENV -Append
91-
shell: pwsh
9260

9361
- name: Build gnd binary (Unix/Mac)
9462
if: ${{ !startsWith(matrix.runner, 'windows') }}
@@ -97,9 +65,6 @@ jobs:
9765
- name: Build gnd binary (Windows)
9866
if: startsWith(matrix.runner, 'windows')
9967
run: cargo build --bin gnd --release --target ${{ matrix.target }}
100-
env:
101-
LIBPQ_DIR: ${{ format('{0}/vcpkg/installed/x64-windows', github.workspace) }}
102-
VCPKGRS_DYNAMIC: 1
10368

10469
- name: Sign macOS binary
10570
if: startsWith(matrix.runner, 'macos')

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ members = [
88
"chain/ethereum",
99
"chain/near",
1010
"chain/substreams",
11+
"gnd",
1112
"graphql",
1213
"node",
1314
"runtime/derive",

gnd/Cargo.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[package]
2+
name = "gnd"
3+
version.workspace = true
4+
edition.workspace = true
5+
6+
[[bin]]
7+
name = "gnd"
8+
path = "src/main.rs"
9+
10+
[dependencies]
11+
# Core graph dependencies
12+
graph = { path = "../graph" }
13+
graph-core = { path = "../core" }
14+
graph-node = { path = "../node" }
15+
16+
# Direct dependencies from current dev.rs
17+
anyhow = { workspace = true }
18+
clap = { workspace = true }
19+
env_logger = "0.11.8"
20+
git-testament = "0.2"
21+
lazy_static = "1.5.0"
22+
tokio = { workspace = true }
23+
serde = { workspace = true }
24+
25+
# File watching
26+
notify = "8.2.0"
27+
globset = "0.4.16"
28+
pq-sys = { version = "0.7.2", features = ["bundled"] }
29+
openssl-sys = { version = "0.9.100", features = ["vendored"] }
30+
31+
[target.'cfg(unix)'.dependencies]
32+
pgtemp = { git = "https://github.com/graphprotocol/pgtemp", branch = "initdb-args" }
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
pub mod helpers;
21
pub mod watcher;

0 commit comments

Comments
 (0)