-
Notifications
You must be signed in to change notification settings - Fork 841
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
nonportable-include-path warning on case-insensitive systems #3918
Comments
Related: the warning mentions |
I could not reproduce this on mac today with stack 1.7.1 or 1.6.3, possibly resolved somehow ? |
I still see the problem with both stack-1.6.5, stack-1.7.1, and stack-HEAD. Is your filesystem case-insensitive or case-sensitive? That is, if you type |
Yes I'm on a case-insensitive filesystem. I'm not sure what happened, either I erred or some unknown factor was helping out. |
relation? |
Adding @simonmichael, that PR includes a link to haskell/cabal#4739, which claims that the warning comes from clang, so perhaps we simply have different versions of clang? Mine is |
Hmm, taking a closer look at the "fix", I now realize that this simply tells clang not to print the warning, but it doesn't fix the root cause. I think that's fine though, since the warning is about the file in some generated paths being non-portable, and that's fine because those file and paths are going to be re-generated on other systems, we're not going to copy them over. So if stack wants to fix the problem by always passing this flag instead of by changing the directory structure of the files it generates, that would be fine by me. |
Not sure @gelisam. I seem to have clang-900.0.37 (which I think was what I had last time I saw the error). |
Sharing the directory with other machines with different case sensitivity will still be a problem (e.g., cache of build products in a CI server farm; working on the same project on a home machine and a laptop that is synced, etc) So I think the right fix here is to fix the code generating this path. |
Can confirm/reproduce with clang-900.0.39.2 |
Still getting this on Stack 1.7.3. You should be able to repro this with my repo:
|
@brandonchinn178 did you mean 2.7.3 maybe? |
Sorry, yes |
So it seems like this might be fixed with Cabal 3.6.3.0 (bundled with GHC 9.2)! I added an integration test which fails: diff --git a/test/integration/tests/3918-non-portable-path/Main.hs b/test/integration/tests/3918-non-portable-path/Main.hs
new file mode 100644
index 00000000..e61b083a
--- /dev/null
+++ b/test/integration/tests/3918-non-portable-path/Main.hs
@@ -0,0 +1,4 @@
+import StackTest
+
+main :: IO ()
+main = stack ["build"]
diff --git a/test/integration/tests/3918-non-portable-path/files/Foo/Bar.hs b/test/integration/tests/3918-non-portable-path/files/Foo/Bar.hs
new file mode 100644
index 00000000..8bce7828
--- /dev/null
+++ b/test/integration/tests/3918-non-portable-path/files/Foo/Bar.hs
@@ -0,0 +1 @@
+module Foo.Bar where
diff --git a/test/integration/tests/3918-non-portable-path/files/Main.hs b/test/integration/tests/3918-non-portable-path/files/Main.hs
new file mode 100644
index 00000000..d82a4bd9
--- /dev/null
+++ b/test/integration/tests/3918-non-portable-path/files/Main.hs
@@ -0,0 +1,4 @@
+module Main where
+
+main :: IO ()
+main = return ()
diff --git a/test/integration/tests/3918-non-portable-path/files/foo.cabal b/test/integration/tests/3918-non-portable-path/files/foo.cabal
new file mode 100644
index 00000000..53ce8fc0
--- /dev/null
+++ b/test/integration/tests/3918-non-portable-path/files/foo.cabal
@@ -0,0 +1,16 @@
+cabal-version: 1.12
+
+name: foo
+version: 0.1.0.0
+build-type: Simple
+
+library
+ exposed-modules: Foo.Bar
+ other-modules: Paths_foo
+ build-depends: base
+
+executable foo
+ main-is: Main.hs
+ other-modules: Paths_foo
+ build-depends: base
+ ghc-options: -Werror
diff --git a/test/integration/tests/3918-non-portable-path/files/stack.yaml b/test/integration/tests/3918-non-portable-path/files/stack.yaml
new file mode 100644
index 00000000..181b3a2e
--- /dev/null
+++ b/test/integration/tests/3918-non-portable-path/files/stack.yaml
@@ -0,0 +1 @@
+resolver: ghc-9.0.2 It succeeds when passing
|
Details are captured in this issue: <commercialhaskell/stack#3918>
General summary/comments
The common case of using the same name for the executable (e.g.
interplay
) and the top-level module of the corresponding library (e.g.Interplay.Types
) leads to a spurious warning being displayed while building usingstack
on a case-insensitive filesystem:It looks like stack tries to create both a folder named
interplay
and one namedInterplay
, but the OS considers them the same. As a result, the files generated for the module and for the executable end up in the same folder. Luckily, the files have different names so this doesn't cause any problems, except for the fact that the above warning is generated.The problem does not occur when building using
cabal
, because it uses a different folder scheme. Similarly,stack
could change its folder scheme (e.g. put the executable folders and the module folders in two different sub-folders) in order to avoid the warning.Steps to reproduce
For your convenience, I have created a minimal project which demonstrates the problem. The important parts are the fact that the
package.yaml
specifies an executable namedinterplay
:and the fact that the project contains a file
src/Interplay/Types.hs
, that is, there is a top-level module namedInterplay
.Simply run
stack build
on a case-insensitive system and you will see the warning. I have tried it on macOS, and I suspect that the problem will also occur on Windows but not on Linux.Expected
The project builds with no warning.
Actual
The projects builds successfully, but displays the above warning. Here is the full output of
stack build --verbose
, after astack clean --full
.Stack version
I tried with both stack-1.6.5 and stack-HEAD.
Method of installation
stack upgrade --git
for stack-HEAD and thenstack upgrade --force-download
for stack-1.6.5The text was updated successfully, but these errors were encountered: