JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.41k stars 189 forks source link

`create_library` compiles init file into package directory #845

Open sloede opened 11 months ago

sloede commented 11 months ago

When calling create_library, PackageCompiler automatically compiles an initialization file, such that users of the library are able to conveniently (and hopefully with fewer errors) initialize Julia. The init file is ultimately compiled in compile_c_init_julia, https://github.com/JuliaLang/PackageCompiler.jl/blob/7f0607c990003099969f449c28ad2aeffd0671f4/src/PackageCompiler.jl#L663-L671 and the resulting object file is included when creating the library.

However in line 667 above, the path of the resulting object file is determined by just exchanging the file extension of the init file with a .o extension. That means that if the default init file is used, which is located in PackageCompiler's src directory, the resulting object file is put into the package directory. However, the package directory is not supposed to be written to, or is this kind of write access ok?