@@ -1097,10 +1097,29 @@ function create_library(package_or_project::String,
1097
1097
compat_file = get_library_filename (lib_name; version, compat_level)
1098
1098
soname = (Sys. isunix () && ! Sys. isapple ()) ? compat_file : nothing
1099
1099
1100
- create_sysimage_workaround (ctx, sysimg_path, precompile_execution_file,
1101
- precompile_statements_file, incremental, filter_stdlibs, cpu_target;
1102
- sysimage_build_args, include_transitive_dependencies, julia_init_c_file,
1103
- julia_init_h_file, version, soname, script, base_sysimage)
1100
+ if ctx. env. pkg === nothing
1101
+ # If environment is not a package, create sysimage with all packages in project
1102
+ packages = nothing
1103
+ else
1104
+ # Otherwise, only include package in sysimage
1105
+ packages = [ctx. env. pkg. name]
1106
+ end
1107
+
1108
+ create_sysimage (packages;
1109
+ sysimage_path= sysimg_path,
1110
+ project= dirname (ctx. env. project_file),
1111
+ incremental,
1112
+ script,
1113
+ precompile_execution_file,
1114
+ precompile_statements_file,
1115
+ cpu_target,
1116
+ base_sysimage,
1117
+ julia_init_c_file,
1118
+ julia_init_h_file,
1119
+ version,
1120
+ soname,
1121
+ sysimage_build_args,
1122
+ include_transitive_dependencies)
1104
1123
1105
1124
if version != = nothing && Sys. isunix ()
1106
1125
cd (dirname (sysimg_path)) do
@@ -1146,60 +1165,6 @@ function get_library_filename(name::String;
1146
1165
return sysimg_file
1147
1166
end
1148
1167
1149
- # Use workaround at https://github.com/JuliaLang/julia/issues/34064#issuecomment-563950633
1150
- # by first creating a normal "empty" sysimage and then use that to finally create the one
1151
- # with the @ccallable function.
1152
- # This function can be removed when https://github.com/JuliaLang/julia/pull/37530 is merged
1153
- function create_sysimage_workaround (
1154
- ctx,
1155
- sysimage_path:: String ,
1156
- precompile_execution_file:: Union{String, Vector{String}} ,
1157
- precompile_statements_file:: Union{String, Vector{String}} ,
1158
- incremental:: Bool ,
1159
- filter_stdlibs:: Bool ,
1160
- cpu_target:: String ;
1161
- sysimage_build_args:: Cmd ,
1162
- include_transitive_dependencies:: Bool ,
1163
- julia_init_c_file:: Union{Nothing,String,Vector{String}} ,
1164
- julia_init_h_file:: Union{Nothing,String,Vector{String}} ,
1165
- version:: Union{Nothing,VersionNumber} ,
1166
- soname:: Union{Nothing,String} ,
1167
- script:: Union{Nothing,String} ,
1168
- base_sysimage:: Union{Nothing, String} = nothing
1169
- )
1170
- project = dirname (ctx. env. project_file)
1171
-
1172
- if ! incremental
1173
- tmp = mktempdir ()
1174
- base_sysimage = joinpath (tmp, " tmp_sys." * Libdl. dlext)
1175
- create_sysimage (String[]; sysimage_path= base_sysimage, project,
1176
- incremental= false , filter_stdlibs, cpu_target)
1177
- end
1178
-
1179
- if ctx. env. pkg === nothing
1180
- # If environment is not a package, create sysimage with all packages in project
1181
- packages = nothing
1182
- else
1183
- # Otherwise, only include package in sysimage
1184
- packages = [ctx. env. pkg. name]
1185
- end
1186
-
1187
- create_sysimage (packages; sysimage_path, project,
1188
- incremental= true ,
1189
- script= script,
1190
- precompile_execution_file,
1191
- precompile_statements_file,
1192
- cpu_target,
1193
- base_sysimage,
1194
- julia_init_c_file,
1195
- julia_init_h_file,
1196
- version,
1197
- soname,
1198
- sysimage_build_args,
1199
- include_transitive_dependencies)
1200
-
1201
- return
1202
- end
1203
1168
# ###########
1204
1169
# Bundling #
1205
1170
# ###########
0 commit comments