Skip to content

google-app-engine-go-sdk: fix error on macOS #26276

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

Merged
merged 2 commits into from
May 31, 2017
Merged

google-app-engine-go-sdk: fix error on macOS #26276

merged 2 commits into from
May 31, 2017

Conversation

lufia
Copy link
Contributor

@lufia lufia commented May 31, 2017

Motivation for this change

on macOS, execve(2) can't use executable text at shebang.
Python wrapper (perhaps rewritten with python27.withPackages) is referenced to a bash script.
Therefore all python code of goapp are evaluated as bash script.

see also #25856 (comment)

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.

Sorry, something went wrong.

@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label May 31, 2017
@@ -1,7 +1,9 @@
{ stdenv, fetchzip, python27, python27Packages }:
{ stdenv, fetchzip, python27, python27Packages, makeWrapper }:

assert stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin";
Copy link
Member

Choose a reason for hiding this comment

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

this assert probably shouldn't be here


installPhase = ''
mkdir -p $out/bin $out/share/
cp -r "$src" "$out/share/go_appengine"

# create wrappers with correct env
for i in goapp appcfg.py; do
ln -s "$out/share/go_appengine/$i" "$out/bin/$i"
makeWrapper "$out/share/go_appengine/$i" "$out/bin/$i" \
Copy link
Member

Choose a reason for hiding this comment

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

Have you read the python section in the manual? buildPythonApplication might be useful here.

Copy link
Member

Choose a reason for hiding this comment

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

Is not helpful here.

@Mic92 Mic92 merged commit 5604dbe into NixOS:master May 31, 2017
@lufia lufia deleted the fix-appengine-go-darwin branch June 4, 2017 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants