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

pkg: lock is stat'ing the current directory like an opam repository #10541

Open
emillon opened this issue May 16, 2024 · 3 comments
Open

pkg: lock is stat'ing the current directory like an opam repository #10541

emillon opened this issue May 16, 2024 · 3 comments
Assignees

Comments

@emillon
Copy link
Collaborator

emillon commented May 16, 2024

I noticed that when dune pkg lock runs, it looks for files in the current directory with a naming scheme similar to an opam-repository:

newfstatat(AT_FDCWD, "/home/etienne/src/dune/packages/ocaml/ocaml.4.09.2", 0x7ffe320108b0, 0) = -1 ENOENT (No such file or directory)

  % time     seconds  usecs/call     calls    errors syscall                          
  ------ ----------- ----------- --------- --------- ----------------                 
   49.56    0.037018           0     74266     56713 newfstatat                       
   33.63    0.025115           0     56689     56688 readlink       

That's a lot of system time, and I don't think we're expecting to see these files to be here.

NB this is from dune pkg lock in the dune tree.

@emillon emillon self-assigned this May 16, 2024
@emillon
Copy link
Collaborator Author

emillon commented May 16, 2024

(I'll investigate to see where these calls come from)

@emillon
Copy link
Collaborator Author

emillon commented May 17, 2024

Interesting, it comes from:

      OpamFile.OPAM.read_from_string
        contents
        ~filename:(Path.to_string path |> OpamFilename.of_string |  > OpamFile.make)

Then opam tries to determine the realpath of that argument, and does so by stat'ing the whole directory tree.

@rgrinberg
Copy link
Member

Ouch. I suppose we can just get rid of it here.

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

2 participants