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

Specify default exe extension on wasm32 to be .wasm #8633

Merged
merged 1 commit into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cabal/src/Distribution/Simple/BuildPaths.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ mkGenericSharedBundledLibName platform comp lib
-- | Default extension for executable files on the current platform.
-- (typically @\"\"@ on Unix and @\"exe\"@ on Windows or OS\/2)
exeExtension :: Platform -> String
exeExtension (Platform _arch os) = case os of
Windows -> "exe"
exeExtension platform = case platform of
Platform _ Windows -> "exe"
Platform Wasm32 _ -> "wasm"
_ -> ""

-- | Extension for object files. For GHC the extension is @\"o\"@.
Expand Down
7 changes: 4 additions & 3 deletions Cabal/src/Distribution/Simple/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,12 +1535,13 @@ dropExeExtension filepath =
-- | List of possible executable file extensions on the current build
-- platform.
exeExtensions :: [String]
exeExtensions = case buildOS of
exeExtensions = case (buildArch, buildOS) of
-- Possible improvement: on Windows, read the list of extensions from the
-- PATHEXT environment variable. By default PATHEXT is ".com; .exe; .bat;
-- .cmd".
Windows -> ["", "exe"]
Ghcjs -> ["", "exe"]
(_, Windows) -> ["", "exe"]
(_, Ghcjs) -> ["", "exe"]
(Wasm32, _) -> ["", "wasm"]
_ -> [""]

-- ------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions changelog.d/pr-8633
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
synopsis: Specify default exe extension on wasm32 to be .wasm
packages: Cabal
prs: #8633
issues:
description: {
Specify default exe extension on wasm32 to be .wasm, following the convention in other WebAssembly toolchains.
}