Comments (3)
@zrlk @schroederc
This code comes from https://github.com/google/kythe/blame/master/setup_bazel.sh originally.
I notice that we always call realpath -s
and we furnish the following workaround for MacOS:
realpath() {
python -c 'import os, sys; print os.path.realpath(sys.argv[2])' $@
}
But realpath -s
and os.path.realpath()
don't do the same thing! E.g.,
$ realpath -s bazel-bin/../foo
/home/clconway/git/shipshape/foo
$ python -c 'import os, sys; print os.path.realpath(sys.argv[2])' -s bazel-bin/../foo
/home/clconway/.cache/bazel/_bazel_clconway/221df40891e1938542beb77d30927c8e/shipshape/bazel-out/local_linux-fastbuild/foo
I think we can easily add the workaround for non-Mac systems, but I wonder which behavior is correct?
from shipshape.
BTW I agree that readlink
is probably preferable to realpath
, but readlink -e
also doesn't match the behavior of realpath -s
.
from shipshape.
Indeed they are not interchangable with those flags.
Another simple way to improve the way it currently works without breaking anything is to check for realpath before first usage and give a better error message if it does not exist. Thought it might be better to only use readlink.
Something like this below, adapted from SO:
#!/bin/bash
command -v realpath >/dev/null 2>&1 || { echo >&2 "I require realpath but it's not installed. Aborting."; exit 1; }
I tried it on my ubuntu and it worked like intended when removing and reinstalling realpath.
from shipshape.
Related Issues (20)
- Include kythe in the third_party/go directory for the go parts. HOT 1
- ExtendJ analyzer image does not appear to be published anywhere public HOT 2
- Error Prone analyzer doesn't actually work
- External analyzers can't run if one was run previously HOT 2
- "latest" image in our repository HOT 6
- Can't run a local version of an external analyzer and prod versions of shipshape HOT 3
- Getting errors about failing to stop containers on first run HOT 1
- Add --config flag to pass a config file HOT 1
- Make a distinction between default and non-default categories HOT 1
- Add android lint results to the demo repository HOT 2
- Make the cli work with all versions of docker HOT 4
- Make the last part of the run-cli instructions produce results HOT 1
- Show subcategories HOT 3
- Show Docker image download status HOT 1
- Using Shipshape (proto) for code coverage HOT 3
- Jenkins_plugin fails to build, kythe not found
- Add a field to pass options or parameters to analyzer service HOT 5
- why the project can not be compiled? HOT 1
- shipshape exits with "Error HTTP client did not become healthy: service did not respond before timeout:" HOT 2
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 shipshape.