[lxc-devel] [lxc/master] Fix environment before importing setuptools
stgraber on Github
lxc-bot at linuxcontainers.org
Tue Oct 25 23:09:11 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161025/bb40af32/attachment.bin>
-------------- next part --------------
From c223a53622d25f8753aa4c48313441dce512ec40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 25 Oct 2016 19:08:34 -0400
Subject: [PATCH] Fix environment before importing setuptools
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
src/python-lxc/setup.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/python-lxc/setup.py b/src/python-lxc/setup.py
index 39e16c4..bf0d74a 100644
--- a/src/python-lxc/setup.py
+++ b/src/python-lxc/setup.py
@@ -25,10 +25,7 @@
import os
import subprocess
-from setuptools import setup, Extension
-from setuptools.command.build_ext import build_ext as BuildExtCommand
-
-# Fix build when PIE is enabled
+# Fix build when PIE is enabled (must run before setuptools import)
for var in ("LDFLAGS", "CFLAGS"):
current = os.environ.get(var, None)
if not current:
@@ -44,6 +41,9 @@
os.environ[var] = " ".join(new)
+from setuptools import setup, Extension
+from setuptools.command.build_ext import build_ext as BuildExtCommand
+
class LxcBuildExtCommand(BuildExtCommand):
user_options = BuildExtCommand.user_options + [
More information about the lxc-devel
mailing list