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

MarkMojo.java:80-83: The mojo doesn't update program... #1222

Closed
0pdd opened this issue Sep 15, 2022 · 10 comments · Fixed by #1902
Closed

MarkMojo.java:80-83: The mojo doesn't update program... #1222

0pdd opened this issue Sep 15, 2022 · 10 comments · Fixed by #1902
Assignees

Comments

@0pdd
Copy link

0pdd commented Sep 15, 2022

The puzzle 1062-6d8a2439 from #1062 has to be resolved:

* @todo #1062:30min The mojo doesn't update program version if it exists.
* This causes versions like `*.*.*` and `0.0.0` are not updated and remain
* in foreign catalog. This needs to be updated: version must be overridden to
* correct value.

The puzzle was created by rultor on 15-Sep-22.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

@mximp
Copy link
Contributor

mximp commented Sep 15, 2022

@yegor256 any objection on the tasks?

@yegor256
Copy link
Member

@mximp no objections, let's do it

@mximp
Copy link
Contributor

mximp commented Sep 15, 2022

@OlesiaSub Please assist with this

@OlesiaSub
Copy link
Contributor

@mximp could you please give me a quick overview of what is going on in foreign catalog?
And what exactly "program version" is? I thought is it +version meta, but apparently it is something else. Maybe you can tell me where I can find an example to reproduce this issue?

@mximp
Copy link
Contributor

mximp commented Sep 19, 2022

@OlesiaSub you can check the logic behind usage of AssembleMojo.ATTR_VERSION.
In short: the version attribute is set in several phases: register, discover and mark. Actual value is set in mark phase and is taken from resolved dependencies (06-resolve folder).
The issue is that it's set conditionally and the condition is not always correct.

You can think of foreign catalog as a global index of compilation artifacts during EO build.

@OlesiaSub
Copy link
Contributor

@yegor256 can you please help, it is true that to solve this issue I'll have to add a replace method to Tojo in your lib or maybe there is another solution that I didn't think of?

@yegor256
Copy link
Member

@OlesiaSub you can simply use Tojo#set() method. Why not?

@OlesiaSub
Copy link
Contributor

@yegor256 as you stated: "It's illegal to use #set() to change '%s' attribute" and I need to change the version attribute, so it won't work, right?... or am I missing smth

@yegor256
Copy link
Member

@OlesiaSub it's illegal to change id attribute

@mximp
Copy link
Contributor

mximp commented Sep 22, 2022

@yegor256 as you stated: "It's illegal to use #set() to change '%s' attribute" and I need to change the version attribute, so it won't work, right?... or am I missing smth

@OlesiaSub Tojo::set() is used exactly for setting foreign attributes. Check MarkMojo class: actual version attribute is set there.

@volodya-lombrozo volodya-lombrozo self-assigned this Feb 9, 2023
volodya-lombrozo added a commit to volodya-lombrozo/eo that referenced this issue Mar 14, 2023
volodya-lombrozo added a commit to volodya-lombrozo/eo that referenced this issue Mar 14, 2023
volodya-lombrozo added a commit to volodya-lombrozo/eo that referenced this issue Mar 14, 2023
volodya-lombrozo added a commit to volodya-lombrozo/eo that referenced this issue Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants