Conversation
|
We are aware of an usability problem with the current state of #3227 due to the fact that some packages ship their own version of required libraries in the same position as "system" libraries. One example is We also thought about implementing some smarter version, i.e. deciding automatically whether to replace, skip or merge two files. However cc @obreitwi |
|
LLVM should vendor it's six.py install to not conflict. That is a bug with LLVM that should be addressed. |
|
There appears to be enough support for ignoring conflicts that the view command would only need to add an |
|
If I recall correctly that only handled the "loading" of packages correctly but not the "activation" of packages |
c20a555 to
25c3ede
Compare
|
I've added code which:
|
25c3ede to
7309d73
Compare
lib/spack/spack/database.py
Outdated
| yield spec.package | ||
| except spack.directory_layout.NoSuchExtensionError: | ||
| continue | ||
| # TODO: conditional way to do this instead of catching exceptions |
There was a problem hiding this comment.
why is catching exceptions a bad idea?
There was a problem hiding this comment.
This is copied from the old implementation. I imagine what is wanted is that instead of throwing an exception when a package doesn't extend a given spec is to return False or some other well-typed return value instead.
There was a problem hiding this comment.
Ah sorry, I mistook the code position. I actually have no idea where this comes into play. However in general I prefer python code that indicates violated assumptions by exceptions instead of using a special invalid marker of the normal return value. I'm not too sure why the exception is caught in the first place (and especially swallowed without a logged event..)
There was a problem hiding this comment.
Looking at the code that does this, it really should return a bool. Currently it throws or it doesn't.
There was a problem hiding this comment.
And this code doesn't need the catch, it is check_activated that does the weird control flow.
41739ab to
237578d
Compare
|
I found the bit which needed fixed for testing to work (a new variable added on this PR needed mocked out as well). Seems I need to fix some Python3 issues. |
19a0ec0 to
8c3bf45
Compare
|
Fixed the Python3 error. The YAML dumper needed to be told what encoding to use explicitly. |
|
|
||
| set(map(self._check_no_ext_conflicts, extensions)) | ||
| # fail on first error, otherwise link extensions as well | ||
| if all(map(self.add_standalone, standalones)): |
There was a problem hiding this comment.
I'm starting to look at this now. I noticed if one of the packages is external and has a prefix like:
packages:
openssl:
paths:
[email protected]: /usr/local
That all of /usr/local will be added. Could you add a check to skip external specs here?
There was a problem hiding this comment.
Ew, yeah, I'll do that.
There was a problem hiding this comment.
OK, fixed and I've added a test for it.
647d7e8 to
ae96766
Compare
scheibelp
left a comment
There was a problem hiding this comment.
I have a couple requests:
- Expanded testing: I specifically mention in comments what I think would be worthwhile. To be clear my goal is not to meet the percent threshold to get a check
- Be more strict when looking for globally-activated packages in
view.view
Let me know if these suggestions seem off track.
lib/spack/spack/cmd/view.py
Outdated
| # status and remove can map the name to packages in view | ||
| specs = relaxed_disambiguate(args.specs, view) | ||
|
|
||
| activated = list(filter(lambda s: s.package.is_extension and |
There was a problem hiding this comment.
The main goal of collecting these is to avoid a case where an extendee package has globally activated extensions and we add it to the view. I think a stronger check here would be to grab the extendee package and check activated_extensions_for. This would also mean changing the checks in test_view_extension_global_activation.
| install('[email protected]') | ||
| install('[email protected]') | ||
| viewpath = str(tmpdir.mkdir('view')) | ||
| view('symlink', viewpath, '[email protected]') |
There was a problem hiding this comment.
IMO it is also worth confirming that the files in the extension1 package were created in the view prefix.
| # License along with this program; if not, write to the Free Software | ||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| ############################################################################## | ||
| from spack.main import SpackCommand |
There was a problem hiding this comment.
Could you add a test for removing extensions from views?
IMO it would also be useful to add a test for a file conflict (two different packages have the same file and are added to a view).
ae96766 to
916d65a
Compare
|
I fixed the symlinking an extendee with global activations and added the other tests as well. |
|
All changes appear good. However, I was looking through packages which implement |
|
Python does the same thing; I just coverted it over to using the same argument setup. |
|
The This may not matter though if |
|
Not sure about |
00c05d4 to
bfcb4a3
Compare
| extensions_layout = args.get("extensions_layout", | ||
| spack.store.extensions) | ||
| if extensions_layout is not spack.store.extensions: | ||
| raise ExtensionError( |
There was a problem hiding this comment.
Also need to import ExtensionError
| # - extension.prefix.lib instead of extension.prefix in LinkTree() | ||
| # - dest_dir instead of self.prefix in tree.(find_conflict|merge)() | ||
| def activate(self, extension, **kwargs): | ||
| extensions_layout = args.get("extensions_layout", |
| tree.merge(dest_dir, ignore=ignore) | ||
|
|
||
| def deactivate(self, extension, **kwargs): | ||
| extensions_layout = args.get("extensions_layout", |
bfcb4a3 to
42edd52
Compare
Aspell compiles in the paths it looks for rather than looking relative to its binary location. There are also no environment variables to redirect it other than changing the path to the configuration file it looks at.
This is used in tests to test real packages without actually building and installing them.
42edd52 to
f4facbb
Compare
|
These test failures do not appear related to the edits so I am closing and reopening to restart tests. |
|
Thanks everyone! |
|
@scheibelp @mathstuf Thanks for getting this done! |
Fix a typo in "spack view hardlink" introduced in #5415 ("os.hardlink" does not exist).
| for s in spack.store.db.installed_extensions_for(spec)] | ||
|
|
||
| if show_all: | ||
There was a problem hiding this comment.
Uhh…probably either stray debugging (unlikely) or an incomplete/untested flag combination.
This is a rebase of #3227 that should be a lot easier to review. Basically, extension availability for views is now computed based on the view itself rather than looking globally.
Cc: @scheibelp