Skip to content
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

[modes] obs-rpm-build+pp: Fix tools prefix priority more. JB#58627 #16

Merged
merged 1 commit into from Aug 30, 2022

Conversation

martyone
Copy link
Member

No description provided.

When there is no separate tools root, i.e., 'tools' == '/', the original
rule catches everything. The 'obs-rpm-build' mode (without +pp) already
does just this.

This fixes commit b730a32.

Signed-off-by: Martin Kampas <martin.kampas@jolla.com>
@Thaodan
Copy link
Contributor

Thaodan commented Aug 30, 2022

To clarify the original change was first 6ccb8be and then 6ccb8be. The issue is now that tools isn't set from init.lua.

@Thaodan
Copy link
Contributor

Thaodan commented Aug 30, 2022

I think bafdfe9 should be changed so tools is always set .

@martyone
Copy link
Member Author

@Thaodan I don't follow, please explain more what you mean. Unless I missed something tools is unconditionally set from lua_scripts/init.lua.

@Thaodan
Copy link
Contributor

Thaodan commented Aug 30, 2022

@Thaodan I don't follow, please explain more what you mean. Unless I missed something tools is unconditionally set from lua_scripts/init.lua.

It's set to "" when tools_root is "/", which is empty. If ignore that check it should be fine.

@martyone
Copy link
Member Author

martyone commented Aug 30, 2022

Hm, maybe I am still missing something?

tools_root = sbox_tools_root
if (tools_root == "") then
tools_root = nil
end
tools = tools_root
if (not tools) then
tools = "/"
end
To me it seems tools is set to tools_root unless tools_root is unset (or empty), in which case tools is set to "/". So tools is always set and never empty.

@Thaodan
Copy link
Contributor

Thaodan commented Aug 30, 2022

Hm, maybe I am still missing something?

tools_root = sbox_tools_root
if (tools_root == "") then
tools_root = nil
end
tools = tools_root
if (not tools) then
tools = "/"
end

To me it seems tools is set to tools_root unless tools_root is unset (or empty), in which case tools is set to "/". So tools is always set and never empty.

Yes you are right but in such as case setting the prefix to tools root would set it to be empty?

@martyone
Copy link
Member Author

Do you mean that tools_prefix would be empty? That's desired I think. It is used through string concatenation, so when tools are under "/", then tools_prefix needs to be empty to avoid double leading slash in paths.

@Thaodan
Copy link
Contributor

Thaodan commented Aug 30, 2022

Do you mean that tools_prefix would be empty? That's desired I think. It is used through string concatenation, so when tools are under "/", then tools_prefix needs to be empty to avoid double leading slash in paths.

I mean that tools should be set to tools_root if tool is empty so has the same content as when you set prefix to tools_root.
Setting prefix to tools_root circumvents in int.lua.

@martyone
Copy link
Member Author

I am afraid I still don't follow your concerns. tools is the effective path to the tools tree. Tools tree may be either a separate tree (called tooling inside SDK) or the host root is used as the tools root (this is how OBS uses sb2). In the former case tools_root is set, in the latter case tools_root is empty/unset

SBOX_TOOLS_ROOT=$SB2INIT_TOOLS_ROOT
. While the tools_root variable holds the raw value, the tools and tools_prefix variables are set so that they can be used irrespective of the fact whether a separate tools root is used or not.

@martyone martyone merged commit a21159c into master Aug 30, 2022
@martyone martyone deleted the jb58627 branch August 30, 2022 15:47
@Thaodan
Copy link
Contributor

Thaodan commented Aug 30, 2022 via email

@martyone
Copy link
Member Author

That is what I mean since the obs uses tools_root tools should be set to to tools root when tools is empty. Now tools is unused and can be removed or used to unify both.

OBS does not use tools_root, it uses tools from host filesystem. Grepping for tools reveals plenty of uses.

I assumed that the rules above are only for python and Perl while the line you changed is for the rest.

The rules above do not match - the interpreter is located under build target. The line I changed matched everything, because tools is "/" on OBS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants