Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deno compile cross compilation does not work Linux -> Windows #22690

Open
bartlomieju opened this issue Mar 4, 2024 Discussed in #22685 · 6 comments
Open

deno compile cross compilation does not work Linux -> Windows #22690

bartlomieju opened this issue Mar 4, 2024 Discussed in #22685 · 6 comments
Labels
bug Something isn't working correctly compile related to the `deno compile` feature

Comments

@bartlomieju
Copy link
Member

Discussed in #22685

Originally posted by mabasic March 4, 2024
I'm not opening an issue yet, because I'm typing this on mobile ... here it goes.

I'm using Deno 1.41.1 and when I run deno compile on Linux with target Windows, the command generates a .exe file without issues. But when I copy that file to my windows machine and run it I get a error deno panic something something.

I have tried running it with rust_backtrace="full" but I can't find anything useful in the output. Just a bunch of gibberish.

Things that I have tried:

  • deno compile on linux without target (to linux binary) and it works on linux
  • deno compile on linux with windows target and it does not work on windows (panics)
  • BUT when I clone the repo to my windows machine and run deno compile from there, it generates a .exe file and the executable works as expected.

This signals to me that the issue is somewhere in the cross compilation, and not in the compilation in general.

I have even reduced the bug in my source code to a specific NPM package: https://github.com/sindresorhus/ink-big-text

When I comment out the import for this package and any related code from my application, the cross compilation works.

Hopefuly, someone will find this info useful. I have tried reading the source code for cli/tools/compile.rs but I can't seem to find anything interesting there, also I'm not a rust programmer yet so maybe that is the issue too 😊

I will try to create a reproduction repository and open a issue in the following week.

@bartlomieju
Copy link
Member Author

@mabasic please provide reproduction commands and the output you get so we can investigate the issue.

@bartlomieju bartlomieju added needs info needs further information to be properly triaged compile related to the `deno compile` feature labels Mar 4, 2024
@littledivy littledivy changed the title Cross compilation does not work Linux -> Windows deno compile cross compilation does not work Linux -> Windows Mar 4, 2024
@mabasic
Copy link

mabasic commented Mar 9, 2024

@bartlomieju Here is the reproduction repository: https://github.com/govisit/deno-cross-compilation-panic

You will find all the instructions in the README.md file.

I have tested it on Linux and Windows and can recreate the issue every time.

Let me know if I can help somehow.

@mabasic
Copy link

mabasic commented Mar 9, 2024

These are my versions:

Linux:

deno 1.41.2 (release, x86_64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3

Windows:

deno 1.41.2 (release, x86_64-pc-windows-msvc)
v8 12.1.285.27
typescript 5.3.3

@mabasic
Copy link

mabasic commented Mar 9, 2024

I have just tested and compiling the same program on Windows for Linux, and running on Linux works. So maybe the only direction problematic is Linux -> Windows.

@bartlomieju
Copy link
Member Author

@littledivy please take a look

@jollytoad
Copy link
Contributor

I've also found this to not work either when trying to compile on Mac (aarch64-apple-darwin), targeting Linux (x86_64-unknown-linux-gnu)

@lucacasonato lucacasonato added bug Something isn't working correctly and removed needs info needs further information to be properly triaged labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly compile related to the `deno compile` feature
Projects
None yet
Development

No branches or pull requests

4 participants