mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
Fix elog
This commit is contained in:
2
libs/walproposer/.gitignore
vendored
2
libs/walproposer/.gitignore
vendored
@@ -0,0 +1,2 @@
|
||||
*.a
|
||||
*.o
|
||||
|
||||
@@ -25,7 +25,6 @@ fn main() -> anyhow::Result<()> {
|
||||
// println!("cargo:rustc-link-lib=pgport_srv");
|
||||
println!("cargo:rustc-link-arg=-Wl,--start-group");
|
||||
println!("cargo:rustc-link-arg=-lwalproposer");
|
||||
println!("cargo:rustc-link-arg=-lext");
|
||||
println!("cargo:rustc-link-arg=-lpgport_srv");
|
||||
println!("cargo:rustc-link-arg=-lpostgres");
|
||||
println!("cargo:rustc-link-arg=-lpgcommon_srv");
|
||||
@@ -52,15 +51,15 @@ fn main() -> anyhow::Result<()> {
|
||||
// disable fPIE
|
||||
println!("cargo:rustc-link-arg=-no-pie");
|
||||
|
||||
// if !std::process::Command::new("./build.sh")
|
||||
// .output()
|
||||
// .expect("could not spawn `clang`")
|
||||
// .status
|
||||
// .success()
|
||||
// {
|
||||
// // Panic if the command was not successful.
|
||||
// panic!("could not compile object file");
|
||||
// }
|
||||
if !std::process::Command::new("./build.sh")
|
||||
.output()
|
||||
.expect("could not spawn `clang`")
|
||||
.status
|
||||
.success()
|
||||
{
|
||||
// Panic if the command was not successful.
|
||||
panic!("could not compile object file");
|
||||
}
|
||||
|
||||
// println!("cargo:rustc-link-lib=dylib=neon");
|
||||
// println!("cargo:rustc-link-search=/Users/arthur/zen/zenith/pg_install/build/neon-v15");
|
||||
|
||||
@@ -1,32 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# cc -c -o walproposer.o \
|
||||
# -static \
|
||||
# -I /Users/arthur/zen/zenith/pg_install/v15/include/postgresql/server \
|
||||
# /Users/arthur/zen/zenith/pgxn/neon/walproposer.c
|
||||
# TODO: rewrite to Makefile
|
||||
|
||||
# cc -shared \
|
||||
# -I /Users/arthur/zen/zenith/pg_install/v15/include/postgresql/server \
|
||||
# -I /Users/arthur/zen/zenith/pgxn/neon \
|
||||
# -L /Users/arthur/zen/zenith/pg_install/build/v15/src/common \
|
||||
# -L /Users/arthur/zen/zenith/pg_install/build/v15/src/port \
|
||||
# -lpgcommon -lpgport -lz -lreadline -lm \
|
||||
# -o walproposer.so walproposer.o
|
||||
|
||||
# clang -c -o walproposer.o walproposer.c -ferror-limit=1
|
||||
# ar rcs libwalproposer.a walproposer.o
|
||||
|
||||
make -C ../../ neon-pg-ext-v15 -s
|
||||
make -C ../../pg_install/build/v15/src/backend postgres-lib -s
|
||||
# make -C ../../ neon-pg-ext-v15 -s
|
||||
# make -C ../../pg_install/build/v15/src/backend postgres-lib -s
|
||||
cp ../../pg_install/build/v15/src/backend/libpostgres.a .
|
||||
cp ../../pg_install/build/v15/src/common/libpgcommon_srv.a .
|
||||
cp ../../pg_install/build/v15/src/port/libpgport_srv.a .
|
||||
cp ../../pg_install/build/v15/src/interfaces/libpq/libpq.a .
|
||||
|
||||
# -lseccomp -lssl -lcrypto -lz -lpthread -lrt -ldl -lm
|
||||
|
||||
clang -c -o test.o test.c -ferror-limit=1 -I ../../pg_install/v15/include/postgresql/server
|
||||
clang -g -c -o test.o test.c -ferror-limit=1 -I ../../pg_install/v15/include/postgresql/server
|
||||
rm -rf libwalproposer.a
|
||||
ar rcs libwalproposer.a test.o
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
int hohoho(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
@@ -2,15 +2,17 @@
|
||||
#include "rust_bindings.h"
|
||||
#include <stdio.h>
|
||||
#include "postgres.h"
|
||||
#include "utils/memutils.h"
|
||||
|
||||
// From src/backend/main/main.c
|
||||
const char *progname = "fakepostgres";
|
||||
|
||||
int hohoho(int a, int b);
|
||||
|
||||
int TestFunc(int a, int b) {
|
||||
MemoryContextInit();
|
||||
|
||||
printf("TestFunc: %d + %d = %d\n", a, b, a + b);
|
||||
// elog(LOG, "postgres elog test");
|
||||
rust_function(0);
|
||||
return hohoho(a, b);
|
||||
elog(LOG, "postgres elog test");
|
||||
printf("After rust_function\n");
|
||||
return a + b;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user