Issue #8709 has been updated by bmwiedemann (Bernhard M. Wiedemann).

Status changed from Rejected to Open

There are two problems with unsorted glob:

1) it is different from glob in C, bash and perl that all sort by default. Even GNU make finally switched back to sorted wildcard/glob ( https://savannah.gnu.org/bugs/index.php?52076 )

2) it causes problems for reproducible builds, so that developers have to patch an infinite number of callers such as

https://github.com/sass/sassc-ruby/pull/178

to be able to get identical build results on identical OSes on different machines.

----------------------------------------
Bug #8709: Dir.glob should return sorted file list
https://bugs.ruby-lang.org/issues/8709#change-83770

* Author: tommorris (Tom Morris)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 1.9.3p429 (2013-05-15) [x86_64-linux] Brightbox
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN
----------------------------------------
On OS X, Dir.glob and Dir[] return an ordered list of files.

On Ubuntu Linux, they do not and one must manually sort them.

Returning a list of files that isn't in order fails the Principle of Least Astonishment.

I attach a unit test to demonstrate ideal behaviour.

---Files--------------------------------
globtest.rb (454 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>