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

Adding dependencies ordering constraint during linking #172

Closed
wants to merge 4 commits into from

Conversation

bobot
Copy link
Collaborator

@bobot bobot commented Jun 28, 2017

Add the field dependencies_ordering to executable stanza.

(dependencies_ordering ((<librarie> <librarie>) ...) each pair specifies that the first library must be linked before the second one. Both libraries must already appear directly (not in a select) in the libraries field. It can be used for fixing missing dependencies in external libraries. More interrestingly it could be used to make sure that the initialization of a library will be executed before the initialisation of another one because of some side effects.

bobot added 4 commits June 28, 2017 11:29
Add additionnal dependencies between libraries, in order to force some
ordering during linking.

Could be used for fixing missing dependency in an external library, or
to control the order of side effects in local libraries (ex: to change
some default configuration for specific executables).
@ghost
Copy link

ghost commented Jun 28, 2017

It can be used for fixing missing dependencies in external libraries

Why not fix the library instead?

More interrestingly it could be used to make sure that the initialization of a library will be executed before the initialisation of another one because of some side effects.

Do you have an example where this matters?

@bobot
Copy link
Collaborator Author

bobot commented Jun 28, 2017

It can be used for fixing missing dependencies in external libraries

Why not fix the library instead?

It must also be done but in the mean time you have a possible quick fix.

More interrestingly it could be used to make sure that the initialization of a library will be executed >>before the initialisation of another one because of some side effects.

Do you have an example where this matters?

You can look at the test example. If you have a program which is duplicated into two binaries one for the command line and the other graphical. You want to change the behavior of the shared part depending in which binary it is. For example in one case logging can be written on stderr in the other case it must be written in a specific gtk text area.

@ghost
Copy link

ghost commented Jun 29, 2017 via email

@bobot
Copy link
Collaborator Author

bobot commented Jun 29, 2017

It seems to me that #136 offers a much cleaner solution to this problem.

Indeed it is true, or if it is not I at least should try to use it. I'm going to close this MR. But are you interested in 0d91fe7 ? It think it is easier to convince oneself of the correctness with Top_closure than with remove_dups_preserve_order.

@bobot bobot closed this Jun 29, 2017
@ghost
Copy link

ghost commented Jun 30, 2017

Well, it is correct though so it's doing more work for nothing. We could add a helper function to make this clearer:

val merge_top_sorted : ('a * 'a list) list -> 'a list

@bobot bobot mentioned this pull request Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant