-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Submodules of git dependencies are not fetched #1488
Comments
Here's the discussion for when they added this to |
+1 Some npm packages won't work without this feature. |
Currently yarn does not pull down submodules when installing git dependencies. See yarnpkg/yarn#1488 for more information. After yarn has finished the installation, the pc-ble-driver submodule directory is empty. In order to workaround this issue, we need an extra postinstall task.
Currently yarn does not pull down submodules when installing git dependencies. See yarnpkg/yarn#1488 for more information. After yarn has finished the installation, the pc-ble-driver submodule directory is empty. In order to workaround this issue, we need an extra postinstall task.
Moreover, the submodules get deleted if they are in there rightful place before running |
I look forward to start using yarn but I cannot switch until this gets fixed :( |
+1 |
Any news on it? |
While i hope this issue is getting some research invested into it, this placeholder workaround might serve as a temporary solution for all of us waiting In package.json of a module being fetched, add a following script |
So here's the synopsis of the problem: The Git utilities included with Yarn seem to do a I'll see what I can do. |
Also, I highly suggest that support for remote archiving is removed. Git has terrible support for it, and it would require a lot of extra code just to get submodules working. As it stands, there isn't any code that enables any of the features, and I'll make a note of this in the eventual PR and ask the owners of Yarn if it should be removed. I agree with the comment in-source: const supportsArchiveCache: {[key: string]: boolean} = map({
'github.com': false, // not support, doubt they will ever support it
}); Also, the code for determining if the URI supports remote archiving is extremely hackish and nasty. It'd be a delight to see it gone IMO. try {
await Git.spawn(['archive', `--remote=${ref.repository}`, 'HEAD', Date.now() + '']);
throw new Error();
} catch (err) {
const supports = err.message.indexOf('did not match any files') >= 0;
return (supportsArchiveCache[hostname] = supports);
} For all of the extra code overhead and this lengthy check on what appears to be every fetch, I'm not convinced the tradeoff is worth it. Without it, we can simply do a bulk copy (or even better, a bulk hard link - but I won't write that logic 😅) between the fetched and the target directory, which would fix this issue and simplify the fetching code a bit more - and probably make cloning from a repository much faster since it requires one less request. |
is there any fix for this ? |
We are officially waiting on this too as an offshoot from the https://github.com/oracle/node-oracledb v2.0 will need this to work. |
@pgkehle do you work at oracle? Hopefully some company here in this thread can aloc one developer to contribute this feature to yarn? |
@brunolemos No I do not. I work at NC State. But we are using oracle servers, some of which still use the legacy LONG RAW type, and it's a need for what my department is developing. We do not have the bandwidth to look into making that install issue work. 😞 |
As a work around, you could remove git dependencies from your package.json, and have a postinstall hook script |
What's the status? This still does not work :( |
The status is nobody has submitted a PR and the ticket is still open, @TheAifam5. |
If deal with an empty submodule folder with what should I do? |
I solved it, using a symbolic link.
This is only a temporary solution, but ... https://qiita.com/nitaking/items/3340955e80144ec90ad6 |
In my case, to be able to install it on the correct paths of .gitmodules, I needed to set the postinstall on package.json as this:
UPDATE In order to bypass the problem where it gives trouble with future yarn adds/installs saying that the folders are not empty, just use this instead:
|
Any progress on this? |
@Shinobu1337 If there's nothing here, then no. Progress in the OSS community is pretty transparent. EDIT (1.5 years later): not sure how what I said was subjective. Someone creating a PR would have it mentioned here, so if there's nothing here on this github issue then nothing has been done... |
trying a solution suggested in yarnpkg/yarn#1488
@reyalpsirc not work in my computer, so add some improves to your codes. It should manually replace xxxxx with your packages which contain submodules:
Test on macOS bash |
Not fixed yet in 2020? Ok time to move on to something else |
This is very disappointing, especially since npm fixed this years ago. Now I can't not use any dependencies without a dummy package.json added. napa would be a workaround if I wouldn't have a install step (cmake-js), since you can't not portable chain install steps with npm. All post install steps here fail due to not being portable on windows. |
… lib Needed to add postinstall script since yarn doesn't support pulling all submodules when you `yarn add` a lib from a git url yarnpkg/yarn#1488
… lib Needed to add postinstall script so that after the repo is pulled, it also clones all the submodules as well, since those are needed for building the lib. yarn unfortunately doesn't support pulling all submodules when you `yarn add` a lib from a git url yarnpkg/yarn#1488
… lib Needed to add postinstall script so that after the repo is pulled, it also clones all the submodules as well, since those are needed for building the lib. yarn unfortunately doesn't support pulling all submodules when you `yarn add` a lib from a git url yarnpkg/yarn#1488
…rom GitHub Yarn doesn't support fetching submodules, but npm does. yarnpkg/yarn#1488
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Having a git dependency with a submodule results in the submodule being an empty directory
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Submodule directories should have the contents (the cloning process should run submodule init and submodule update)
Please mention your node.js, yarn and operating system version.
Node: 7.0.0
Yarn: 0.16.1
OS: Ubuntu 14.04
The text was updated successfully, but these errors were encountered: