Comments (16)
For build systems, a possible workaround would be to copy required tools out of the system path.
from fsatrace.
What are the "required tools"? If someone runs gcc
, which that involve copying gcc
out of the system path? Or just the fsatrace dlls? Or something else? Is creating a symlink to whatever the relevant piece is sufficient?
from fsatrace.
If you're using gcc it won't be installed in a system path, so it should be fine.
If you use the clang in Xcode, copying the clang binary to any non-system location and running from there should suffice. Maybe this could be built into the tool (check if the binary is present in /tmp/fsatrace/, copy if it isn't present and run from there).
from fsatrace.
Is a hard link sufficient instead of an actual copy?
from fsatrace.
I think hard links aren't allowed in 10.11.
from fsatrace.
Hmm, won't copying the binary still change the argv[0]
value, and thus things that go hunting for adjacent binaries (which I know gcc
does) will fail. That seems even more problematic.
from fsatrace.
Well, gcc binaries won't be signed nor installed on system paths. But yes, the solution wouldn't be very solid.
from fsatrace.
I've started working on a workaround for this problem in shake:
But looks like I'm misunderstanding how newCacheIO
works. Looks like /bin/sh
is copied several times when running the lint test. What am I doing wrong? Is there a better way to achieve this?
from fsatrace.
It looks sensible to me, at first brush. I suggest you add: print e
just inside the newCacheIO
. You should never get called with the same value twice. If you do, newCacheIO
is wrong. If you don't, hopefully it will give you a clue as to why you are getting two bin/sh
things.
from fsatrace.
With this:
fcache <- newCacheIO $ \e -> liftIO $ do
print e
...
I get several "/bin/sh" messages printed.
from fsatrace.
Can you add a print just before fcache - ensure we're only creating one fcache
value.
from fsatrace.
OK, looks like running the test suite enters Development.Shake.Core.run
several times. Is there a better place for that cache than Global
? In any case, I don't mind if the test suite is a bit slower than it could because it copies binaries more times than necessary... I guess a normal build won't reenter run
, right?
from fsatrace.
The test suite calls run many many times.
Maybe the cache should exist only/mostly on disk? Why not just do a doesFileExist
on the file you'd like to be there, and treat its presence as a signal than you've already copied it across. No need to newCacheIO
at all.
Looking quickly, perhaps something like /bin/sh
should be copied to $TEMP/fsatrace-fakes/<hash>/sh
, where <hash>
is the hash of /bin/sh
- so if there are two sh
binaries they don't get confused.
from fsatrace.
Hmm, that would imply hashing the binary, I'll just prepend $TEMP to the found path, so if you have /bin/foo and /usr/bin/foo they will get different paths.
from fsatrace.
I just meant hashing the filepath, but yeah, prepending $TEMP is a much simpler solution :)
from fsatrace.
I'll just close this. If the hack ends up being too problematic, maybe by then Apple provides some decent way to trace binaries. Other than that, FUSE might be an option.
from fsatrace.
Related Issues (20)
- sh.exe test fails on Windows
- Doesn't trace execution on Windows HOT 4
- Make a release HOT 1
- Output file even on non-zero exit code HOT 1
- Tracing multiple subprocesses doesn't work on Windows HOT 8
- Can't trace Go code on Linux HOT 2
- Can't trace gcc on Mac HOT 2
- fsatrace isn't recording executable being run as a "read". HOT 6
- Clarify (or clean up) the Windows makefile HOT 1
- Can't spawn a 32bit process from a .bat file HOT 3
- Tracking reads from non-existing files HOT 6
- Corruption of PATH HOT 2
- failures on ubuntu 20.04 HOT 6
- Quantifying fsatrace's coverage HOT 2
- Consider ETW on Windows HOT 3
- Removing a symlink looks like removing its target HOT 8
- segfault in emiting op HOT 8
- Tracing mkdir syscalls
- Basic tracing does not appear to work on macOS Monterey Version 12.5.1 HOT 3
- Fails to compile on GitHub Mac runners (incompatible architecture) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsatrace.