fix(edencommon)

we hardcoded the source url :(
This commit is contained in:
Jacob Heider 2023-12-22 12:26:18 -05:00 committed by Jacob Heider
parent 5cd22964a6
commit d11f61e163
2 changed files with 12 additions and 23 deletions

View file

@ -1,5 +1,5 @@
distributable:
url: https://github.com/facebookexperimental/edencommon/archive/v2023.06.19.00.tar.gz
url: https://github.com/facebookexperimental/edencommon/archive/v{{version.raw}}.tar.gz
strip-components: 1
versions:
@ -33,8 +33,5 @@ build:
- -DBUILD_TESTING=OFF
test:
dependencies:
llvm.org: '*'
script:
- clang++ -std=c++17 test.cc -o test -ledencommon_utils -lfolly -lglog
- ./test | grep test
- ./test 1

View file

@ -1,20 +1,12 @@
#include <eden/common/utils/ProcessNameCache.h>
#include <eden/common/utils/ProcessInfo.h>
#include <cstdlib>
#include <iostream>
using namespace facebook::eden;
ProcessNameCache& getProcessNameCache() {
static auto* pnc = new ProcessNameCache;
return *pnc;
}
ProcessNameHandle lookupProcessName(pid_t pid) {
return getProcessNameCache().lookup(pid);
}
int main() {
int pid = getpid();
std::cout << lookupProcessName(pid).get() << std::endl;
int main(int argc, char **argv) {
if (argc <= 1) return 1;
int pid = std::atoi(argv[1]);
std::cout << readProcessName(pid) << std::endl;
return 0;
}