Replies: 15 comments 1 reply
-
Yes a somehow similiar issue was raised some time ago. In this context the cross-env package was identified as a potential multi-platform solution. In your case, I guess the shx package can be used to author a multi-platform solution. Can you try this package out, and potentially provide a pull request that solves your issue? |
Beta Was this translation helpful? Give feedback.
-
They look like potential pathways to a cross platform answer, thanks - we can take a look at that and let you know what we find. If we can get it to work then we'll propose a PR fix. |
Beta Was this translation helpful? Give feedback.
-
Hi @marshalc. Just so I can better understand your use case: are you just trying to use Docsy as a dependency, or are you also attempting to built it yourselves? |
Beta Was this translation helpful? Give feedback.
-
@marshalc - Also, can you tell me how your are bringing in Docsy: NPM, Git submodule, or Hugo modules? Thx |
Beta Was this translation helpful? Give feedback.
-
Thanks @deining - the Hi @chalin - we're using Docsy in what I think is a typical theme dependancy use case in our various project's for documentation needs. Essentially it's project based docs, built with Hugo, themed by a lightly modified Docsy theme (see https://github.com/ouhft/docsy/tree/ouhft) added as a git sub-module (linked to that repo branch), and published via an internal Gitlab Pages build process to an internal only webserver (which unfortunately means showing build examples a tad more challenging though you can see the CI process in that link). HTH |
Beta Was this translation helpful? Give feedback.
-
Thanks for the details @marshalc and the links to your project. Could you move My main problem is that I don't have access to a Windows environment so I can't validate the solutions I'd like to experiment with 🤷🏼♂️. (I'm looking forward to the likes of GitPod support for Windows :)) I finally started work on adding smoke tests (#1776), and I was able to validate (as I suspected) that Docsy can be used just fine under Windows. You're building Docsy, so that's another story. I'd rather not add another pkg dependency if I can avoid it. I'm beginning to think that moving that prep step (involving the |
Beta Was this translation helpful? Give feedback.
-
Ok, we now have smoke and built tests successfully passing under *nix and Windows. In particular you'll notice from this run https://github.com/google/docsy/actions/runs/7512943762/job/20454181915, that the Can you give it a try @marshalc? If it doesn't work for you, I'm unsure what tooling GH might be using that is different from yours. Maybe WSL? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the updates - this response is a bit of a placeholder as in trying to investigate this compared to the path we were on has opened up a can of worms, and we're now in several rabbit holes (he says, badly mixing metaphors) trying to work out a clean approach that allows us to test your approach and then work out how it might apply in our context. We did a quick test of our Our first challenge is we're using the git submodule rather than Hugo module approach and this seems to change the overall build and dependancies structures. We were unable to drop in the plain Docsy theme into any of our projects in place of our customised version (and are still trying to determine why), so testing the latest To test some basic setup, we've been winding back to whether we can run the docsy:main user guide build in a clean download.. and we've had that work (but only if the local git repo folder is explicitly called Our next step when we can return to this will be to try this first step on Windows desktop machines as well as my macOS one... then we work forward again, though I think that means we'll need to work out how to repackage our Docsy branch as a Hugo module first, before we can get to parity with you. (pointers welcome!) One thing I noted from your output is that GH appears to be forcing the use of PowerShell in that setup, whereas npm on our local Windows desktop was running those sub-processes in cmd (even though it was called from a PowerShell prompt). The ins and outs of this are presently obscure to me. |
Beta Was this translation helpful? Give feedback.
-
Hi @marshalc, thanks for the updates.
All of my Hugo+Docsy-based projects in production are using Docsy via a git submodule. So, if you have specific questions about using Docsy in this way, let me know and I'll do my best to answer them.
Good.
You're hitting a Hugo requirement: if a Hugo project is configured to use a theme named
That shouldn't be necessary -- we officially support use of Docsy as a git submodule.
Yes, that appears to be key. Btw, since Docsy and the User Guide are successfully building under GH actions, I'm going to move this into the discussions area was we continue to explore your issues of building under Windows. Also note that I've tweaked the title. |
Beta Was this translation helpful? Give feedback.
-
I added some mount points to @marshalc: once you ported these changes to your repo, it should work both on Linux and Windows machines. Can you give this a try, please? |
Beta Was this translation helpful? Give feedback.
-
Thank you both - we're back to looking at this again today. First step, establish a working baseline for comparison with yourselves. Test case: install the docsy main branch (ouhft@d99b473), and build the user guide. Two desktop machines being used:
We noted the PowerShell difference, so we updated the default (v5?) PowerShell app from the Win10 build to the latest 7.4 release to see if that was a differentiator - spoiler alert, it was not. Hugo versions installed:
Assuming local path now: Download the main docsy project
Move into user guide: Now try the Mac: works as expected, i.e.:
PC: the same issue we had originally when logging the Issue...
@chalin - I think this suggests that the GH Windows build definitely has some other implicit/internal configurations setup to ensure the processes stay in PowerShell and don't move to Re: issue vs discussion - quite understand, this could very well be an "us" problem and you've got to work with the tools at your disposal, so this may be of limited to use to a wider cross-platform compatibility. Happy to engage either way. Re: git submodule vs Hugo module - since that's likely an unrelated change to this issue, we've parked that for another time, thanks for the pointer. Re: the folder paths
Footnotes |
Beta Was this translation helpful? Give feedback.
-
@chalin - I also have the sense that I'm missing some understanding between your distinction of "using" docsy opposed to "building" docsy for each project that includes our modified theme... Is there something you could explain/expand-on/point-me-at that might help me there please? |
Beta Was this translation helpful? Give feedback.
-
Good news for @deining - we can confirm your approach works on our https://github.com/ouhft/docsy/tree/npm-no-cp-test (manual copy of your branch) Output from our PC test:
and then a successful serve:
So this (like the |
Beta Was this translation helpful? Give feedback.
-
Hi @marshalc - thanks for all the details. Yes I had high hopes for @deining's proposal but, in the end, it falls short of what we need. I'll get back to you as soon as I can. In the meantime, could you let me know if #1806 works in your environment? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Riding on the idea of @marshalc can you confirm? (If this works, then I won't need to further explain build vs use :)). |
Beta Was this translation helpful? Give feedback.
-
Hi folks,
We've just tripped over a small detail whilst introducing a new team member to our hugo+docsy build process. Whilst our CI processes are linux based, and so are are some devs (or Mac in my case), more of our team coming on board are Windows based, and they're having this problem.
We've traced the issue to a modification at
1966f9604c89875c7bfd83b66fbfee4128297ccf
which was introduced a couple of months ago. Specificallypackage.json
, line 11:"_cp:bs-rfs": "cp -R node_modules/bootstrap/scss/vendor/* assets/_vendor/bootstrap/scss/",
Running an
npm install
on a Windows machine (from either PowerShell or CMD) results in an error of:Now, I appreciate this is use using pre-release versions of the platform - but I wasn't sure if anyone else had found this yet.
The common answer to solving this is to monkey patch the code for Windows users to use
copy
or similar (and change the slashes in the command string too it seems); however this then breaks the code for the *nix users, so we don't like this option.The next answer has been to get our Windows users to either install Windows Subsystem for Linux (WSL) and use bash there, or the git-bash that comes from with Git-for-windows as part of the mingw32 package.
What I'm wondering is if anyone else has tripped on this, and if so, have they come up with a multi-platform solution yet?
Beta Was this translation helpful? Give feedback.
All reactions