-
Notifications
You must be signed in to change notification settings - Fork 103
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
Problem: using symlinks breaks Windows dev environments #704
Comments
Using symlinks cause Windows deployments to become much harder. See #704 for more details.
This is also an issue in the storage service (same osdeps files). |
See artefactual/archivematica#704 fore more details.
Alas, it looks like the symlinks in archivematica-storage-service stable/0.10.x are what's preventing the checkout to qa/0.x: TASK [artefactual.archivematica-src : Checkout archivematica-storage-service code] *** Because the working directory is dirty, it won't checkout. And even though we specify "force: yes" in Ansible, I think the Ansible git module has a bug where it doesn't force checkouts if the branch being checked out is a remote branch. |
The same issue will apply to archivematica stable/1.6.x as well. Ansible just fails before it gets that far. |
Here are the files in question: Changes not staged for commit:
|
^ for the archivematica-storage-service For archivematica, I think fpr (which is a submodule?) will also be an issue. |
I imagine removing the symlinks for osdeps would be easy enough, but I'm guessing not so much with the submodules? |
I haven't used submodules myself so I'm not really sure how they're used in Archivematica. |
Trying to reproduce the git problem but struggling... |
Ahh... I was struggling to reproduce the problem on a system running Ansible 1.8.2, but I see in Ansible devel (and probably Ansible 2.3.2) that there is a difference in how the git clone is performed! In older versions of Ansible, they would use the "version" to git clone with a specific branch. (Using syntax like @sevein described at #700). But in newer versions of Ansible, they only clone with a specific branch if the depth parameters is used :S. We can confirm this for 2.3 as well: I'll try it to see if I can reproduce it manually on a system with Ansible 2.3.2... |
First proof: vagrant@am-local:/opt/archivematica/archivematica-storage-service$ git branch -vv
If I run it on an older system, I just see the "qa/0.x" branch because it uses that branch option with the git clone. |
So I deleted qa/0.x, made some modifications to stable/0.10.x and re-ran the simplified Ansible playbook and it did seem to force the checkout... which is surprising. |
I'm guessing it must have done a reset first... and that must have worked whereas that wouldn't work on on the Windows/Linux Virtualbox shared folder. I can confirm that if I hack Ansible a bit... |
Ah just looked through the code instead and yeah it does a reset if there are local mods. So naturally it would only fail if the reset failed and if the checkout didn't use the force option properly applied, and I've already discovered that it doesn't have the force option properly applied... |
I'm going to try adding the depth option because that should cause the git clone to use the branch parameter... |
Edited artefactual.archivematica-src/tasks/ss-main.yml to include "depth: 1" and waiting for Ansible to run... I think that should make the clone faster, and I think developers can fetch the rest of the history after the fact if they need it. |
Ah looks like my edit might not have been included.. |
Ah I'll just copy my own role and define it... let's try that again. |
Success for archivematica-storage-service. Looks like unexpected behaviour in Ansible is creating most of the problems here... |
Looking at src/archivematica-storage-service, it just has the latest commit when using "depth: 1", but if I use "git fetch --unshallow" manually after the fact I get the full history for the qa/0.x branch. It also seems to have fetched the upstream repo's tags. However, I can't access any other remote branches... Also, I'm facing this error once again: TASK [artefactual.archivematica-src2 : Run SS django collectstatic] ************ |
Right, so if I update roles/artefactual.archivematica-src/tasks/ss-main.yml to use "depth: 1", I'm able to clone the archivematica-storage-service repository without running into that symlink/checkout issue. But then - as a developer - I need to manually run the following in order to get all the remote branches and untruncated history for doing development: git config remote.origin.fetch "+refs/heads/:refs/remotes/origin/" That seems sub-optimal to me. Ansible's git module seems buggy to me in that regard. |
As for the SS django collectstatic error, it's not the same error from artefactual/deploy-pub#40 but it's the same task. I see something about "No module named dj_database_url". I'll leave that one up to you folk with more control and understanding of Archivematica internals. |
Raised an issue with Ansible but even if they do think it's a bug, it wouldn't really help us in the short-term, unless they release a new version that can be targeted with pip and then we specify the use of pip in the Vagrantfile to get that particular version (or newer) of Ansible. |
Despite my many posts, I suppose this issue isn't really the right issue to raise all of this... But I suppose it's mostly only an issue because of the symlinks in the stable branches. |
It looks like there are changes requested in artefactual/deploy-pub#39 . I'm untagging this from the 1.7 release and bumping to 1.8 for the time being. |
Archivematica cannot be deployed on Windows, but this PR from @minusdavid artefactual/deploy-pub#39 makes it possible to deploy a development environment on Windows, using vagrant to deploy to a linux vm.
That PR is working great, but there is a problem with checking out a git repo that contains symlinks into a windows filesystem (google it, lots of links). Windows doesn't properly support symlinks, and so checking out a repo with symlinks is difficult, ansible roles choke, you get weird git errors, etc.
In this repo, there are only a few symlinks being used - it would not be hard to remove them altogether. I think the only place left is in the osdeps folders. Removing those symlinks and creating duplicate files for now would allow osdeps to differ for each platform, which is fine, and would make developing in a Windows environment much easier, which is a bonus.
The text was updated successfully, but these errors were encountered: