Problem Generating executable

When I run the below code, it gives the below error. How can I solve the problem?

using PackageCompiler: PackageCompiler, create_sysimage, create_app, create_library
using Pkg
ENV["JULIA_DEBUG"] = "PackageCompiler"
mkpath(joinpath("$(@__DIR__)", "Generated"))
Pkg.activate("$(@__DIR__)")
Pkg.resolve()
Pkg.instantiate(; verbose = false)
tmp_app_source_dir = "$(@__DIR__)"
app_compiled_dir = "$(@__DIR__)\\Generated"
create_app(tmp_app_source_dir, app_compiled_dir; force=true,
                       executables=["NetlistEMTP" => "julia_main"
                                    ])
Activating environment at `c:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\Project.toml`
  No Changes to `C:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\Project.toml`
  No Changes to `C:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\Manifest.toml`
Precompiling project...
  1 dependency successfully precompiled in 4 seconds (77 already precompiled)
PackageCompiler: bundled artifacts:
  β”œβ”€β”€ ATK_jll - 2.219 MiB
  β”œβ”€β”€ Bzip2_jll - 2.232 MiB
  β”œβ”€β”€ Cairo_jll - 13.579 MiB
  β”œβ”€β”€ Expat_jll - 1.125 MiB
  β”œβ”€β”€ Fontconfig_jll - 3.017 MiB
  β”œβ”€β”€ FreeType2_jll - 4.737 MiB
  β”œβ”€β”€ FriBidi_jll - 570.671 KiB
  β”œβ”€β”€ GTK3_jll - 73.302 MiB
  β”œβ”€β”€ Gettext_jll - 19.930 MiB
  β”œβ”€β”€ Glib_jll - 20.546 MiB
  β”œβ”€β”€ Graphite2_jll - 696.780 KiB
  β”œβ”€β”€ HarfBuzz_jll - 6.257 MiB
  β”œβ”€β”€ JpegTurbo_jll - 4.951 MiB
  β”œβ”€β”€ LERC_jll - 758.367 KiB
  β”œβ”€β”€ LZO_jll - 1.084 MiB
  β”œβ”€β”€ Libepoxy_jll - 13.043 MiB
  β”œβ”€β”€ Libffi_jll - 205.667 KiB
  β”œβ”€β”€ Libgcrypt_jll - 6.433 MiB
  β”œβ”€β”€ Libgpg_error_jll - 2.227 MiB
  β”œβ”€β”€ Libiconv_jll - 2.245 MiB
  β”œβ”€β”€ Libtiff_jll - 9.779 MiB
  β”œβ”€β”€ NativeFileDialog_jll - 474.944 KiB
  β”œβ”€β”€ PCRE_jll - 4.222 MiB
  β”œβ”€β”€ Pango_jll - 4.738 MiB
  β”œβ”€β”€ Pixman_jll - 5.945 MiB
  β”œβ”€β”€ Wayland_protocols_jll - 465.663 KiB
ERROR: LoadError: IOError: open("c:\\Users\\amroa\\OneDrive - polymtl.ca\\AmroAlsabbagh\\Code\\Julia\\Tests and Notes\\12- Create exe file\\Netlist\\NetlistEMTP\\Generated\\share\\julia\\artifacts\\f42f9d226c70f0bc88e5f897d914d9de1ac2ce03\\share\\wayland-protocols\\stable\\presentation-time\\presentation-time.xml", 769, 33206): no such file or directory (ENOENT)     
Stacktrace:
  [1] uv_error
    @ .\libuv.jl:97 [inlined]
  [2] open(path::String, flags::UInt16, mode::UInt64)
    @ Base.Filesystem .\filesystem.jl:87
  [5] cptree(src::String, dst::String; force::Bool, follow_symlinks::Bool) (repeats 4 times)
    @ Base.Filesystem .\file.jl:328
  [6] cp(src::String, dst::String; force::Bool, follow_symlinks::Bool)
    @ Base.Filesystem .\file.jl:353
  [7] cp
    @ .\file.jl:349 [inlined]
  [8] bundle_artifacts(ctx::Pkg.Types.Context, dest_dir::String; include_lazy_artifacts::Bool)
    @ PackageCompiler C:\Users\amroa\.julia\packages\PackageCompiler\wpsGv\src\PackageCompiler.jl:1124
  [9] create_app(package_dir::String, app_dir::String; executables::Vector{Pair{String, String}}, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool) 
    @ PackageCompiler C:\Users\amroa\.julia\packages\PackageCompiler\wpsGv\src\PackageCompiler.jl:699
 [10] top-level scope
    @ c:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\codeTocimpileSourceCode.jl:22in expression starting at c:\Users\amroa\OneDrive - polymtl.ca\AmroAlsabbagh\Code\Julia\Tests and Notes\12- Create exe file\Netlist\NetlistEMTP\codeTocimpileSourceCode.jl:22

Hi Amro,

I seem to understand the problem stems from presentation-time.xml. Is this a public resource from any package involved or a private resource?

P.S.: I consider it slightly offensive to ask one member of the community to ask for help specifically?

Is it your own file or a file from a package installed by Pkg?

Concluding from the path I’d assume it to be part of wayland-protocols, but who knows what it is and why it is not there? Pretty unclear to me, how to get a reproducer out of this.

So if it is your file and expected in wayland-protocols I’d first suspect some kind of absolute vs. relative path mismatch. Can you help us out here somehow (some PackageCompiler configuration for example)?

OK, here is what I tried on Julia 1.7.2: new project folder with netlist.jl

module NetlistEMTP

using NativeFileDialog, JLD2, Parameters

Base.@ccallable function julia_main()::Cint
  try
    netlisttranslator()
  catch
      Base.invokelatest(Base.display_error, Base.catch_stack())
      return 1
  end
  return 0
end

#=
Here all sub-functions called by netlisttranslator()
netlisttranslator()
=#
end

and packagecompiler.jl

using PackageCompiler: PackageCompiler, create_sysimage, create_app, create_library
using Pkg
ENV["JULIA_DEBUG"] = "PackageCompiler"
mkpath(joinpath("$(@__DIR__)", "Generated"))
Pkg.activate("$(@__DIR__)")
Pkg.resolve()
Pkg.instantiate(; verbose = false)
tmp_app_source_dir = "$(@__DIR__)"
app_compiled_dir = "$(@__DIR__)\\Generated"
create_app(tmp_app_source_dir, app_compiled_dir; force=true,
                       executables=["NetlistEMTP" => "julia_main"
                                    ])

Running include("packagecompiler.jl") doesn’t result in an error for me. So it seems to me you somehow have to reduce your MWE or explain it in another way that we can follow up?

@Amro: I believe we have a problem with your M(inimal)W(orking)E(xample) here, because it involves a package setup. I don’t know the recommended way to communicate about MWEs like this. Do others recommend to use an example GitHub repository in such cases?