Skip to content

Instantly share code, notes, and snippets.

@qknight
qknight / main.go
Last active August 1, 2022 14:51
Trying to get GORM with postgres to do relational requests
package main
import (
"fmt"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"log"
)
we want to use the environment you define below to pass in the local.py which contains the configuration for the database for django.
however, you code uses the preStart which we can't support in nixcloud-webservices in a similar way so we play with the environment variable called PYTHONPATH like shown below.
problem: our local.py configuration is never used, so we kindly ask you what we do wrong.
we also tried `manage.py`'s command line arguments as --pythonpath and --settings but we can't get them to work as python errors out because of not finding a module.
# our code
# wanting to package https://github.com/taigaio/taiga-back
pip2nix3 generate -r requirements.txt
/nix/store/363rkdz279i1ppiqha1f8vgh6a5p6xz9-python3.5-pip-9.0.1/lib/python3.5/site-packages/pip/cmdoptions.py:39: RemovedInPip10Warning: --no-use-wheel is deprecated and will be removed in the future. Please use --no-binary :all: instead.
fmt_ctl_no_use_wheel(control)
Collecting git+git://github.com/Python-Markdown/markdown.git (from -r requirements.txt (line 4))
Cloning git://github.com/Python-Markdown/markdown.git to /tmp/pip-gd8bpttj-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
# Gemfile.lock update of oj
git diff
diff --git a/Gemfile.lock b/Gemfile.lock
index 1b69af2..22b8fad 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -7,7 +7,7 @@ PATH
em-http-request (~> 0.3.0)
em-websocket (~> 0.5.1)
on ubuntu 18.04 LTS i do this:
gem install slanger
Building native extensions. This could take a while...
ERROR: Error installing slanger:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/oj-2.12.14/ext/oj
/usr/bin/ruby2.5 -r ./siteconf20180609-3115-hpt4bd.rb extconf.rb
# This Makefile is for the NetAddr::IP::Util extension to perl.
#
# It was generated automatically by MakeMaker version
# 7.1002 (Revision: 71002) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: (q[PREFIX=/nix/store/gzbb4v0qg5vdfd3gpcjkyf4prkfzrhna-perl-NetAddr-IP-4.079], q[INSTALLDIRS=site], q[PERL=/nix/store/ggb7k5x9855j10dz99467djx4rplg32b-perl-5.24.3/bin/perl], q[FULLPERL=/nix/store/ggb7k5x9855j10dz99467djx4rplg32b-perl-5.24.3/bin/perl])
#
on nixos running the build for NetAddr-IP-4.079 with tests enabled fails:
# build
t/v6-splitplan.t ...
1..28
ok 1 - use NetAddr::IP;
ok 2 - FFFF:A123:B345:C789:0:0:0:0/48 eq FFFF:A123:B345:C789:0:0:0:0/48
ok 3 - there is a plan
ok 4 - plan returns the orignal net
test_memorygrowth (test_core.default) ... ok
WARNING:root:not all asm.js optimizations are possible with SPLIT_MEMORY, disabling those. [-Walmost-asm]
WARNING:root:not all asm.js optimizations are possible with ALLOW_MEMORY_GROWTH, disabling those. [-Walmost-asm]
WARNING:root:not all asm.js optimizations are possible with ALLOW_MEMORY_GROWTH, disabling those. [-Walmost-asm]
WARNING:root:not all asm.js optimizations are possible with ALLOW_MEMORY_GROWTH, disabling those. [-Walmost-asm]
WARNING:root:not all asm.js optimizations are possible with ALLOW_MEMORY_GROWTH, disabling those. [-Walmost-asm]
INFO:root:generating system library: dlmalloc_tracing_debug.bc... (this will be cached in "/tmp/nix-build-emscripten-1.37.36.drv-0/.emscripten_cache/asmjs/dlmalloc_tracing_debug.bc" for subsequent builds)
test_memorygrowth_2 (test_core.asm1) ... ok
test_memorygrowth (test_core.asm3) ... ok
INFO:root: - ok
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/Sirupsen/logrus"
packages = ["."]
revision = "d682213848ed68c0a260ca37d6dd5ace8423f5ba"
version = "v1.0.4"
[[projects]]
nixpkgs.overlays = lib.singleton (self: super: {
systemd = super.systemd.overrideAttrs (drv: rec {
src = /root/systemd;
patches = [];
autoreconfPhase = ''
touch autogen.sh
chmod u+x autogen.sh
ls -lathr
sed -i -e 's|/bin/bash|${pkgs.bash}/bin/bash|g' configure
sed -i -e 's|meson.*||g' configure