Normalize config files#3920
Conversation
|
Currently pointed config files to use storage_config. This is slightly confusing as Alternatively we can create an |
|
What is the motivation for using |
|
No motivation - I misunderstood it at the start and then just got it to a working situation. I will replace that. What's your opinion of using |
9502ca7 to
1416aea
Compare
b125b82 to
c8a68e5
Compare
f4449fb to
447b534
Compare
|
Ready for review! |
daniel-j-h
left a comment
There was a problem hiding this comment.
What do we guarantee wrt. our public headers? (cc @TheMarex) I can see some modifications in publicly exposed config headers - not sure if this is fine for compatibility.
| @@ -0,0 +1,82 @@ | |||
| #ifndef IO_CONFIG_HPP | |||
There was a problem hiding this comment.
Should probably be prefix with OSRM_
| { | ||
| struct IOConfig | ||
| { | ||
| IOConfig() = default; |
There was a problem hiding this comment.
Why is the default constructor needed? A default constructed IOConfig can't do anything, no?
There was a problem hiding this comment.
Yes, I would prefer to drop this as a constructor, but in practice it doesn't work:
osrm-backend/src/tools/extract.cpp
Line 27 in bf6698f
UseDefaultOutputNames function, but I couldn't get it to work like that.
| compressed_node_based_graph_path = {osrm_path.string() + ".cnbg"}; | ||
| cnbg_ebg_mapping_path = {osrm_path.string() + ".cnbg_to_ebg"}; | ||
| restriction_path = {osrm_path.string() + ".restrictions"}; | ||
| intersection_class_data_path = {osrm_path.string() + ".icd"}; |
There was a problem hiding this comment.
Hm is there a way we can make it so that we get a warning if we forget to initialize a path below?
Should this e.g. all be done in the constructor, as in
struct io {
io(path base)
: a(base + '.a'),
b(base + '.b') { }
path a;
path b;
};?
There was a problem hiding this comment.
See above - yes, should be the case, but didn't work out in practice.
There was a problem hiding this comment.
Ok I see. Thanks for explaining! :)
|
Also needs a rebase onto master before we can merge 🎄 |
9c94502 to
80c30b4
Compare
|
From IRC: |
|
Ping @daniel-j-h |
| // Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore | ||
| EngineConfig config; | ||
| config.storage_config = {argv[1]}; | ||
| config.storage_config.UseDefaultOutputNames(argv[1]); |
There was a problem hiding this comment.
Hm user coder here needs to change this is still breaking the api
| *v8::String::Utf8Value(Nan::To<v8::String>(args[0]).ToLocalChecked())); | ||
| std::string base_path(*v8::String::Utf8Value(args[0]->ToString())); | ||
| engine_config->storage_config = osrm::StorageConfig(); | ||
| engine_config->storage_config.UseDefaultOutputNames(base_path); |
| osrm::StorageConfig(*v8::String::Utf8Value(Nan::To<v8::String>(path).ToLocalChecked())); | ||
| std::string base_path(*v8::String::Utf8Value(path->ToString())); | ||
| engine_config->storage_config = osrm::StorageConfig(); | ||
| engine_config->storage_config.UseDefaultOutputNames(base_path); |
| // Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore | ||
| EngineConfig config; | ||
| config.storage_config = {argv[1]}; | ||
| config.storage_config.UseDefaultOutputNames(argv[1]); |
|
Ah I've just seen you added a constructor calling |
|
But in previous versions most subclasses had |
|
Yeah the user should not see the |
3224072 to
c2dbf22
Compare
… to use new io_config constructor
c2dbf22 to
3c2c1a5
Compare
|
Addressed comments (waiting for builds to pass, might have to do some clang-formatting, feel free to leave additional comments) |
|
Yep Travis complains about clang-formating |
|
👍 formatted the file, now waiting for 📗 🍏 |
3c2c1a5 to
5c520e4
Compare
|
One test seemed to have timed out, could you restart? |
|
Thanks for this - it's making some I/O parts nicer for sure! I just merged it into master. ✨ |
Issue
Normalizing the usage & file names across config files by referring to a single config file.
Tasklist
GetPath