-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Long config options seem to be 'lost' #4370
Comments
That's very odd, as bundler uses the YAML module to serialize the config file |
Yeah, it looked like YAML output, but the reader seems to be doing something.. 'fancy'.. Especially since it's trying to show me the YAML pipe |
what's the output out |
Sorry, didn't see this yesterday. Yes the YAML module loads the config correctly, when using I have replicated this issue on an ubuntu machine and a red hat one, running different ruby and bundler versions. Are you not seeing the same issue? |
I was able to reproduce it on my machine. Problem seems to be related with the regex in Bundler::Settings#load_config Changing to |
Yeah, I actually fixed this for myself last weekend by changing load_config to: def load_config(config_file)
valid_file = config_file && config_file.exist? && !config_file.size.zero?
if !ignore_config? && valid_file
require "bundler/psyched_yaml"
config = YAML.load_file(config_file)
if config.is_a?(Hash)
return config.select { |key|
key.match(/^(BUNDLE_.+)/)
}.map { |key, value|
[convert_to_backward_compatible_key(key), value]
}.to_h
end
end
{}
end I decided against making a pull request because I figured such a change might cause compatibility issues that I'm not really willing to put my name next to. And I'm also pretty bad at ruby so, there's that too :P |
Yeah, we can't use the |
But you can use it to write the config? 😕 Well. Okay. The regex fix works well enough then. |
Yeah, since the config is never written to when using |
I'm assuming your bundler/psyched_yaml module guarantees that your output format will always be the same, but I'm just having trouble reasoning why you bother saving it as YAML at all, if it can lead to strange errors like this. Why not just stick with a more basic format? My 'bonus question' is.. why would an alternate psych version not be able to.. read YAML? Or is the problem something deeper than that? |
the problem is that we could activate the incorrect version of psych |
We have to, to be backwards compatible. There's a long history around this that has involved lots of pain for us, believe me :( |
Ooooh. I get it. Well, carry on then. Thanks for fixing this. |
…dins Improve loading config files Closes #4370.
So, bundler seems to be 'losing' my rather long build options whenever it updates the config:
Contents of .bundle/config:
Note that it can't seem to read the last line, specifically.
Annoyingly, it works if I manually fix up the config to only use one or two lines, but any time bundler tries to regenerate the config, it's broken again.
The text was updated successfully, but these errors were encountered: