Comments (12)
I'm not sure how to solve this problem in an appropriate way.
My temporary solution was to replace realpath with a bash script that just calls the real realpath command on my phone:
#!/bin/sh realpath "$@"
from myaliases.
Can you run make on your phone? Can you compile the realpath script using make? Or some compiler that comes standard... I don't know if we can assume gcc is on all systems. Because if so I can just throw an extra line in my script.
from myaliases.
After some research, clang, gcc, and ch are acceptable C compilers that should be on most computers. I don't know if make works on everything. Try to run the raw command first before trying make.
Source: https://en.m.wikipedia.org/wiki/List_of_compilers
from myaliases.
If setup is going to attempt to compile realpath
, it could first check whether realpath
already exists in the environment. We could do that using this.
If realpath
does already exist, we could replace the realpath file with a bash executable that would call realpath
. Maybe the code for that would look something like this?
if [ ! -f $ABSPATH/realpath ]; then
touch realpath
fi
echo '#!/bin/sh' > realpath
echo 'realpath "$@"' >> realpath
chmod +x realpath
If we end up going this route, we could even do the same check to see if readlink exists.
But I think this would make things pretty complicated. Not sure if this is what we actually want to do.
from myaliases.
I guess we could do that. One good question this brings up is should we remake the c executable on every system anyway? Because currently it's compiled for my system and I don't know how much of a difference that makes.
from myaliases.
I honestly don't know how much of a difference it makes either. I wish we had access to other computers like a mac.
But remaking the c executable may not work if the user doesn't have one of those compilers. I guess we could attempt to compile and then try creating a bash executable if none of the commands (clang, gcc, ch, etc) work? Maybe this could be done using &&
, since it will run the command that comes after it only if the first command works.
This just seems like a lot of work though. We could also just use readlink -f
and neglect users that don't have readlink
.
from myaliases.
Except macs are pretty standard and also I'm not sure how many computers don't have a compiler...I would check if osx, knuth have the ones we mention and then go with that.
from myaliases.
Also, I think we should guarantee compatibility on some specific systems across the repo and then just aim for compatibility elsewhere.
from myaliases.
Oh ok. So my phone is probably just a weird edge case We don't have to support it.
Yeah, I agree. We should just pick specific things to garuantee compatibility for.
I think some Macs have readlink though, right? I was reading that the problem was that readlink performs differently for different types of Macs. But it may not be a major problem for us??
Also, I found this beautiful article about portable shell scripting. It probably details everything anyone ever needs to know lol
from myaliases.
Honestly, I'm actually super confused about readlink and realpath compatibility. I thought I knew, but every time I read about it, I become more confused.
from myaliases.
Some proposed solutions
These might be better than creating our own script that needs to be compiled. Some of these solutions are much, much simpler (ex the Perl one) and might simplify the whole ordeal of compilation?
from myaliases.
Leaving the compiled binary in the repository seems like a bad solution--I keep forgetting to run make, and incompatible binaries are not good. (If I can't use this, who can?) I've just deleted the binary for now. Maybe we can come up with a better solution, but vcing a binary from a different architecture is just kind of bad upon further consideration.
from myaliases.
Related Issues (20)
- options HOT 6
- Reran install script and .included gave me this HOT 2
- cds - too many file descriptors? HOT 3
- wiki better m8 HOT 1
- cds tab complete shell conditional agh HOT 2
- add guidance about setup/install to wiki
- document git and hg and grep
- prepending .included line into .bash_aliases HOT 7
- comments in cds command
- unalias for altalias? HOT 1
- double slashes in cds tab completion HOT 3
- alias in alias command
- test suite HOT 3
- Setup script's jank on an RPI HOT 6
- Setup script should finish off by sourcing HOT 1
- Somehow enforce make
- some ideas
- cds - is not portable
- wsl open cmd overrides default open cmd HOT 2
- WSL 2 alternative to SFTP Net Drive using SSHFS HOT 1
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 myaliases.