-
Notifications
You must be signed in to change notification settings - Fork 28
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
Adjust absolute paths on Windows for Docker #30
base: main
Are you sure you want to change the base?
Conversation
Tested this PR successfully. |
Built and tested locally on a Windows 10 host and rails-new was successful. |
Hello. Can you explain how to create the exe for windows? I have the same issue. |
You'll need to install (at least temporarily) Rust. The compiler will need to be in the PATH before the next step. Grab the source, and then from the root directory for the source, start a command prompt: cargo build -r That will download the used crates (packages) and creates the release build in You can uninstall Rust as it's not needed to run the exe. |
Thank you very much I will try |
@acornmakes Works! Thanks. For those who need to do a build. You can get everything you need in a single command. First download the code and go to the folder you installed it in, then run this Docker command.
This command uses the official Rust image in Docker, builds a volume with the current folder, installs the necessary libs to compile for Windows, and builds with the Windows target. If you want to build for Linux, just use the command
The build file will be in |
The Windows Docker CLI has very specific requirements for absolute paths on Windows. The tool accepts absolute path formats such as
/c/path/to/dest
.The Rust
canonicalize
function creates a UNC path which the Docker CLI command does not accept.This PR addresses the issue #28 by adding a new function with a custom block of Windows only code (using
cfg!
macro) to reformat the path to a Docker CLI compatible path string. On other OSes, the string is returned as it was before, unchanged.