-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
obj2voxel: init at 1.3.4 #254299
base: master
Are you sure you want to change the base?
obj2voxel: init at 1.3.4 #254299
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta.maintainers
is missing and the commit message should follow https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions
35ffdb0
to
84768e9
Compare
maintainers/maintainer-list.nix
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contents of this file should be commited in a separate commit. You can see the history of that file for good examples of commit messages. Also it needs the githubid. You can look at the top of the file for instructions on how to obtain it.
https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#commit-conventions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will split the commit. AFAIK, the current master
branch doesn't require a githubId
, though: https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix#L7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good to know. Then the split should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the githubId. It helps if you ever change your GitHub handle.
Definitely add github. Otherwise you can't be pinged by https://github.com/ofborg when someone makes a change to this package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more likely scenario would be that I delete my Github handle once I figure out how to deal with various vendor lock-in issues that prevent this ATM.
Feel free to remove your GitHub handle from this file once you do so.
|
||
patches = [ | ||
# pull missing definitions (https://github.com/Eisenwave/voxel-io/pull/3) | ||
./stdlib-defs.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use fetchpatch
with the url https://github.com/Eisenwave/voxel-io/pull/3.patch instead of commiting the file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to look into that. Actually, I first thought about pulling the patch from the commit in the PR mentioned, but it's for a submodule, so it would have to be applied to a subdirectory of the source tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not a blocker. But when patches are available in a more or less stable url, then putting them in the tree is not really needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nagy If I figure out a clean way to apply an external patch to a subdirectory of the source tree, I would actually prefer getting it from the PR. This would avoid duplicated effort since the build errors on aarch64-darwin I see through ofborg should also be pushed upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dotlambda The more likely scenario would be that I delete my Github handle once I figure out how to deal with various vendor lock-in issues that prevent this ATM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchpatch
can add a prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved most patches to corresponding upstream PRs (Eisenwave/voxel-io#4, Eisenwave/voxel-io#3) and switched to fetchpatch
. The remaining patch is specific to 1.3.4
as the upstream head already fixed it.
GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf"; | ||
GIT_CONFIG_VALUE_0 = "git@github.com:"; | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting construction. I assume that your firewall has prevented from loading the submodules via ssh? I Dont know if this is the right way to circumvent this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a workaround suggested here: #195117 (comment)
Not sure whether it's better to require SSH keys on build hosts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then lets keep it. Maybe it will be adapted in fetchgit itself one day.
pkgs/top-level/all-packages.nix
Outdated
@@ -19882,6 +19882,8 @@ with pkgs; | |||
|
|||
obelisk = callPackage ../development/tools/ocaml/obelisk { menhir = ocamlPackages.menhir; }; | |||
|
|||
obj2voxel = callPackage ../tools/graphics/obj2voxel { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also switch this to the new by-name
structure introduced in #237439 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, seems to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about meta.homepage
and meta.mainProgram
?
Should be resolved. |
Not aware of a homepage, but |
|
( | ||
fetchpatch { | ||
name = "fix-aarch64-darwin-type-mismatch.patch"; | ||
url = "https://patch-diff.githubusercontent.com/raw/Eisenwave/voxel-io/pull/4.diff"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a commit url like https://github.com/Eisenwave/voxel-io/commit/2f800f6aca8acd0cc18f9625b411c6dc2956f2ea.patch because a push to the PR branch would invalidate the hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a pull-related patch URL was suggested earlier, and I actually think it makes sense. In case the PR would change, it is likely that the changes are also useful for the maintenance of the nix package, thus justifying an update of the hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to be able to build this package in the far future too so we need stable URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being able to build packages in the far future is a formidable goal. But if it is to be possible without resorting to cache.nixos.org
, I doubt this is the right place to achieve it, though. It's not how Nix package are usually designed. E.g. even with git sources that could be potentially long-term stable, packages tend to reference (potentially unstable) tags instead of cryptographic hashes. I often encounter packages where the URL resource can't be retrieved anymore, or the hash has changed. Which shows that Nix has decided to take a compromise here. Stable URLs are being considered, but may be avoided if there is a reason to.
There is also a reason to reference pull requests instead of commit hashes because pull requests also refer to a specific goal with respect to the upstream source, and possibly the discussion around it. This helps maintainers because later on when changing the package, they can decide whether that specific goal is still relevant.
Nonetheless, the URLs have been changed now to URLs with the objective to remain stable over time. I hope this can relieve your concerns, while still keeping the possibility to look up the related pull request easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can and should always reference the relevant PR and describe what it does in a comment right next to the patch URL, again best of both worlds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added that comment. The stability of commit diff URLs should still not be overestimated, I also saw them disappear in case of force-pushes sometimes.
@@ -67,6 +67,7 @@ stdenv.mkDerivation (finalAttrs: { | |||
meta = with lib; { | |||
description = "Convert OBJ and STL files to voxels, with support for textures"; | |||
mainProgram = "obj2voxel"; | |||
homepage = "https://github.com/Eisenwave/obj2voxel/blob/master/README.adoc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homepage = "https://github.com/Eisenwave/obj2voxel/blob/master/README.adoc"; | |
homepage = "https://github.com/Eisenwave/obj2voxel"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any rationale for this requested change? When looking for a homepage, people usually expect a page where they can read about the project, and not a list of files (which is what is presented when just opening the repo URL). So the README file is what comes closest to a homepage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README is right there when scrolling down, so the request actually allows both users and developers get what they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to point right to the repo as this is how many other packages also do it currently. I still think repo and homepage are not synonymous, and there ought to be an extra field, with the current meaning of "homepage" with that fallback being emulated by doing a meta.homepage or meta.repo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I sometimes abuse meta.downloadPage
for the repo url.
maintainers/maintainer-list.nix
Outdated
gm6k = { | ||
email = "nix@quidecco.pl"; | ||
name = "Isidor Zeuner"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github
and githubId
are still missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not required: https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix#L7
"Optional, but at least one of email, matrix or githubId must be given"
Let's focus on issues relevant to this PR...
, stdenv | ||
, fetchFromGitHub | ||
, fetchpatch | ||
, static ? stdenv.hostPlatform.isStatic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, static ? stdenv.hostPlatform.isStatic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
( | ||
fetchpatch { | ||
name = "fix-aarch64-darwin-type-mismatch.patch"; | ||
url = "https://patch-diff.githubusercontent.com/raw/Eisenwave/voxel-io/pull/4.diff"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to be able to build this package in the far future too so we need stable URLs.
''; | ||
|
||
cmakeFlags = [ | ||
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" | |
"-DBUILD_SHARED_LIBS=${if stdenv.targetPlatform.isStatic then "OFF" else "ON"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
mainProgram = "obj2voxel"; | ||
homepage = "https://github.com/Eisenwave/obj2voxel/blob/master/README.adoc"; | ||
license = licenses.mit; | ||
platforms = platforms.all; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
platforms = platforms.all; | |
platforms = platforms.unix; |
is more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems remarkable, considering that the package does not use any libraries, CMake is known to be very portable, and pure standard C++ even more. So I would have expected that almost any platform can work (modulo maybe patching around some quirks). But since I have no non-unix platform to test here, I'll have to trust your assessment.
} | ||
) | ||
# already fixed in upstream git head | ||
./1.3.4-fix-type-mismatch.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use fetchpatch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, not easily. By now, upstream master avoids the issue because all these size_t
typed variables have been changed to usize
. But this is a rather global change not easily applied, so I decided towards a clear and small patch that just solves the issue remaining after applying the fixes that made it into pull requests.
IMHO, the next best solution would actually be to just build the upstream master. But for now, I decided to keep with the usual policy of building something that has a version number.
, fetchFromGitHub | ||
, fetchpatch | ||
, static ? stdenv.hostPlatform.isStatic | ||
, config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Fixed one month ago. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you squash all obj2voxel:
related commits into one init commit ( so that we have one package and one maintainer commit ) then its fine for me.
Done. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-handle-stuck-reviews/36883/1 |
( | ||
fetchpatch { | ||
name = "add-std-includes.patch"; | ||
url = "https://web.archive.org/web/20230914180442/https://patch-diff.githubusercontent.com/raw/Eisenwave/voxel-io/pull/3.diff"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url = "https://web.archive.org/web/20230914180442/https://patch-diff.githubusercontent.com/raw/Eisenwave/voxel-io/pull/3.diff"; | |
url = "https://github.com/Eisenwave/voxel-io/compare/d902568de2d4afda254e533a5ee9e4ad5fe7d2be...2f800f6aca8acd0cc18f9625b411c6dc2956f2ea.patch"; |
And likewise for the other patch?
Kind of excessive going through archive.org for these just to get a permalink, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed that as requested. Still, I'd like to point out that @dotlambda previously asked for stable URLs from which building in the far future is possible (see #254299 (comment)). The most straightforward way I know to achieve this is archive.org
. github.com
is known to lose commit information through garbage collection, e.g. in case of forced pushes.
d6a9b8e
to
1ff13d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested, but looks reasonable.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3111 |
src = ( | ||
fetchFromGitHub { | ||
owner = "Eisenwave"; | ||
repo = finalAttrs.pname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repo = finalAttrs.pname; | |
repo = "obj2voxel"; |
If we append something to pname, that would no longer be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't sound unreasonable, but wouldn't it be more appropriate to apply this change using a treewide commit supplemented by some contributor documentation to be read by all contributors?
I'm asking because using pname
to construct repo URLs seems to be very common even among new packages, as verified by doing
grep -r 'repo = .*pname' pkgs/by-name
(pkgs/by-name
being a fairly new mechanism)
).overrideAttrs ( | ||
_: { | ||
GIT_CONFIG_COUNT = 1; | ||
GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if we could upstream the url change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, done: Eisenwave/obj2voxel#9
For the time being, the workaround might still be necessary.
I would not merge any new packages with @zeuner as the only maintainer until this is sorted: #273146 (comment) |
I'm not sure what you would want to "sort" in the PR you mentioned. @infinisil already merged a PR which implements the requested code changes about a week ago (#273332), so technically, the PR is done. If you are unhappy with the outcome of a non-related PR, you may express that in the particular PR, or open a new one if appropriate. But if you don't have anything to add to this PR, it doesn't belong here. |
@mweinelt I saw your review comments (#254299 (comment) #254299 (comment)) and already addressed them. So I don't understand why you would mark this PR as a draft. If you see anything that should be changed in your opinion, please state it clearly so it can be addressed. |
229899b
to
53d85a2
Compare
Description of changes
Add package for
obj2voxel
. Fixes #254298.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)