Skip to content

Commit

Permalink
move imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Jul 25, 2024
1 parent 7fb1f32 commit 1045111
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export WEBROOT=${WEBROOT:-/tmp/web}
export DEBUG=${DEBUG:-false}
export PGDATA=${PGROOT}/base
export PGUSER=postgres
export PGPATCH=${WORKSPACE}/patches


# exit on error
Expand Down
1 change: 0 additions & 1 deletion cibuild/linkexport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pushd ${WORKSPACE}

OBJDUMP=patches/dump.wasm-objdump PGDUMP=patches/dump.postgres \
python3 cibuild/getsyms.py exports > patches/exports.pglite
cp patches/exports.pglite $PGROOT/
popd

echo "============= link export : end ==============="
Expand Down
2 changes: 1 addition & 1 deletion cibuild/linkimports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "============= link imports : begin ==============="
#_emscripten_copy_to_end

# copyFrom,copyTo,copyToEnd
cat $PGROOT/imports.* | sort | uniq > /tmp/symbols
cat ${WORKSPACE}/patches/imports.* | sort | uniq > /tmp/symbols

echo "Requesting $(wc -l /tmp/symbols) symbols from PGlite"

Expand Down
26 changes: 13 additions & 13 deletions cibuild/linkweb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,35 +143,35 @@ pushd src/backend
then
# link with MAIN_MODULE=1 ( ie export all ) and extract all sym.
. ${WORKSPACE}/cibuild/linkexport.sh
else
echo "

_________________________________________________________
WARNING: using cached/provided exported symbol list
_________________________________________________________
if [ -f ${WORKSPACE}/patches/exports.pglite ]
then
echo "PGLite can export $(wc -l ${WORKSPACE}/patchesexports.pglite) symbols"
. ${WORKSPACE}/cibuild/linkimports.sh

else
echo "
"
cp patches/exports.pglite $PGROOT/
fi
_________________________________________________________
WARNING: using cached/provided imported symbol list
_________________________________________________________
if [ -f ${PGROOT}/exports.pglite ]
then
echo "PGLite can export $(wc -l $PGROOT/exports.pglite) symbols"
. ${WORKSPACE}/cibuild/linkimports.sh
"
fi

else
echo "
_________________________________________________________
WARNING: using cached/provided imported symbol list
WARNING: using cached/provided exported symbol list
_________________________________________________________
"
fi


cat ${WORKSPACE}/patches/exports > exports

# min
Expand Down
3 changes: 2 additions & 1 deletion cibuild/pack_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def is_extension(path:Path, fullpath:Path):
EXTNAME = path.stem
if os.environ.get('OBJDUMP',''):
os.system(f"wasm-objdump -x {fullpath} > {PGROOT}/dump.{EXTNAME}")
os.system(f"OBJDUMP={PGROOT}/dump.{EXTNAME} python3 cibuild/getsyms.py imports > {PGROOT}/imports.{EXTNAME}")
os.system(f"OBJDUMP={PGROOT}/dump.{EXTNAME} python3 cibuild/getsyms.py imports > {PGPATCH}/imports.{EXTNAME}")
with open(f"{PGROOT}/imports.{EXTNAME}","r") as f:
SYMBOLS=f.readlines()

Expand Down Expand Up @@ -83,6 +83,7 @@ async def archive(target_folder):
print("custom:", test)


PGPATCH=Path(os.environ.get('PGPATCH', PGROOT)
PGROOT=Path(os.environ.get('PGROOT',"/tmp/pglite"))

INSTALLED = []
Expand Down

0 comments on commit 1045111

Please sign in to comment.