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

Allow cargo.toml #45

Closed
steveklabnik opened this issue Jun 24, 2014 · 44 comments
Closed

Allow cargo.toml #45

steveklabnik opened this issue Jun 24, 2014 · 44 comments

Comments

@steveklabnik
Copy link
Member

From http://www.reddit.com/r/rust/comments/28xyrc/cargo_alpha_is_here/cifnlkg

Would be nice to be consistent with make, and while I prefer Cargo.toml, apparently a bunch of people feel the other way.

@tbu-
Copy link
Contributor

tbu- commented Jun 24, 2014

I'd say a standard is better than everyone doing as they want.

@thehydroimpulse
Copy link

Agreed. Cargo.toml feels a bit unnatural when all other files are lowercased.

@steveklabnik
Copy link
Member Author

@tbu- normally, I'd agree with you, but we also have to consider case-insensitive filesystems.

@tbu-
Copy link
Contributor

tbu- commented Jun 24, 2014

@steveklabnik Fair point.

@gilles-leblanc
Copy link
Contributor

I have started looking into this.

@steveklabnik Do we want to be case-insensitive for so we can support case-insensitive systems or do we simply want to allow Cargo.toml and cargo.toml ?

@steveklabnik
Copy link
Member Author

I personally feel we should do what make does: look for a cargo.toml and then a Cargo.toml. I'd like to hear @wycats 's thoughts though.

@wycats
Copy link
Contributor

wycats commented Jun 24, 2014

Capital letters group it together with other similar configuration files and avoids it from being interspersed with other files and directories.

@gilles-leblanc
Copy link
Contributor

@wycats I know in Ruby I'm used to seing Gemfile, Rakefile and other files with a leading capital letter.

There are many possible conventions.

Another one is dot files with a prefixed dot followed by all lowercase letters.
Make seems to use all lowercase letters by default with no dot.
I'm also used to seeing .yml or .json config files all in lower case.

So I guess there's a lot of different styles. I would be partial to allowing cargo.toml but it wouldn't bother me either way as a Cargo user.

Tell me guys if we should continue with this one or if we should close it and keep the current convention.

If we go ahead I'll try and make a patch.

@wycats
Copy link
Contributor

wycats commented Jun 24, 2014

You don't want a leading . because that cuts against the grain of the git CLI.

I'd rather stick with the current convention, for the reasons I described. We can revisit this if it causes real problems.

@wycats wycats closed this as completed Jun 24, 2014
@brendanzab
Copy link
Member

Capital letters group it together with other similar configuration files

What other configuration files?

@sinistersnare
Copy link

@bjz id imagine Rakefile, Makefile, Gemfile at least. Notice that none of these have file extensions, whereas Cargo.toml does.

Id prefer cargo.toml or Cargofile. It is strange to have the capitalized word and the file extension.

Cargofile is more to 'convention' than @wycats's argument. Config files with file extensions such as 'setup.py', 'project.clj' and 'pom.xml' all start with lowercase. Cargo's approach seems to be actually _most_ against the current convention than anything I have seen so far.

@asb
Copy link

asb commented Jun 27, 2014

+1 for Cargofile or cargo.toml. Cargo.toml is a weird merging of two conventions.

@aroman
Copy link

aroman commented Jul 5, 2014

Another +1 for the proposed compromise — Cargofile or cargo.toml — rather than the current Cargo.toml. I can't think of a single other language that follows the Capitalized + extension convention for non-source files.

@SadieCat
Copy link

SadieCat commented Jul 5, 2014

I agree with making it lower cased. In general, build system file names either match ^[A-Z][a-z]+file$ or ^[a-z]+\.[a-z]+$. It isn't very common to use a mix of both. The only exception I can think of is CMake but I think that was designed in Windows land where everything needs a file extension.

@beatgammit
Copy link

You don't want a leading . because that cuts against the grain of the git CLI.

@wycats - How so? In my projects, I have .gitignore, .jshintrc and other dot-prefixed files. They seem to behave as any other named file from my experience.

Another +1 for the proposed compromise — Cargofile or cargo.toml — rather than the current Cargo.toml. I can't think of a single other language that follows the Capitalized + extension convention for non-source files.

I agree. I would prefer cargo.toml, but wouldn't complain too loudly against Cargofile. Nearly every configuration file I use is lowercase (granted, without an extension), and there's already precedent for ^[a-z]+\.[a-z]+$ (among others already mentioned):

  • npm: package.json
  • bower: bower.json (which admittedly is probably following npm's lead)
  • cabal: <project>.cabal (e.g. cargo.cabal)
  • luarocks: <project>-<version>.rockspec
  • ant: build.xml

I'm sure there are more examples for both sides, but I don't think there's an argument for saying ^[a-z]+\.[a-z]+$ is any less standard than ^[A-Z][a-z]+\.[a-z]+$. There is, however, precedent for lower-case filenames in Rust and on case-sensitive filesystems, and it doesn't matter as much for case-insensitive filesystems, so the preference (IMHO) should go to the more restrictive environment.

I haven't used a case-insensitive filesystem for years, so I'm a bit out-of-the-loop in terms of conventions there, so I could be missing something important.

@mahkoh
Copy link

mahkoh commented Sep 4, 2014

@wycats

Capital letters group it together with other similar configuration files and avoids it from being interspersed with other files and directories.

I don't care either way but this is only true with LC_COLLATE=C and not with en_US.UTF-8.

@brendanzab
Copy link
Member

Having a .toml file extension is good for syntax highlighters, so cargo.toml > Cargofile > Cargo.toml for me.

@sinistersnare
Copy link

@wycats can you please comment on the discourse thread for this issue? there has been a lot of discussion in favor of cargo.toml instead of uppercase Cargo.toml.

@tbu-
Copy link
Contributor

tbu- commented Sep 17, 2014

I guess there isn't such a large discussion because this is mostly bikeshedding. (?)

@asb
Copy link

asb commented Sep 18, 2014

@tbu- it kind of is, but on the other hand Cargo seems to arbitrarily choose to eschew either of the standard naming conventions for this sort of file (either cargo.toml or Cargofile) as @beatgammit explains

@jestan
Copy link

jestan commented Oct 7, 2014

+1 for cargo.toml or Cargofile. I just started using Cargo and felt strange about the build filename

@tbu-
Copy link
Contributor

tbu- commented Nov 8, 2014

@headcrab-in-my-room CMake.

@dbrgn
Copy link
Contributor

dbrgn commented Dec 12, 2014

+1 for cargo.toml > Cargo.toml

@shawnscode
Copy link

+1 for cargo.toml

@skyne98
Copy link

skyne98 commented Jan 12, 2019

+1 for cargo.toml too

@richardmatheson
Copy link

Cargo.toml is fine. So is cargo.toml. I definitely don’t like Cargofile. Don’t think it’s worth getting het up over though.

@yhojann-cl
Copy link

yhojann-cl commented May 8, 2021

Today I have asked myself: why cargo use a capital letter? I have looked for information about it and I have come to this place.

Uppercase files smell like Windows files to me unless you use a programming style where all source files must start with uppercase like java, but rust is derived from c so it should be normal to find everything lowercase.

It also bothers me a bit that the configuration format is so old, like the windows .ini files, if rust is a modern language, why didn't you use manifest or json structure files?

Mozilla always tends to privilege technology towards windows and this ideology has been impregnated in rust lang, this is not fair because rust is multiplatform.

@steveklabnik
Copy link
Member Author

steveklabnik commented May 9, 2021

why cargo use a capital letter? ... Uppercase files smell like Windows files to me

It's the opposite, it's because Makefile with a capital M is traditional in the Unix world.

It also bothers me a bit that the configuration format is so old,

TOML was created in 2013, and this decision was made in 2014.

Mozilla always tends to privilege technology towards windows and this ideology has been impregnated in rust lang,

Mozilla had nothing to do with these choices, but the Rust project does care about Windows quite a bit, like all of our platforms.

@ghost
Copy link

ghost commented Jul 6, 2022

+1 for cargo.toml

@Mudbill
Copy link

Mudbill commented Feb 5, 2023

Today I searched "Why is Cargo.toml upper case." A strange thing to search, I admit, and I'm not sure if it's me being pedantic or nitpicky, or if it actually makes an aesthetic difference.

Either way, considering Rust promotes snake_case conventions, I too find it odd that Cargo.toml has an uppercase.

But today I also found out I can simply rename it to use a lower case and everything works. That makes me happy.

Though for the sake of convention, I'm here to put my vote for cargo.toml.

@wjthieme
Copy link

+1 for cargo.toml

@nathanfranke
Copy link

+1 for cargo.toml, should be re-opened for discussion

@frvojacek
Copy link

While there may not be an exactly strong reason to allow this, I don't see much sense and a reason to specifically forbid this. A project may have a specific naming convention. I would leave the decision on projects.

@frvojacek
Copy link

frvojacek commented Mar 28, 2023

But today I also found out I can simply rename it to use a lower case and everything works. That makes me happy.
@Mudbill

A Cargo project will compile without errors with cargo.toml only on operating systems with a case-insensitive file system1 such as Microsoft Windows.2

Compilation on operating systems with a case-sensitive file system will result in
error: could not find Cargo.toml, but found cargo.toml please try to rename it to Cargo.toml

Footnotes

  1. Filename Letter case preservation

  2. Differences between Windows and Linux case sensitivity

@Mudbill
Copy link

Mudbill commented Mar 28, 2023

@FrantisekVojacek That's strange, because I've been doing this on macOS since my comment without any issue or error as such.

@AlexAegis
Copy link

AlexAegis commented Mar 28, 2023

@Mudbill Because macOS's filesystem is also case insensitive

source: https://discussions.apple.com/thread/251191099

@Mudbill
Copy link

Mudbill commented Mar 28, 2023

@AlexAegis Oh, wow. I was certain it wasn't, it being Unix based and all. I thought Windows was the only odd one here. My world is falling apart before my eyes 😅
Carry on then.

@bsdayo
Copy link

bsdayo commented Sep 2, 2023

+1 for cargo.toml

@Dashbloxx
Copy link

I'll move from C to Rust if they can rename Cargo.toml to Cargofile or cargo.toml

@quadgod
Copy link

quadgod commented Dec 6, 2023

+1 for cargo.toml

@ghost
Copy link

ghost commented Feb 3, 2024

why cargo use a capital letter? ... Uppercase files smell like Windows files to me

It's the opposite, it's because Makefile with a capital M is traditional in the Unix world.

But, when there is no extension.

@jimmymcheung
Copy link

Capital letters group it together with other similar configuration files and avoids it from being interspersed with other files and directories.

Do we have more config file start with c? Because I think files are group first by letters, then by whether it is capital or not

@jimmymcheung
Copy link

It also bothers me a bit that the configuration format is so old, like the windows .ini files, if rust is a modern language, why didn't you use manifest or json structure files?

I’d prefer xml file or the current used syntax. Big dislike to json.

@ogxd
Copy link

ogxd commented Mar 31, 2024

Waiting for this issue to be re-opened...

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

No branches or pull requests