-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check in PATH when running target program #961
Comments
I don't think this is a good idea. Your PATH should contain binaries you're interested in executing on your host machine, but pk is a binary you should only ever use in conjunction with a simulator. |
My question is in the context of packaging spike and pk for Guix, a
GNU/Linux distribution. Guix installs executables to non-standard paths
under /gnu/store such as
/gnu/store/sn650n6mzgz4f0sqc9b18d0gp4mls5ld-riscv-pk-1.0.0/bin/pk . To
run spike pk, I have to run something like
$ spike
/gnu/store/sn650n6mzgz4f0sqc9b18d0gp4mls5ld-riscv-pk-1.0.0/bin/pk ...
Note that I don't need to specify the absolute path to spike since it is
in PATH.
I don't think this is a good idea. Your PATH should contain binaries
you're interested in executing on your host machine, but pk is a
binary you should only ever use in conjunction with a simulator.
Ok, that's reasonable.
But, would a different environment variable, say SPIKE_PATH,
SPIKE_CROSS_PATH or similar, be acceptable?
Also, is pk meant to be used exclusively with spike, or does it have a
larger function elsewhere?
|
That is indeed an awkwardly long path. But perhaps this is a problem better solved by writing a shell script or an alias, rather than modifying Spike.
Among other things, it works with rocket-chip (https://github.com/chipsalliance/rocket-chip) and various FPGA and ASIC designs. |
Guix lets you do something like this:
$ spike $(guix build riscv-pk)/bin/pk ...
One can live with that. I was just hoping we could improve the situation
a little bit. But, not to worry too much.
|
When running a target program, spike should look for that program in paths specified by the
PATH
environment variable as well.Currently, when I run
spike pk
with bothspike
andpk
being inPATH
, I get the following error. When I run the same command with the absolute path topk
, it works fine.Thanks!
The text was updated successfully, but these errors were encountered: