-
Notifications
You must be signed in to change notification settings - Fork 365
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
Proposal for speedier, accurate git+file:// links #5825
Comments
Working directory option is not supposed to copy git directories, build, or opam switches. If it does, it is a bug. What we want for working-dir is to retrieve current directory layout: copy new files, modified files, and remove deleted ones. No matter if it is versioned/committed or not. For context, the current syncing mechanism for working-dir is:
We don't clean B directory between 2 synchronisation, like that the number of files to copy (using git or rsync) is smaller. To prepare step 2, we retrieve the full list of files and directories in A, without exclusion list. We read then all files in We can study doing that based on gitignore, if it handles all cases. |
Are you sure ? In Otherwise you will need to have variables that describe the kind of pin and use them in build instructions, which I personally would find micro managing, if not annoying: |
Sorry, my sentence wasn't clear. Working dir is not supposed to copy via rsync git, build, and opam directories (see exclusion list). It begins with a git sync, so the .git directory is present in opam internal source of the package. |
TLDR: Today's algorithm excludes False negatives
False positivesLet's pretend opam accepts the Case Study from your own projectsFor a I think the
ConclusionLet's just use the Also, the approach I mentioned is simpler to implement and describe. Just rsync everything except what git tells you to ignore. Notice that there is no need to handle the Also, the |
I'm not sure to what you refer to here. But having to commit things to git so that "they become visible" is the right default. The negative surprise is when you have pins a bit everywhere you checkout another branch of you repo, go somewhere else that happens to need an |
You succinctly described the surprise. Real scenario that has happened to me: You spend hours thinking your changes should have fixed a bug but didn't. Then miraculously you find out (how?) you should be committing things to git for them to be visible to the build system. Let's repeat that so it is clear: you have to commit changes to source control in your local projects for them to be visible to the build system. I would be willing to bet you a coffee and a donut that doing a survey of developers asking "would you be surprised with that italicized statement?", at least 75% of them would say "yes". That is today's default. At least somewhere My hope is the simplified UX in this proposal gets rid of both surprises.
Completely agree. And I hope that is tracked somewhere. |
Except you are not committing changes to make them available to the build system. You are committing changes to make them available to the install base of your package manager.
No need to track this, this is what the default pins give you. We used to have |
You are right. I was being sloppy with the terminology of build system versus package manager. But I would still bet you a coffee and a donut with a reworded survey. |
Of course users always think they know what they want, like faster horses. But they rarely understand all the implications of what they ask for (and the perils of global mutable state :-). |
I came across https://stackoverflow.com/a/50059607/21513816 and have started to use it in my own projects.
I think it will help people who are surprised that you have to commit things for the files to be visible. Or they use the working-dir option which for me is insanely expensive when it encounters build directories,
local opam switches, etc.Basically do:
git ls-files --exclude-standard -oi --directory
gets a list of files and directories that should be excluded based on the.gitignore
scattered throughout the project. The command has a nonzero time cost but is reasonably small..ci/
becomes[.]ci/
). And then use those regex literals inrsync
or whatever copying program that is active inside opam -OR-(I'm sure someone else already thought of this, but I couldn't find an issue. Feel free to close if duplicate or unwise)
The text was updated successfully, but these errors were encountered: