go-rpm-integration and symlinks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm attempting to package github.com/rjeczalik/notify[1] as an RPM. This package includes a utility function[2] that determines whether a path is a symlink, and resolves it to an absolute path. This function clearly has merit, as the package is an abstraction wrapper around inotify. There are tests around this function that set up symlinks and test whether or not the function correctly resolves the symlink redirections. These test functions fail when I build the package[3]. It turns out the abstractions created by %goprep that set up the _build/src directory hierarchy (including the final symlink in the tree) are tripping up the tests that are attempting to resolve symlinks. I replaced the symlink at _build/src/github.com/rjeczalik/notify with a properly unpacked source directory and ran go-rpm-integration check by hand, and the tests pass. If _build/src/github.com/rjeczalik/notify is a symlink, however, the tests are failing.

Is there a proper way to manipulate the %goprep macro or tell it to not create symlinks? Or, what's the appropriate Fedora RPM go macro way of handling cases like this?

1: https://github.com/rjeczalik/notify
2: https://github.com/rjeczalik/notify/blob/135d4685afb9d0fb32e23a065b95cd797cb8a4ee/util.go#L67-L99
3:
+ go-rpm-integration check -i github.com/rjeczalik/notify -b /builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/bin -s /builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build -V 0.9.2-1.20210611gite2a77dc.fc35 -C e2a77dcc14cf6732bfa4c361554f27dc696d5d79 -p /builddir/build/BUILDROOT/golang-github-rjeczalik-notify-0.9.2-1.20210611gite2a77dc.fc35.x86_64 -g /usr/share/gocode -r '.*example.*'
Testing    in: /builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src
         PATH: /builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/bin:/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags " -X github.com/rjeczalik/notify/version.commit=e2a77dcc14cf6732bfa4c361554f27dc696d5d79 -X github.com/rjeczalik/notify/version=0.9.2 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld  '"
      testing: github.com/rjeczalik/notify
github.com/rjeczalik/notify
--- FAIL: TestCanonicalNoSymlink (0.00s)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79" (i=0)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify/testdata"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/testdata" (i=1)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79" (i=2)
--- FAIL: TestCanonical (0.01s)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79" (i=0)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify/testdata"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/testdata" (i=1)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify/notify.go"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/notify.go" (i=2)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify/testdata/vfs.txt"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/testdata/vfs.txt" (i=3)
    util_test.go:25: want full="/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify/testdata/vfs.txt"; got "/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/testdata/vfs.txt" (i=4)
--- FAIL: TestCanonical_RelativeSymlink (0.00s)
    util_unix_test.go:125: want canonical()=/builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/_build/src/github.com/rjeczalik/notify/005632054/a/b/x/y/z/d/e/f; got /builddir/build/BUILD/notify-e2a77dcc14cf6732bfa4c361554f27dc696d5d79/005632054/a/b/x/y/z/d/e/f
FAIL
exit status 1
FAIL    github.com/rjeczalik/notify     17.491s
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux