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

Make "sw" folder read-only #428

Open
Barthelemy opened this issue Mar 1, 2017 · 8 comments
Open

Make "sw" folder read-only #428

Barthelemy opened this issue Mar 1, 2017 · 8 comments

Comments

@Barthelemy
Copy link
Collaborator

I discovered that the folder "sw" should not be deleted because everything is screwed if you do so. I propose to make it read only to help prevent users from deleting it by mistake or out of rage ;)

@PMunkes
Copy link

PMunkes commented Jul 27, 2017

If I understood @ktf and @dberzano correctly, deleting sw/ is the intended reset process. You can then just rebuild your software, and the folder, using a single aliBuild command.

@dberzano
Copy link
Contributor

So, deleting sw is indeed the intended reset process. However, there are bare Git clones under sw/MIRROR used as base for development clones created with aliBuild init.

That is: your clone created with aliBuild init will stop working as a Git clone if you delete sw. But your Git working directory will stay intact, and there is an easy way, or two, to recover it.

Say you've deleted sw. You go under your development directory, run a git status, and you will find a message like:

error: object directory /private/tmp/testme/sw/MIRROR/zlib/objects does not exist; check .git/objects/info/alternates.
fatal: bad object HEAD

but if you do ls you will find the last checked out working directory there.

Solution 1: make it an ordinary Git clone

You can simply make it independent from the nonexisting sw directory by deleting the alternates file:

rm .git/objects/info/alternates

Solution 2: attach it to another bare clone

You can recreate your sw/MIRRORS elsewhere, maybe by using aliBuild init again, and change the content of .git/objects/info/alternates to point it to the new bare directory.

In either case, nothing is screwed up and there is no need to make the sw directory read-only.

I suggest we add a Troubleshooting section with this info and close this ticket.

@Barthelemy
Copy link
Collaborator Author

I agree for adding a troubleshooting section.

What would really help though, and I think there is already a ticket for that, would be the possibility to do "aliBuild reset X" and it would force the rebuild of a specific package.

@dberzano
Copy link
Contributor

I agree that there are some corner cases where this is - unfortunately - needed.

@aphecetche
Copy link

Unless I'm mistaken (and it happened already in the past ;-) ) this very important information has not yet made it to the documentation ? (nor a reset option been introduced in alibuild) ?

Yes, I've tried to remove my sw directory today ...

@Barthelemy
Copy link
Collaborator Author

Laurent, I am pleased not to be alone doing this type of mistakes ;)

@ktf
Copy link
Member

ktf commented Oct 3, 2017

Action item about documentation added at #486.

@aphecetche
Copy link

Hi,

Coming back to the issue... I was hit again today because I have one source that I'd like to share for two different builds : one local on my mac and one in a docker (centos7) container which has its own sw directory (as a docker volume, because bind mounting is simply too slow for writing).

So I tried option 1 :

rm .git/objects/info/alternates

and that did not go really well... because after that I got :

~/alice/o2-dev/AliRoot   master* ⇣
❯ mv .git/objects/info/alternates  .git/objects/info/alternates.backup
~/alice/o2-dev/AliRoot   master
❯ git status
fatal: unable to read tree f82aa9ab67040bf8b3b83b0eb7f01c08a621300b

Is that really the only thing to do to convert a repo to a "regular" one ?


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

5 participants