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] Bugzilla #26546

Closed
wants to merge 2 commits into from
Closed

[WIP] Bugzilla #26546

wants to merge 2 commits into from

Conversation

vaartis
Copy link
Contributor

@vaartis vaartis commented Jun 13, 2017

Motivation for this change

There was no bugzilla expression
So.. This is my first contribution and i am not quite sure if everything is good, there probably should be some kind of systemd service to launch bugzilla but i don't really know how to write them. There are also some of bugzilla's CPAN dependencies. Please, help me on systemd service and finilizing the package

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@vaartis
Copy link
Contributor Author

vaartis commented Jun 13, 2017

Perl packages can be merged, i think, should i put them in a separate PR?
/cc @joachifm

@joachifm
Copy link
Contributor

If the packages are useful on their own, I think it makes sense to merge them before the systemd service is ready.

I don't see much to nitpick about here, except maybe providing proper licenses for all packages or at least indicating whether they're free software.

@rycee may be able to help more with the Perl stuff.

@qknight
Copy link
Member

qknight commented Jun 14, 2017

@joachifm
i think we should allow unknown in principle but in an extra commit add it to lib/licenses.nix and

  unknown = {
    fullName = "unknown";
    free = false;
  };

what do you think?

@vaartis you can simply put all the perlPackages into one PR. that said, i would even squash this whole PR into one commit.

@vaartis
Copy link
Contributor Author

vaartis commented Jun 14, 2017

@joachifm this licenses are taken from CPAN, some of them are marked as unknown on cpan, there are other like those in the same file, really. Also, you can't really close the source of perl programms, can you?
@qknight alright, i'll move them to a separate PR and squash into one commit

@rycee
Copy link
Member

rycee commented Jun 14, 2017

Unfortunately many CPAN authors don't set correct meta information for the license but usually you can find it out by browsing the package a bit.

In particular

About squashing I personally prefer one commit per init but I have no strong feelings about it. I'm fine with having something like perlPackages: init several packages as the commit header and have individual lines in the commit message body, e.g., EmailReply at 1.204.

@vaartis
Copy link
Contributor Author

vaartis commented Jun 14, 2017

Perl modules PR: #26569

@vaartis
Copy link
Contributor Author

vaartis commented Jun 14, 2017

@joachifm so.. i've kind of written the service, but how do i test it? Obviously, it isn't available from system-wide configuration.nix, so how do i start it then?

@joachifm
Copy link
Contributor

@vaartis you can add the module to https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/module-list.nix or add it to the imports in your configuration.nix. Then you can use it like any other module.

@joachifm
Copy link
Contributor

Or you can define the service inline in configuration.nix, as in systemd.services.bugzilla = { ... }.

@rasendubi
Copy link
Member

Also, you can't really close the source of perl programms, can you?

Licenses are not really about closing sources. You can publish your source publicly still forbid anyone to use it; on the other hand, you can do open source license with closed code: you only need to provide source code when you sell the software.

To the topic... the PR looks good superficially, though indentation level is 4 spaces when most of nixpks use 2.

For systemd module, check out nixos/modules/services directory—it has plenty of examples. You should grasp the pattern quickly.

@vaartis
Copy link
Contributor Author

vaartis commented Jun 14, 2017

Thanks! Also, aparently there is an error in httpd module, which breaks mod_perl. Somebody moved httpd modules into pkgs.apacheHttpdPackages, but did not update httpd service, it seems

mod_perl fix: #26579

@vaartis
Copy link
Contributor Author

vaartis commented Jun 15, 2017

The option services.httpd.adminAddr is used but not defined.
Well, i don't even know what to do with this.. It really isn't defined in httpd, but used in several other expressions

@qknight
Copy link
Member

qknight commented Jun 15, 2017

the option adminAddr is enforced so that you pass in an email address.

are you packaging bugzilla as a submodule for httpd? have a look at this mediawiki example:

https://web.archive.org/web/20160829175239/https://nixos.org/wiki/MediaWiki

@vaartis
Copy link
Contributor Author

vaartis commented Jun 15, 2017

Hmm.. Is there any way to test httpd submodule without rebuilding whole system to the latest version from github (used it by setting NIX_PATH to checked out dir). Just importing bugzilla httpd submodule says that httpd's documentRoot and other do not exist..

@qknight
Copy link
Member

qknight commented Jun 15, 2017

build the system

nixos-rebuild -I nixpkgs=../mymodified/nixpkgs/ switch

is the command you can use to build your new webserver. if you want to test on master, then you probably have to rebuild much software but only commits on master are valuable, since we always commit to master and not 17.03 (or similar).

to deveop a feature it might be a good idea to use 17.03 as basis (or whatever you are working on, see your nix-channel).

using nixos-container

if you don't want to 'modify' your host operating system, in case you are working on nixos, you can either go for VirtualBox with nixops or use nixos-containers:

https://lastlog.de/blog/posts/advanced_webservices_on_nixos_revisited.html

@vaartis
Copy link
Contributor Author

vaartis commented Jun 15, 2017

I don't think nixos-rebuild -I nixpgs=/home/vaartis/Code/nixpkgs/ test is working.. It just seems like it ignores the path and uses the system one

error: getting status of ‘/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/services/web-servers/apache-httpd/bugzilla.nix’: No such file or director

So, it doesn't use my path, despite apache and bugzilla being there

@bjornfor
Copy link
Contributor

I don't think nixos-rebuild -I nixpgs=/home/vaartis/Code/nixpkgs/ test is working..

Typo: nixpgs -> nixpkgs

@nbp nbp requested a review from garbas June 15, 2017 21:25
Copy link
Member

@garbas garbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vaartis again, thank you.

💯 from my side. Once we have it packaged we can look how to generate Perl expressions via carton or such Perl packaging tools.

I'm approving this ahead of time, since I wont have time in coming days.

name = "bugzilla-5.1.1";

src = fetchurl {
url = "https://ftp.mozilla.org/pub/webtools/${name}.tar.gz";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it would be better to fetch from github directly https://github.com/bugzilla/bugzilla

@vaartis
Copy link
Contributor Author

vaartis commented Jun 16, 2017

@bjornfor oh... My bad

@vaartis
Copy link
Contributor Author

vaartis commented Jun 17, 2017

So.. bugzilla requires the configure script to be ran by somebody in wwwrun group, but nixbld user is not in that group, how can i add it to group?
UPD: Also, now bugzilla can't find perl modules in other nix storages, because PERL5LIB seem to reset. Group problem still unresolved

@vaartis
Copy link
Contributor Author

vaartis commented Jun 17, 2017

So, i've just pushed everything i could do with it, probably cannot continue it until i figure out how to add modules to apache perl search path. Any ideas?

Jun 17 17:49:53 Nyak httpd[16207]: AH00526: Syntax error on line 168 of /nix/store/kmjqycgwac84hdvqda4k49ji025qgrnz-httpd.conf:
Jun 17 17:49:53 Nyak httpd[16207]: Can't locate Apache2/Log.pm in @INC

@0xABAB
Copy link
Contributor

0xABAB commented Jul 1, 2017

@vaartis You want the -I option
PerlSwitches -I/home/httpd/project2/lib (see: https://perl.apache.org/docs/2.0/user/config/config.html )

@0xABAB
Copy link
Contributor

0xABAB commented Jul 1, 2017

See #26978 for an example.

@vaartis
Copy link
Contributor Author

vaartis commented Jul 1, 2017

@0xABAB can't work on this right now, feel free to copy my working branch and finish this one..

@aanderse
Copy link
Member

Is there interest in continuing this PR from any involved parties?

@vaartis
Copy link
Contributor Author

vaartis commented May 16, 2019

I'm probably not going to finish it.

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