dgiagio / warp

Create self-contained single binary applications
MIT License
1.91k stars 91 forks source link

Does not work in some scenarios #19

Open andrewsav-bt opened 5 years ago

andrewsav-bt commented 5 years ago

Running on windows similar to:

warp-packer --exec E:\path\to\folder\file.exe --input_dir E:\path\to\folder --output G:\some\test.exe --arch windows-x64

Then running test.exe. Working locally, but copying on another machine getting:

Error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }

If I copy E:\path\to\folder to that same machine and run file.exe everything is working as expected.

The application being wrapped in a ,net core app. Note that I went through the steps with myapp.exe from readme and that simple application also worked fine when copied to the other machine. So it looks there are some more complex interactions at work here...

Is it possible to get some debug output somehow?

dgiagio commented 5 years ago

Can you set WARP_TRACE=1 environment variable when running the self-contained executable? This should show some debugging output.

andrewsav-bt commented 5 years ago

It prints the following:

2018-12-11 16:14:07 TRACE [warp_runner] self_path="C:\\Users\\asavinykh\\test.exe"
2018-12-11 16:14:07 TRACE [warp_runner] self_file_name="test.exe"
2018-12-11 16:14:07 TRACE [warp_runner] cache_path="C:\\Users\\asavinykh\\AppData\\Local\\warp\\packages\\test.exe"
2018-12-11 16:14:07 TRACE [warp_runner] target_exec="E:\\Sources\\DevOps\\HelperApps\\OctoVars\\bin\\Debug\\netcoreapp2.1\\win10-x64\\publish\\OctoVars.exe"
2018-12-11 16:14:07 TRACE [warp_runner] target_path="E:\\Sources\\DevOps\\HelperApps\\OctoVars\\bin\\Debug\\netcoreapp2.1\\win10-x64\\publish\\OctoVars.exe"
2018-12-11 16:14:07 TRACE [warp_runner] cache is up-to-date
2018-12-11 16:14:07 TRACE [warp_runner::executor] target="E:\\Sources\\DevOps\\HelperApps\\OctoVars\\bin\\Debug\\netcoreapp2.1\\win10-x64\\publish\\OctoVars.exe"
2018-12-11 16:14:07 TRACE [warp_runner::executor] args=[]
Error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }

Note that this box does not have disk E. Is it a factor?

dgiagio commented 5 years ago

Seems like it's getting confused with the drive letters. Can you try going to drive E:\ and running warp-packer from there using relative directories like the example?

E:\> cd \path\to\folder
E:\path\to\folder> warp-packer --arch windows-x64 --input_dir . --exec file.exe --output G:\some\test.exe
andrewsav-bt commented 5 years ago

@dgiagio yep, that worked, thanks. Do you think it's worth fixing in code?

andrewsav-bt commented 5 years ago

Unrelated to the issue question, am I guessing right, that if a program is looking for it's config file in the executable folder, it's unlikely to find it because the executable is in the cache folder, and the config in the wrapped program folder?