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

gurk-rs: Fix sed in-place editing error. #175

Closed
wants to merge 1 commit into from

Conversation

falsifian
Copy link

Without this change, make (specifically, make FETCH_PACKAGES=-Dsnap MAKE_JOBS=3 PORTSDIR_PATH=/usr/ports:/usr/ports/openbsd-wip) fails with:

[modcargo] Generating metadata for zvariant_derive-3.15.2
[modcargo] Generating metadata for zvariant_utils-1.0.1
===>  Generating configure for gurk-rs-0.4.3
===>  Configuring for gurk-rs-0.4.3
sed -i '/opt-level/s,2,0,' /home/pobj/gurk-rs-0.4.3/.cargo/config
sed: /home/pobj/gurk-rs-0.4.3/.cargo/config: in-place editing only works for regular files
*** Error 1 in . (Makefile:35 'post-configure')
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:3044 '/home/pobj/gurk-rs-0.4.3/.co
nfigure_done': @cd /usr/ports/openbsd-wip/net/g...)
*** Error 2 in /usr/ports/openbsd-wip/net/gurk-rs (/usr/ports/infrastructure/mk/bsd.port.mk:2
704 'all': @lock=gurk-rs-0.4.3;  export _LOCKS_...)
exit: 2 angel gurk-rs $ grep -R opt-level
Makefile:       sed -i '/opt-level/s,2,0,' ${WRKDIR}/.cargo/config

Not sure why it works for other(s) but not me. My ports tree is at commit fd2b2c6a on the git mirror.

@c0dev0id

@c0dev0id
Copy link
Collaborator

This is odd. I have the same PORTSDIR_PATH configuration.

Does this work?

cd ${WRKDIR}/.cargo && sed -i '/opt-level/s,2,0,' config

@falsifian
Copy link
Author

No. sed is complaining because the file is a symlink:

$ ls -l /home/pobj/gurk-rs-0.4.3/.cargo/config
lrwxr-xr-x  1 _pbuild  _pbuild  43 May 19 15:22 /home/pobj/gurk-rs-0.4.3/.cargo/config -> /home/pobj/gurk-rs-0.4.3/.cargo/config.toml

Specifically, with this change against commit 97bc5fe:

--- net/gurk-rs/Makefile
+++ net/gurk-rs/Makefile
@@ -32,7 +32,8 @@ SUBST_VARS =  LOCALBASE
 #              < ${FILESDIR}/notification.rs.patch
 
 post-configure:
-       sed -i '/opt-level/s,2,0,' ${WRKDIR}/.cargo/config
+       #sed -i '/opt-level/s,2,0,' ${WRKDIR}/.cargo/config
+       cd ${WRKDIR}/.cargo && sed -i '/opt-level/s,2,0,' config
        cat ${FILESDIR}/config >> ${WRKDIR}/.cargo/config
 
 do-install:

running make FETCH_PACKAGES=-Dsnap MAKE_JOBS=3 PORTSDIR_PATH=/usr/ports:/usr/ports/openbsd-wip clean and then make FETCH_PACKAGES=-Dsnap MAKE_JOBS=3 PORTSDIR_PATH=/usr/ports:/usr/ports/openbsd-wip, the output ends with this:

===>  Generating configure for gurk-rs-0.4.3
===>  Configuring for gurk-rs-0.4.3
#sed -i '/opt-level/s,2,0,' /home/pobj/gurk-rs-0.4.3/.cargo/config
cd /home/pobj/gurk-rs-0.4.3/.cargo && sed -i '/opt-level/s,2,0,' config
sed: config: in-place editing only works for regular files
*** Error 1 in . (Makefile:36 'post-configure')
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:3044 '/home/pobj/gurk-rs-0.4.3/.configure_done': @cd /usr/ports/openbsd-wip/net/g...)
*** Error 2 in /usr/ports/openbsd-wip/net/gurk-rs (/usr/ports/infrastructure/mk/bsd.port.mk:2704 'all': @lock=gurk-rs-0.4.3;  export _LOCKS_...)

@c0dev0id
Copy link
Collaborator

I fixed it by applying sed to config.toml, which is the target of the symlink.

(I know gurk-rs 5.0 is out, but libsqlite3-sys is not building.)

@c0dev0id c0dev0id closed this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants