Repository navigation
fix: rebuild the extension when the cassert flag changes - #28
utkarash2991 wants to merge 1 commit into
Conversation
The build dir is shared by the cassert and plain builds, so running one flavor after the other loaded an extension built for the other server and crashed it with an obscure sanitizer error. Record the flag in the build dir and rebuild with a message when it changes.
| rm -rf "$BUILD_DIR" | ||
| fi | ||
| mkdir -p "$BUILD_DIR" | ||
| echo "$_arg_cassert" > "$cassert_marker" |
There was a problem hiding this comment.
Q: Would it be simpler to have a different build dir for the cassert build?
There was a problem hiding this comment.
I like this idea. Would also be consistent with the way things currently work. Ultimately we should move to native Makefile behavior but until then I think this approach solves the problem.
There was a problem hiding this comment.
yeah it would be simpler to have a seperate build dir. Want me to go with that one? I dont have any strong reason to not to go with the seperate build dir approach.
There was a problem hiding this comment.
Yes please, but as I've mentioned before I'm not sure if it's simpler. If the different build dir way is too complex we can prefer this one for now.
|
Since we have moved xpg into the supabase org you can point your remote to this repo instead of creating a fork @utkarash2991. Although it's your preference but many times during review I check our the branch locally to experiment with it, if you can switch to the official repo instead of the fork it makes my life a little bit easier as I can just fetch the branch from the same repo instead of maintaining a remote to your fork. |
The build dir is shared by the cassert and plain builds. Running
xpg psqlafterxpg --cassert testloaded the sanitizer-built extension into a plain server, which exits with "ASan runtime does not come first in initial library list" and leaves the server in recovery. The reverse order loses sanitizer coverage silently.xpg now records the cassert flag in the build dir and, when a run uses the other flavor, prints what happened and rebuilds:
CI already deleted the build dir by hand before its cassert step, so that step now checks for the message in both directions instead.
Context: supabase/supautils#260 (review comment on test/startup.sh).