#44267 closed defect (fixed)
root6: Portfile parse problem when root5 installed
Reported by: | mf2k (Frank Schima) | Owned by: | mojca (Mojca Miklavec) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.99 |
Keywords: | Cc: | cjones051073 (Chris Jones) | |
Port: | root6 |
Description
When I recently ran selfupdate, I saw the following message:
Error: Cannot install root6 with +python27 variant Failed to parse file science/root6/Portfile: root5 port is already installed with +python27 and both cannot be active at once. Pick a different python variant.
$ port info root6 Error: Port root6 not found
$ port installed root5 The following ports are currently installed: root5 @5.34.18_0+cocoa+gcc48+graphviz+gsl+minuit2+opengl+python27+roofit+soversion+ssl+tmva+xml (active)
Attachments (1)
Change History (10)
comment:1 Changed 10 years ago by mojca (Mojca Miklavec)
comment:2 Changed 10 years ago by cjones051073 (Chris Jones)
As Mojca says, it is intentional that root5 and root6 cannot be installed with the same python variants, due to a conflict (both ned to install the same files in the same places).
However, the failed to parse error above does look like a side effect of making +python27 default with root6, which occurs when the user already has root5 installed with that variant. Maybe we could work around this by delaying the python variant overlap check to a later phase, like build, so it doesn't cause things like info to fail ... ?
Chris
comment:3 Changed 10 years ago by cjones051073 (Chris Jones)
Hi,
I cannot pre-produce your 'failed to parse' error, but I can reproduce the general issue that various port commands don't give much useful information once root5 is installed with +python27, and with root6 having that variant enabled by default
macmini ~ > sudo port install root6 Error: Cannot install root6 with +python27 variant Error: Unable to open port: root5 port is already installed with +python27 and both cannot be active at once. Pick a different python variant. macmini ~ > sudo port info root6 Error: Cannot install root6 with +python27 variant Error: Unable to open port: root5 port is already installed with +python27 and both cannot be active at once. Pick a different python variant. macmini ~ > sudo port variants root6 Error: Cannot install root6 with +python27 variant Error: Unable to open port: root5 port is already installed with +python27 and both cannot be active at once. Pick a different python variant.
I have a patch that proves moving the check to a later phases fixes the above. It worked for me moving it to pre-activate, but this is not ideal as it would mean in some cases the user would only find out after the long build. I couldn't though find a phase that both worked and avoided this... ? I attach the patch just for reference...
Chris
Changed 10 years ago by cjones051073 (Chris Jones)
Attachment: | root-python-check.diff added |
---|
comment:4 Changed 10 years ago by mf2k (Frank Schima)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks! That fixes the problem. r121860.
comment:5 follow-up: 6 Changed 10 years ago by mojca (Mojca Miklavec)
But that's "slightly suboptimal". If you have root5 +python27
installed, your machine could spend 4 hours compiling root6 +python27
(hopefully less), only to tell you that the variant conflicts with root5
just before activation. Personally I'm not a big fan of this solution (even though I admit that it at least solves one weird problem). I would ask others for help.
comment:6 Changed 10 years ago by cjones051073 (Chris Jones)
Replying to mojca@…:
But that's "slightly suboptimal". If you have
root5 +python27
installed, your machine could spend 4 hours compilingroot6 +python27
(hopefully less), only to tell you that the variant conflicts withroot5
just before activation. Personally I'm not a big fan of this solution (even though I admit that it at least solves one weird problem). I would ask others for help.
Agreed, its not ideal, but I think better than before...
As I said, I tried various other phases to perform the check in, but none seemed to work and avoided the long unnecessary build. If someone else can suggest something better, all the better...
Chris
comment:7 Changed 10 years ago by mf2k (Frank Schima)
I don't see that as a big deal. Someone might actually want both versions. They can then switch between the 2 versions by simply deactivating one and activating the other without rebuilding. It's much better than not even being able to see that root6 exists.
comment:8 Changed 10 years ago by mojca (Mojca Miklavec)
I'm sorry to ask, but what's the point of raising an error in pre-activate
? Doesn't macports raise an error before activation anyway?
comment:9 Changed 10 years ago by mojca (Mojca Miklavec)
That is: because it notices conflicting files. I believe that we should figure out how to use the active_variants
PortGroup here.
"Failed to parse root" looks like a bug, but how should this be implemented / what behaviour would you expect? If you manually enabled
+python27
forroot5
, that conflicts withroot6
withpython27
enabled by default. What should the portfile do in cases when python is already installed withroot5
?