Commit Graph

7 Commits

Author SHA1 Message Date
Saul Gutierrez
62c802bfdc symlinks: handle symlinks with absolute paths
Summary:
This allows hg on EdenFS to be able to create symlinks with absolute paths on Windows as well as check out commits with absolute path symlinks.

There are a few caveats here:
- Symlinks with absolute paths will only be usable on the same type of OS (Windows vs. POSIX) they were created.
- Checking out commits with absolute paths created on POSIX (i.e., starting with `/`) aren't usable on Windows
- Symlinks with absolute paths created on Windows will keep the same drive letter across different checkouts.
  - E.g., if the root of the EdenFS checkout is somewhere at `C:\` and there is a symlink pointing to somewhere like `D:\foo\bar.txt`, and then that same commit is checked out in a different Windows machine with that same repo mounted at `E:\`, that symlink will still point to `D:\foo\bar.txt`

If there seems to be some UNC wonkiness in this commit, it is because UNC usage on symlinks is quite inconsistent on Windows:
- Things that use UNC for absolute path symlinks:
  - Windows' `mklink` command (creates symlinks with UNC paths)
  - Python's `os.symlink` (same as above)
  - Hg commits
  - EdenFS (when stored as Inodes; some functions like `realpath`)
- Things that don't use UNC for absolute path symlinks:
  - `PrjWritePlaceholderInfo2`
  - `PrjFillDirEntryBuffer2`
  - `std::filesystem::read_symlink`

Reviewed By: xavierd

Differential Revision: D47227590

fbshipit-source-id: b92c8462ad3f13c2724b76ee61f8c095695027cd
2023-08-01 13:59:20 -07:00
Saul Gutierrez
6ddfaf2fd2 symlinks: properly calculate the SHA1 of symlinks on Windows
Summary:
In some cases EdenFS would detect files as modified when it shouldn't, since it was reading the contents of symlink targets instead of hashing symlinks themselves. This diff the issues mentioned there.

Additionally, `hg status` have fewer issues on checkouts without symlinks enabled (hence the modified test)

Reviewed By: chadaustin

Differential Revision: D47107623

fbshipit-source-id: 9bee2e48b9855d71b22d6d8ec6723d94b6b8632a
2023-07-19 15:47:02 -07:00
Barys Skarabahaty
c663f1d624 Add blake3 support to FileHash utils
Summary: Adding blake3 support to the FileHash util that is used to compute hashes on Windows.

Reviewed By: chadaustin

Differential Revision: D46268714

fbshipit-source-id: cdca3dced494b1f37841121df09351acfdd6c745
2023-06-05 23:41:35 -07:00
Xavier Deguillard
f179b76b47 openssl: use Folly's portability header instead
Reviewed By: chadaustin

Differential Revision: D37217337

fbshipit-source-id: ad1b6c9018b38d5fc6dd60ffeb4dff73e4bd1f98
2022-06-17 09:52:56 -07:00
Katie Mancini
f9b8b89509 move win error
Summary:
Stack context:
To get a build setup for edencommon I picked an eden library to move over
to edencommon.

I picked process name cache. I would like to have this library in watchman
so that I can log spawning process command lines as well as client command
lines.

This Diff:

process name cache depends on WinError.h so I am moving that over.

Reviewed By: chadaustin

Differential Revision: D34218026

fbshipit-source-id: 064f5bfc50c4ba120c887b01ff1f0a3e0543d498
2022-04-04 11:37:38 -07:00
Xavier Deguillard
a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00
Chad Austin
91502de90c break privhelper dependency on OpenSSL
Summary:
To avoid any risk of SSLKEYLOGFILE being used to unexpectedly write
files as root, ensure the privhelper does not even link against
OpenSSL.

Reviewed By: fanzeyi

Differential Revision: D31944839

fbshipit-source-id: 3280657a10f4a468ddb63a874d38198bd333e01c
2021-10-27 16:04:36 -07:00