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

Filename collision #1

Closed
myint opened this issue Dec 12, 2012 · 7 comments
Closed

Filename collision #1

myint opened this issue Dec 12, 2012 · 7 comments
Assignees

Comments

@myint
Copy link

myint commented Dec 12, 2012

On OS X, the shellcheck compiled output collides with the ShellCheck directory due to case insensitivity. I don't know the convention in Haskell, but perhaps you could output the binary in a build directory (ghc --make shellcheck -o build/shellcheck). Or maybe use cabal.

$ make
: Conditionally compiling shellcheck
ghc -O9 --make shellcheck
[1 of 5] Compiling ShellCheck.AST   ( ShellCheck/AST.hs, ShellCheck/AST.o )
[2 of 5] Compiling ShellCheck.Parser ( ShellCheck/Parser.hs, ShellCheck/Parser.o )
[3 of 5] Compiling ShellCheck.Analytics ( ShellCheck/Analytics.hs, ShellCheck/Analytics.o )
[4 of 5] Compiling ShellCheck.Simple ( ShellCheck/Simple.hs, ShellCheck/Simple.o )
[5 of 5] Compiling Main             ( shellcheck.hs, shellcheck.o )
Linking shellcheck ...
ld: can't open output file for writing: shellcheck, errno=21 for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [shellcheck] Error 1
@myint
Copy link
Author

myint commented May 7, 2013

Okay, I guess no one's going to respond.

@myint myint closed this as completed May 7, 2013
@koalaman
Copy link
Owner

Github did not feel it relevant to email me about this, and I didn't manually check. Reopening.

@koalaman koalaman reopened this Jun 10, 2013
@ghost ghost assigned koalaman Jun 10, 2013
@myint
Copy link
Author

myint commented Jun 11, 2013

I see. My temporary workaround was:

diff --git a/Makefile b/Makefile
index c2cf996..bbcdb98 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ all: shellcheck jsoncheck .tests

 shellcheck: regardless
        : Conditionally compiling shellcheck
-       ghc $(GHCFLAGS) --make shellcheck
+       ghc $(GHCFLAGS) --make shellcheck -o build/shellcheck

 jsoncheck: regardless
        : Conditionally compiling shellcheck

I spent a few minutes trying to make a cabal package, but I didn't get it working. (I'm not a Haskell programmer at all.)

@koalaman
Copy link
Owner

An initial cabal package file has been added, and tested on a case insensitive file system.

The Makefile is still required for unit tests, I'll look into this later.

@myint
Copy link
Author

myint commented Jun 19, 2013

Thanks!

@paulp
Copy link

paulp commented Oct 29, 2013

FYI this still occurs if I make it with "make", and it's pretty non-obvious what went wrong. I feel fortunate google took me straight to this ticket.

Linking shellcheck ...
ld: can't open output file for writing: shellcheck, errno=21 for architecture x86_64
collect2: ld returned 1 exit status
make: *** [shellcheck] Error 1

I suggest generating into some kind of build directory is good practice for lots of reasons and would eliminate all variations of this collision.

@paulp
Copy link

paulp commented Oct 29, 2013

Oh, and I forgot to mention: it is awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants