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

Master vs Main #205

Open
JonathanLorimer opened this issue Jul 16, 2021 · 11 comments
Open

Master vs Main #205

JonathanLorimer opened this issue Jul 16, 2021 · 11 comments

Comments

@JonathanLorimer
Copy link

JonathanLorimer commented Jul 16, 2021

Hello, there is an issue where (if a repo uses main instead of master) generatedCargoNix fails. The offending line is here https://github.com/kolloch/crate2nix/blob/master/tools.nix#L237. Unfortunately master is a sensible default given legacy repos, and main is sensible given github's new default naming schema. Perhaps we could allow the user to configure the default branch?

@JonathanLorimer
Copy link
Author

JonathanLorimer commented Jul 16, 2021

#206

I think this PR would solve the issue?

@yusdacra
Copy link
Member

Can you try and see if the feat/builtinfetchgit branch of https://github.com/yusdacra/crate2nix fixes the issue?

@JonathanLorimer
Copy link
Author

JonathanLorimer commented Jul 21, 2021

@yusdacra Oh yeah, this worked! Thank you!

@JonathanLorimer
Copy link
Author

Also, switching to your branch seems to have resolved this issue #207

@yusdacra
Copy link
Member

@yusdacra Oh yeah, this worked! Thank you!

That's good to hear. I've been meaning to make a PR for upstream, but that particular branch has so many changes and fixes it's kind of hard to :P

@JonathanLorimer
Copy link
Author

I did also notice this warning. Not sure if its helpful.

trace: warning: crate2nix: Passing `buildRustCrate` as argument to Cargo.nix is deprecated. If you don't customize `buildRustCrate`, replace `callPackage ./Cargo.nix {}` by `import ./Cargo.nix { inherit pkgs; }`, and if you need to customize `buildRustCrate`, use `buildRustCrateForPkgs` instead.

@JonathanLorimer
Copy link
Author

JonathanLorimer commented Jul 21, 2021

I think it would be very worthwhile to get your branch merged. Especially since crate2nix is looking to release a verion 1.0

@Ericson2314
Copy link
Collaborator

There's two branches being discussed here, the PR and the other one. Which is preferred? I am not sure I've encountered tools.nix yet -- so I am not really sure what is going on.

@au-phiware
Copy link

Using master as the name of the default branch was always only a convention and I have encountered varied opinions and alternative conventions in the past. It is not just master vs. main; right now I am working in an organisation that takes the stance: "the tip of the repo contains the latest developments; we call it develop." I've met SVN die-hards that straight up call it trunk. GitHub is leading the charge and setting a new trend with main. The fact is that all are valid and, in this day and age, your likely to encounter a mix of more than just one. Therefore no fallback value will fit all scenarios; it doesn't matter if I can override the fallback value or not (i.e. some repos will need master, others main, yet more others something else!) The fetchGit function is capable of making the decision itself (i.e. ref = null;).

@Ericson2314
Copy link
Collaborator

The fetchGit function is capable of making the decision itself (i.e. ref = null;).

Yeah the remote-side HEAD symref is the gold standard here.

@DieracDelta
Copy link

What's the recommended workaround? Forking and s/master/HEAD seems to work, but this is rather inelegant.

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

5 participants