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

[build] Fix generating version.h #2722

Closed
wants to merge 1 commit into from
Closed

[build] Fix generating version.h #2722

wants to merge 1 commit into from

Conversation

Iglu47
Copy link

@Iglu47 Iglu47 commented Jul 13, 2022

Workaround for generating version.h inside container jobs due to the new git setting safe.directory

Just in same way as it's already fixed for other projects on repository side:
HansKristian-Work/vkd3d-proton@0c4df9b
jp7677/dxvk-nvapi@3052a78

There is a problem with artifacts.yml:
https://github.com/doitsujin/dxvk/runs/7400427307?check_suite_focus=true#step:5:86

[1/276] Generating version.h with a custom command
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:
	git config --global --add safe.directory /github/workspace

This change will return and again allow to see inside the game in DXVK_HUD (and logs) the version generated by git describe instead of fallback to the regular release tag (e.g. v1.10.1-322-g330ff8fa instead of v1.10.1).

As I understand it, the problem appeared due to git security update https://github.blog/2022-04-12-git-security-vulnerability-announced/.
The default behavior of the new safe.directory option broke https://github.com/actions/checkout and this has been fixed in recent versions of actions/checkout#762.
But it doesn't seem to affect containers yet, and the behavior of git safe.directory remains the same in them.
(Fortunately, this does not affect local builds of dxvk in any way.)

I've tested the latest versions but haven't found any other working way yet than using the workaround described here: actions/checkout#766 (comment)

Simply set the GITHUB_WORKSPACE as a safe directory.

git config --global --add safe.directory "$GITHUB_WORKSPACE"

If you are failing inside a container action, you will need to run this inside your container action script.

UPD. @Joshua-Ashton I checked. This change inside docker helps as alternative fix on container side: Iglu47/arch-mingw-github-action@cd665ba

@@ -6,6 +6,7 @@ RUN echo -e '\n\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n\n' >> /etc/pac
 RUN pacman-key --init
 RUN pacman -Sy --needed --noconfirm archlinux-keyring
 RUN pacman -Syu --needed --noconfirm clang meson glslang git mingw-w64 wine base base-devel sed git tar curl wget bash gzip sudo file gawk grep bzip2 which pacman systemd findutils diffutils coreutils procps-ng util-linux xcb-util xcb-util-keysyms xcb-util-wm lib32-xcb-util lib32-xcb-util-keysyms
+RUN git config --system --add safe.directory /github/workspace
 
 COPY entrypoint.sh /entrypoint.sh```

Workaround for generating version.h inside container jobs due to the new git setting safe.directory
@Iglu47 Iglu47 marked this pull request as ready for review July 13, 2022 18:01
@Iglu47
Copy link
Author

Iglu47 commented Jul 26, 2022

description has been updated

@Iglu47
Copy link
Author

Iglu47 commented Jul 26, 2022

@Iglu47 Iglu47 closed this Jul 26, 2022
@Iglu47 Iglu47 deleted the fix-ver-on-actions branch July 26, 2022 18:26
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

1 participant