Conversation
…ll to shlex, fix spaces in spec __str__
|
This won't change the hashes will it? |
|
@becker33: You forgot to mention that this disallows the use of |
|
@becker33: can we remove the dash part and just do the escape quotes? |
|
@tgamblin I've added the @adamjstewart This should not change any hashes, it only affects the parser. This should be good to go now code-wise, but I'm leaving the WIP tag on until I can write some unit tests for it. I want to test multiple spec parsing more fully and possibly add some more tests for odd spacing choices. |
|
@tgamblin Should I change install so that it can handle more than one package at once? |
|
@becker33: yes please. |
* Removes the extra argument from Package.do_install while maintaining the changes in behavior pulled in #1603 * install : removed -i and -d shorthands (breaks backward compatibility) * Change ':' to ','
|
I'll create a separate PR to update documentation to match the new parser. |
|
Might as well put documentation fixes in the same PR. |
|
@becker33: still doesn't handle this (these should be the same, assuming This parser thinks the first two are two separate specs. But we can handle that in another PR. |
|
We currently accept the third. If we accept the first two, we cannot accept the third and maintain our support for multiple specs. (Or at least we cannot allow hashes in any but the first spec). |
|
@becker33: how so? |
|
Because the hash actually contains the name of the package, I'm assuming. saying |
|
I'm proposing that currently the It would then be special in that it could both do that and introduce a new spec: |
|
You may ask: why do this? Because of this: $ spack uninstall libelf
==> Error: libelf matches multiple packages:
-- darwin-elcapitan-x86_64 / [email protected] ------------------
yroox5q [email protected]%clang
5iqi6kr [email protected]%clang
==> Error: You can either:
a) Use a more specific spec, or
b) use spack uninstall -a to uninstall ALL matching specs.
$ spack uninstall libelf /5iqi6krWith what I'm proposing, you can just make the previous line more specific. With the current syntax, you have to delete |
A lot of users, including myself, have run into this trap and been confused why this didn't work. I agree that if possible, it would be nice to support this. |
|
@becker33: This is possible. I can help out w/the parser if you have questions. |
|
@tgamblin How is your third line of examples two specs? Are you suggesting that it be two specs if All the rest of your examples seem very doable, since the hash starts a new spec if it is in the first position or if it follows another hash |
|
In general I agree that the use case of adding the hash to an existing command for clarity is compelling. |
Ugh that's a bug. Edited. Sorry! If the hash doesn't match the preceding package name and constraints, it should just raise an exception and say the spec is a contradiction. |
|
Okay, I agree with that specification. How would you feel about adding |
|
@becker33: I'm not sure it's worth it. How about we implement the simple thing first and see whether users run into issues where they really need to start a new spec now, without deleting or reordering... if they do we'll think about how to address it. |
|
Ok, I'll create a new PR for this. |
- Allows hashes to be specified after other parts of the spec - Does not allow other parts of the spec to be specified after the hash - The hash must either end input or be followed by another separate spec - The next spec cannot be an anonymous spec (it must start with a package name or a hash) See #2769 (after it was merged) for further discussion of this interface addition. That discussion resulted in these requirements: ``` python # 1 spec /abc123 # 1 spec python /abc123 # 1 spec /456789 # 1 spec python /abc123 /456789 # 2 specs python /456789 /abc123 # 2 specs /abc123 /456789 # 2 specs /456789 /abc123 # 2 specs /456789 /abc123 python # 3 specs ``` assuming `abc123` and `456789` are both hashes of different python specs.
- Allows hashes to be specified after other parts of the spec - Does not allow other parts of the spec to be specified after the hash - The hash must either end input or be followed by another separate spec - The next spec cannot be an anonymous spec (it must start with a package name or a hash) See spack#2769 (after it was merged) for further discussion of this interface addition. That discussion resulted in these requirements: ``` python # 1 spec /abc123 # 1 spec python /abc123 # 1 spec /456789 # 1 spec python /abc123 /456789 # 2 specs python /456789 /abc123 # 2 specs /abc123 /456789 # 2 specs /456789 /abc123 # 2 specs /456789 /abc123 python # 3 specs ``` assuming `abc123` and `456789` are both hashes of different python specs.
- Allows hashes to be specified after other parts of the spec - Does not allow other parts of the spec to be specified after the hash - The hash must either end input or be followed by another separate spec - The next spec cannot be an anonymous spec (it must start with a package name or a hash) See #2769 (after it was merged) for further discussion of this interface addition. That discussion resulted in these requirements: ``` python # 1 spec /abc123 # 1 spec python /abc123 # 1 spec /456789 # 1 spec python /abc123 /456789 # 2 specs python /456789 /abc123 # 2 specs /abc123 /456789 # 2 specs /456789 /abc123 # 2 specs /456789 /abc123 python # 3 specs ``` assuming `abc123` and `456789` are both hashes of different python specs.
- Allows hashes to be specified after other parts of the spec - Does not allow other parts of the spec to be specified after the hash - The hash must either end input or be followed by another separate spec - The next spec cannot be an anonymous spec (it must start with a package name or a hash) See spack#2769 (after it was merged) for further discussion of this interface addition. That discussion resulted in these requirements: ``` python # 1 spec /abc123 # 1 spec python /abc123 # 1 spec /456789 # 1 spec python /abc123 /456789 # 2 specs python /456789 /abc123 # 2 specs /abc123 /456789 # 2 specs /456789 /abc123 # 2 specs /456789 /abc123 python # 3 specs ``` assuming `abc123` and `456789` are both hashes of different python specs.
Eliminates the need for escape quotes.
TODO: Fix multiple specs. Ideally add (more) unit tests.