-
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
Git submodules are not cloned #5536
Comments
Just tried to reproduce this with a recent version of Don't have any ideas why it was broken. Seems like v2.7.1 $ stack --version
Version 2.9.1, Git revision 409d56031b4240221d656db09b2ba476fe6bb5b1 x86_64 hpack-0.35.0 stack.yaml resolver: lts-20.0
packages:
- .
extra-deps:
- git: https://github.com/haskell-game/dear-imgui.hs
commit: 8697aa3a0a084754d36798db1423b7a9393cf147 |
This seems to be a Windows-specific bug. On Mac Stack Version
Method of installationVia ghcup on both Mac and Windows. |
@jship, that is a puzzle because I am pretty confident that the code in the |
@mpilgrem I dug into this some more and I might have some clues on the problem. Running
The ZLibException at the bottom is spurious as far as I can tell, as that's reported for any other cloned repos specified in I converted the steps The problem seems to be this command, where for each submodule, a
The gist is that when
The main
It looks like the issue is regarding quoting/variable expansion. When I run this command to produce a
Changing double-quotes in the command to single-quotes produces a correct
This manual testing is not totally apples-to-apples with Assuming early-expansion is a possibility, perhaps this Pantry code needs explicit single quotes? |
@jship, thanks for the investigation. I've reopened the issue while I look into what you have identified. |
For my own reference: Link to
What shell is Quoting rules in PowerShell: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.4 |
Nice find! So early variable expansion may actually be in play here.
As another data point, I've tried the |
@jship, I am looking at |
Yeah, it looks like Window.hsc's
|
The problem Stack/Pantry has is that it does not know the shell that is being used on Windows to run the EDIT: If Pantry could be confident of PowerShell, it could put a backtick character before the |
Another angle as food for thought: I wonder if we could sidestep this shell complexity by using |
I think it is acceptable for Pantry/Stack to specify a minimum version of EDIT: For my own reference: https://git-scm.com/docs/git-ls-files#Documentation/git-ls-files.txt---recurse-submodules |
@jship, I've opened a corresponding issue at the |
@jship, I am starting to question whether it is actually premature variable expansion by PowerShell before module Main (main) where
import System.Process.Typed ( proc, readProcess )
main :: IO ()
main = do
(_, output, err) <- readProcess $ proc "cmd" ["/c", "--prefix=$displaypath/"]
print output
print err I get (no expansion):
At a PowerShell command line, the same
EDIT: That is, perhaps it is premature variable expansion while the command argument is in the hands of |
After some experimentation, if I command (on Windows, in PowerShell):
it yields (and the same without the
and
so, the PowerShell variable |
@jship, I created a small executable from the code below, and it worked fine when executed in a clone of the repository containing the submodule. I think working through Stack's steps manually in PowerShell may have been misleading. module Main (main) where
import System.Process.Typed ( proc, readProcess )
main :: IO ()
main = do
(_, output, err) <-
readProcess $ proc
"git"
[ "submodule"
, "foreach"
, "--recursive"
, "git archive --prefix=$displaypath/ -o bar.tar HEAD"
]
print output
print err I am going to start again, from the beginning. First step is to see if I can reproduce the problem you are experiencing. It would help me if you could be more precise about what you were doing. EDIT: I tried to build the 'Hello World' example at https://github.com/haskell-game/dear-imgui.hs but |
I'll shoot for getting a repo put together with a minimal repro later today. Thanks for digging into this! Yeah the SDL bit is a known thing where newer versions of SDL in msys are giving us that issue. It's been reported upstream with the msys packaging maintainers as far as I'm aware, but for now we're kind of stuck on Windows installing an older version (2.24 iirc) via stack's bundled pacman. I'd link to that issue but don't have the easiest access to it at the moment. |
@jship, with that pointer, I had no difficulty in building the ImGui 'Hello World' executable on Windows 11 with Stack 2.15.1. I encountered no problem with submodule cloning. My Stack configuration was: snapshot: lts-22.11 # GHC 9.6.4
extra-deps:
- git: https://github.com/haskell-game/dear-imgui.hs.git
commit: bab4d769eaacba2de5da342e853f18746db0e12c
- megaparsec-9.2.2@sha256:c306a135ec25d91d252032c6128f03598a00e87ea12fcf5fc4878fdffc75c768,3219
flags:
dear-imgui:
sdl: true
opengl3: true My dependencies:
- base >= 4.7 && < 5
- dear-imgui
- gl
- managed
- sdl2 Using
|
Hmm, very interesting. 🤔 I made a repro where it consistently fails for me on Windows 10 in both Powershell and Git Bash: https://github.com/jship/stack-repro-num5536/. The repro uses I'm on stack I'll try upgrading stack to 2.15.1 and see if the behavior's any different. |
In case it is relevant, I have Git for Windows on my path. |
Some differences between our setups that are possibly worth calling out:
EDIT: For the second point, it's no longer surprising because that one required both |
Just tried on stack |
Browsing the Git for Windows release notes and the Git release notes for our versions and in-between, and nothing's jumping out at me on that angle. |
Also gave building the same version of |
@jship, I am wondering if the local pantry database is corrupt. I note that the screen shots have:
However, that directory would have existed once the repository was cloned (ignoring the submodule fetch). Can you try deleting the |
I've been deleting the whole stack root as well as the project's individual |
I think with the build of |
@jship, I deleted my Stack root, and now I am experiencing the same problem as you! Perhaps I was not building with Stack 2.15.1 but with my not-quite-fixed Stack. EDIT: That now looks to be the explanation. Sorry for the confusion. |
@jorpic, I have identified the problem. In the |
@jship, this should be fixed in the |
@mpilgrem Thank you! I tried the updated |
General summary/comments
I was testing haskell-game/dear-imgui.hs. However, I was not able to build this package as detailed in haskell-game/dear-imgui.hs#58. Upon closer examination, the problem turns out to be that this package relies on the availability of the
dear-imgui
C++ library in a known location; this library was distributed as a Git submodule, which Stack had not cloned when cloning dear-imgui.hs.Steps to reproduce
Add
dear-imgui
as an extra-dep:Then run
stack build
.Expected
Git submodules are cloned allowing package to build successfully.
Actual
Git submodules are not cloned
Stack version
Method of installation
Official binary, downloaded from stackage.org or fpcomplete's package repository
The text was updated successfully, but these errors were encountered: