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

WIP: pms: init at 0.42 #76188

Closed
wants to merge 2 commits into from
Closed

Conversation

matthiasbeyer
Copy link
Contributor

WIP, can a go person help me here?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
@matthiasbeyer
Copy link
Contributor Author

@bjornfor @rvolosatovs @zimbatm you maintain go packages, can you explain what's the error here telling me, please?

@bjornfor
Copy link
Contributor

Where's the error? I don't think I maintain any go package, but I'm interested in learning how to (package golang projects with Nix).

@matthiasbeyer
Copy link
Contributor Author

The error is:

$ nix-build -A pms
these derivations will be built:
  /nix/store/c03q6swidr4ziqib3z4vhkzs6g23amc1-pms-0.42-go-modules.drv
  /nix/store/fk0dpczhf39qkz13x5y4a2qsih8h7n38-pms-0.42.drv
building '/nix/store/c03q6swidr4ziqib3z4vhkzs6g23amc1-pms-0.42-go-modules.drv'...
unpacking sources
unpacking source archive /nix/store/vmw9qfadynclkyfjihvrb5xizimp2qj0-source
source root is source
patching sources
configuring
building
go mod download: no modules specified (see 'go help mod download')
builder for '/nix/store/c03q6swidr4ziqib3z4vhkzs6g23amc1-pms-0.42-go-modules.drv' failed with exit code 1
cannot build derivation '/nix/store/fk0dpczhf39qkz13x5y4a2qsih8h7n38-pms-0.42.drv': 1 dependencies couldn't be built
error: build of '/nix/store/fk0dpczhf39qkz13x5y4a2qsih8h7n38-pms-0.42.drv' failed

@matthiasbeyer
Copy link
Contributor Author

Well, at least on my machine?

@matthiasbeyer
Copy link
Contributor Author

So this is a step forward, but the result is empty after this...

Someone with go experience please!

@rvolosatovs
Copy link
Member

rvolosatovs commented Jan 6, 2020

I'd suggest you:

  1. clone the upstream repository
  2. checkout the required version(0.42)
  3. run go mod download in the repository
  4. check in all modified/created files (most probably only created go.sum)
  5. create a patch containing all changes - e.g. git show > go-modules.patch on Linux - note that example may lack newline at the end of file
  6. move the patch from 5. to directory containing this package
  7. change buildGoPackage to buildGoModule
  8. remove goDeps and goPackagePath
  9. add patches attr containing the filename of patch from 5. For example:
{
	# other attrs ...
	patches = [
		go-modules.patch
	];
}

Preferrably file a PR upstream with changes from 5., most importantly containing go.sum

@matthiasbeyer
Copy link
Contributor Author

go mod download does not create any files in the repository for me.

@rvolosatovs
Copy link
Member

There's no go.sum?
That's weird.
You can also try go mod init and/or go mod vendor, but I'm quite sure go.sum should have been created.

Are you using the latest master commit? Do you see go.mod present(I see it's there on master https://github.com/ambientsound/pms/blob/master/go.mod)?

@rvolosatovs
Copy link
Member

rvolosatovs commented Jan 9, 2020

If you're using 0.42, then it will not work, because that is not even a Go project. It's seems that tagged commit is from 2010, so not sure we should merge that in the first place.

What I would suggest is to use master directly and follow the steps in #76188 (comment). AFAIK the naming convention for such cases is to name the package X-unstable, i.e. pms-unstable in this case.

@matthiasbeyer
Copy link
Contributor Author

Too much hassle for me, sorry.

@matthiasbeyer matthiasbeyer deleted the add-pms branch January 10, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants