https://github.com/JuliaLang/julia
Revision 7eb5cb89fb938a1dc67efa3861b25562767a7bbe authored by Shuhei Kadowaki on 12 March 2024, 11:57:25 UTC, committed by GitHub on 12 March 2024, 11:57:25 UTC
Previously `oc` constructed via `Core.OpaqueClosure` does not set
`oc.source.slot_syms` set, which caused segfaults either when trying to
`show` `oc.source` or if invocation of `oc(...)` threw an error. This
commit fixes that by making sure `oc.source.slot_syms` is set for `oc`
created with `jl_new_opaque_closure_from_code_info`.
1 parent 22602a2
Raw File
Tip revision: 7eb5cb89fb938a1dc67efa3861b25562767a7bbe authored by Shuhei Kadowaki on 12 March 2024, 11:57:25 UTC
set `slot_syms` for methods of OCs constructed via `Core.OpaqueClosure` (#53650)
Tip revision: 7eb5cb8
new-stdlib.sh
#!/bin/sh
# This file is a part of Julia. License is MIT: https://julialang.org/license

set -eu # stop on failure

printf -- "Julia Stdlib Creator Helper Wizard\n"
printf -- "----------------------------------\n"

ROOT=$(dirname "$0")/../stdlib
read -p "Name: " NAME
read -p "Github User account (empty for local): " USER

if [ -z "$USER" ]; then

UUID=$(uuidgen | tr [A-Z] [a-z])

sed -e "/^STDLIBS =/,/^\$/s!^\$!\\
STDLIBS += $NAME\\
!" "$ROOT/Makefile" >"$ROOT/Makefile.tmp"
mv "$ROOT/Makefile.tmp" "$ROOT/Makefile"

mkdir "$ROOT/$NAME"
mkdir "$ROOT/$NAME/src"
mkdir "$ROOT/$NAME/test"

cat >"$ROOT/$NAME/Project.toml" <<EOF
name = "$NAME"
uuid = "$UUID"
EOF

cat >"$ROOT/$NAME/src/$NAME.jl" <<EOF
module $NAME
end
EOF

cat >"$ROOT/$NAME/test/runtests.jl" <<EOF
using $NAME
using Test
@test "your tests here"
EOF

git add "$ROOT/$NAME"
git add -p "$ROOT/Makefile"

else

read -p "Git SHA1 hash of commit: " SHA1

UNAME=$(echo "$NAME" | tr [a-z] [A-Z])

sed -e "/^STDLIBS_EXT =/,/^\$/s!^\$!\\
STDLIBS_EXT += $NAME\\
!" "$ROOT/Makefile" >"$ROOT/Makefile.tmp"
mv "$ROOT/Makefile.tmp" "$ROOT/Makefile"

cat >"$ROOT/$NAME.version" <<EOF
${UNAME}_BRANCH = master
${UNAME}_SHA1 = $SHA1
${UNAME}_GIT_URL := https://github.com/$USER/$NAME.jl.git
${UNAME}_TAR_URL = https://api.github.com/repos/$USER/$NAME.jl/tarball/\$1
EOF

git add "$ROOT/$NAME.version"
git add -p "$ROOT/Makefile"

fi

printf -- "\n-------------------------------------------------------------------------------\n"
printf -- "\n\
Manually add this now to test/precompile.jl (Base.cache_dependencies),
test/choosetests.jl (net_required_for), and base/sysimg.jl (stdlibs), sorted
by top-down dependency order.\n"
printf -- "\n-------------------------------------------------------------------------------\n"
printf -- "Wizard finished.\n"
back to top