Skip to content

executable name for windows #81

Open

Description

@leaked

First of all, thank you for all the work you've put into this project and for recently fixing the Tailwind Windows executable naming issue. The fix works great there.

However, it looks like a very similar issue still exists in the esbuild integration on Windows. This appears to be the same type of issue that was recently fixed for Tailwind in #140, where the executable suffix is handled separately from the target identifier.

Thanks again for maintaining the project.

Activity

  1. SteffenDE commented on Jun 16, 2026

    @SteffenDE
    Member

    We don't add the version to the filename in esbuild. Can you reference the place in the code that you think has an issue?

  2. leaked commented on Jun 16, 2026

    @leaked
    Author

    Unlike the Tailwind implementation, there is no version component here. However, the underlying issue appears to be similar: the executable suffix is not handled separately when constructing the final binary path.

    On Windows, the binary is downloaded and stored as:

    esbuild-win32-x64

    instead of:

    esbuild-win32-x64.exe

    which causes the executable lookup to fail.

      def bin_path do
        name = "esbuild-#{target()}"
    
        Application.get_env(:esbuild, :path) ||
          if Code.ensure_loaded?(Mix.Project) do
            Path.join(Path.dirname(Mix.Project.build_path()), name)
          else
            Path.expand("_build/#{name}")
          end
      end
  3. SteffenDE commented on Jun 16, 2026

    @SteffenDE
    Member

    Right, it seems we don’t add a file extension indeed. I did test a Phoenix app on Windows fairly recently though and it worked fine. So what kind of error do you see?

  4. leaked commented on Jun 16, 2026

    @leaked
    Author

    Right, it seems we don’t add a file extension indeed. I did test a Phoenix app on Windows fairly recently though and it worked fine. So what kind of error do you see?

    Thanks for looking into it.

    I agree that it may work on some Windows setups today, and I’m not claiming that every Windows installation is currently broken because of this.

    My concern is more about correctness and maintainability than whether it happens to work right now. The current implementation builds the binary path without considering the platform-specific executable suffix, while the actual executable on Windows is expected to have a .exe extension.

    Depending on how the binary is downloaded, stored, resolved, or executed, this may work in some environments and fail in others. Even if there is currently another part of the codepath compensating for it, the behavior is implicit rather than explicit.

    The recent Tailwind fix addressed a very similar class of issue by handling the executable suffix separately from the target identifier. Applying the same approach here would make the intent clearer, keep the implementation consistent across integrations, and reduce the risk of subtle Windows-specific regressions in the future.

    From my perspective, having the path generation reflect the actual executable name is more robust than relying on behavior that merely happens to work today. The goal of the PR is not just to fix a currently reproducible failure, but to make the Windows path handling explicit and future-proof.

  5. josevalim commented on Jun 17, 2026

    @josevalim
    Member

    We currently remove the extension when installing it, which is why everything works. We could argue that adding the extension would be best practice on Windows but, if there is a bug in here, can you please provide more information on what exactly the bug is and how to reproduce it? Any error message? I believe that's the crucial detail that is lacking.

  6. leaked commented on Jun 17, 2026

    @leaked
    Author

    We currently remove the extension when installing it, which is why everything works. We could argue that adding the extension would be best practice on Windows but, if there is a bug in here, can you please provide more information on what exactly the bug is and how to reproduce it? Any error message? I believe that's the crucial detail that is lacking.

    Thanks for the clarification.

    That makes sense. If the extension is intentionally removed during installation and everything is working as expected, then I don't currently have a reproducible bug to report.

    I'll keep an eye on it, and if I encounter any actual Windows-specific issues or can reproduce a failure case in the future, I'll open a new report with detailed reproduction steps and error messages.

    Thanks again for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions