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

cp -pPR <src> <dst> #1073

Closed
UnixJunkie opened this issue Jan 10, 2014 · 9 comments · Fixed by #1140, #1488 or #4823
Closed

cp -pPR <src> <dst> #1073

UnixJunkie opened this issue Jan 10, 2014 · 9 comments · Fixed by #1140, #1488 or #4823
Projects
Milestone

Comments

@UnixJunkie
Copy link
Contributor

Seems to not work on some NFS mounts (user's home).

cp -PR

does.

Cf. line 96 of src/core/opamFilename.ml: is the -p absolutely necessary?

@UnixJunkie
Copy link
Contributor Author

cp -PR --preserve=mode,ownership also work on top of NFS in my case, which
is less bad than removing the -p altogether probably

@UnixJunkie
Copy link
Contributor Author

Other packages using a .install file are also affected. E.g.:

# opam install unison
The following actions will be performed:
 - install lablgtk.2.16.0 [required by unison]
 - install unison.2.40.102
2 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n]

=-=-= Installing lablgtk.2.16.0 =-=-=
lablgtk.2.16.0 Downloading https://forge.ocamlcore.org/frs/download.php/979/lablgtk-2.16.0.tar.gz
Copying ~/.opam/repo/testing/packages//lablgtk/lablgtk.2.16.0/files/lablgtk.install to ~/.opam/system/build            /lablgtk.2.16.0/
Copying ~/.opam/repo/testing/packages//lablgtk/lablgtk.2.16.0/files/lablgldir.patch to ~/.opam/system/build            /lablgtk.2.16.0/
Applying lablgldir.patch.
Building lablgtk.2.16.0:
  ./configure --prefix /home/berenger/.opam/system LABLGLDIR=/home/berenger/.opam/system/lib/lablgl
  make world
  make install
Installing lablgtk.2.16.0.
The former state can be restored with opam switch import -f "/home/berenger/.opam/system/backup/state-        20140010060751.export"
'opam install unison' failed.
# opam-version 1.1.0
# os           linux
# command      cp -pPR /home/berenger/.opam/repo/testing/packages//lablgtk/lablgtk.2.16.0/files /home/berenger/.opam/packages/lablgtk/lablgtk.2.16.0/files
# path         /localhome/berenger/src/opam-repository/packages
# exit-code    1
# env-file     /home/berenger/.opam/log/log-46205-42bb52.env
# stdout-file  /home/berenger/.opam/log/log-46205-42bb52.out
# stderr-file  /home/berenger/.opam/log/log-46205-42bb52.err
### stderr ###
# cp: preserving times for `/home/berenger/.opam/packages/lablgtk/lablgtk.2.16.0/files/lablgldir.patch': Invalid     argument
# cp: preserving times for `/home/berenger/.opam/packages/lablgtk/lablgtk.2.16.0/files/lablgtk.install': Invalid     argument
# cp: preserving times for `/home/berenger/.opam/packages/lablgtk/lablgtk.2.16.0/files': Invalid argument

@avsm
Copy link
Member

avsm commented Jan 10, 2014

This is a GNU cp only option. We should be using install instead of cp, with explicit permissions being set.

On 10 Jan 2014, at 06:02, Francois Berenger notifications@github.com wrote:

cp -PR --preserve=mode,ownership also work on top of NFS in my case, which
is less bad than removing the -p altogether probably


Reply to this email directly or view it on GitHub.

@UnixJunkie
Copy link
Contributor Author

This issue should be marked as a bug I think.

PS: I am not in front of a regular computer and cannot do much, sorry

@AltGr
Copy link
Member

AltGr commented Jan 21, 2014

avsm is right, the fix is to use install
That's true for opam-installer too.

@UnixJunkie
Copy link
Contributor Author

this bug is still unsolved, please reopen it

@AltGr AltGr reopened this Mar 27, 2014
@AltGr
Copy link
Member

AltGr commented Mar 27, 2014

Sure !
opam-installer should only use install already.

AltGr added a commit to OCamlPro/opam that referenced this issue Jun 27, 2014
this isn't really needed (where important, we use 'install' instead), and
causes problems on some filesystems (NFS...).

besides, it's consistent with OpamFilename.copy.
Closes ocaml#1073
@ghennequin
Copy link

I see that OpamSystem.copy_dir is now again using cp -PRp, which causes opam init to fail for me when OPAMROOT points to an NFS folder.

@UnixJunkie
Copy link
Contributor Author

@ghennequin as a temporary workaround, you can try using nfsopam https://github.com/UnixJunkie/nfsopam

@kit-ty-kate kit-ty-kate reopened this Aug 25, 2021
@kit-ty-kate kit-ty-kate modified the milestones: 1.2, 2.2.0~alpha Aug 25, 2021
@kit-ty-kate kit-ty-kate added this to To do in Opam 2.2.0 via automation Aug 25, 2021
@rjbou rjbou moved this from To do to In progress in Opam 2.2.0 Nov 16, 2021
@kit-ty-kate kit-ty-kate removed this from the 2.2.0~alpha milestone Oct 31, 2022
@kit-ty-kate kit-ty-kate removed this from In progress in Opam 2.2.0 Oct 31, 2022
@kit-ty-kate kit-ty-kate added this to To do in Opam 2.3 via automation Oct 31, 2022
Opam 2.3 automation moved this from To do to Done May 8, 2023
@rjbou rjbou removed this from Done in Opam 2.3 Jun 21, 2023
@rjbou rjbou added this to To do in Opam 2.2.0 via automation Jun 21, 2023
@rjbou rjbou added this to the 2.2.0~alpha milestone Jun 21, 2023
@rjbou rjbou moved this from To do to Done in Opam 2.2.0 Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment