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

[14.x] backport sysroot fix #225

Merged
merged 3 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions .azure-pipelines/azure-pipelines-win.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions .ci_support/linux_64_variantdefault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ channel_targets:
cxx_compiler:
- gxx
cxx_compiler_version:
- '10'
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libclang_soversion:
- '13'
pin_run_as_build:
zlib:
max_pin: x.x
target_platform:
- linux-64
variant:
Expand Down
5 changes: 1 addition & 4 deletions .ci_support/linux_aarch64_variantdefault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ channel_targets:
cxx_compiler:
- gxx
cxx_compiler_version:
- '10'
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libclang_soversion:
- '13'
pin_run_as_build:
zlib:
max_pin: x.x
target_platform:
- linux-aarch64
variant:
Expand Down
5 changes: 1 addition & 4 deletions .ci_support/linux_ppc64le_variantdefault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ channel_targets:
cxx_compiler:
- gxx
cxx_compiler_version:
- '10'
- '12'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
libclang_soversion:
- '13'
pin_run_as_build:
zlib:
max_pin: x.x
target_platform:
- linux-ppc64le
variant:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channel_targets:
cxx_compiler:
- clang_bootstrap
cxx_compiler_version:
- '13'
- '15'
libclang_soversion:
- '13'
macos_machine:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channel_targets:
cxx_compiler:
- clang_bootstrap
cxx_compiler_version:
- '13'
- '15'
libclang_soversion:
- '13'
macos_machine:
Expand Down
3 changes: 0 additions & 3 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ cxx_compiler:
- vs2019
libclang_soversion:
- '13'
pin_run_as_build:
zlib:
max_pin: x.x
target_platform:
- win-64
variant:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: automerge
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: automerge-action
id: automerge-action
uses: conda-forge/automerge-action@main
Expand Down
1 change: 0 additions & 1 deletion .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set version = "14.0.6" %}
{% set major_version = version.split(".")[0] %}
{% set build_number = 0 %}
{% set build_number = 1 %}

{% set minor_aware_ext = major_version %}
{% if version.split(".")[1] | int > 0 %}
Expand Down Expand Up @@ -55,7 +55,7 @@ requirements:
host:
- libcxx {{ cxx_compiler_version }} # [osx]
- llvmdev =={{ version }}
- zlib # [linux]
- zlib # [linux or win]

test:
requires:
Expand Down Expand Up @@ -99,7 +99,7 @@ outputs:
- {{ pin_subpackage("libclang-cpp", exact=True) }}
- libcxx {{ cxx_compiler_version }} # [osx]
- llvmdev =={{ version }}
- zlib # [linux]
- zlib # [linux or win]
run:
- {{ pin_subpackage("clang", exact=True) }}
- {{ pin_subpackage("clangxx", exact=True) }}
Expand Down
7 changes: 2 additions & 5 deletions recipe/patches/0001-Find-conda-gcc-installation.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From afbd83b67e456e1cd51dd0c8917b0cd3756bcab5 Mon Sep 17 00:00:00 2001
From e705a45fedcac4595772aa6f5bbb4b78bdfc17a0 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Mon, 8 Apr 2019 16:20:03 -0500
Subject: [PATCH 1/8] Find conda gcc installation
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 1/8] Find conda gcc installation
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 7a9570a686f4..358d5d576a03 100644
index 7a9570a686..358d5d576a 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2073,7 +2073,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
Expand Down Expand Up @@ -39,6 +39,3 @@ index 7a9570a686f4..358d5d576a03 100644

static const char *const RISCV32LibDirs[] = {"/lib32", "/lib"};
static const char *const RISCV32Triples[] = {"riscv32-unknown-linux-gnu",
--
2.35.3.windows.1

11 changes: 4 additions & 7 deletions recipe/patches/0002-Fix-sysroot-detection-for-linux.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 41440b8f0b300ba79ab02661941a7ddb82bc6940 Mon Sep 17 00:00:00 2001
From 1ea114bff00937f75b07be640908c467eb46eb7d Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Mon, 8 Apr 2019 16:32:17 -0500
Subject: [PATCH 2/8] Fix sysroot detection for linux
Expand All @@ -8,10 +8,10 @@ Subject: [PATCH 2/8] Fix sysroot detection for linux
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index f85c04df4f6c..0614a06956b0 100644
index 83cb41159d..56f48775d6 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -361,7 +361,7 @@ std::string Linux::computeSysRoot() const {
@@ -355,7 +355,7 @@ std::string Linux::computeSysRoot() const {
return AndroidSysRootPath;
}

Expand All @@ -20,7 +20,7 @@ index f85c04df4f6c..0614a06956b0 100644
return std::string();

// Standalone MIPS toolchains use different names for sysroot folder
@@ -379,6 +379,14 @@ std::string Linux::computeSysRoot() const {
@@ -373,6 +373,14 @@ std::string Linux::computeSysRoot() const {
if (getVFS().exists(Path))
return Path;

Expand All @@ -35,6 +35,3 @@ index f85c04df4f6c..0614a06956b0 100644
Path = (InstallDir + "/../../../../sysroot" + Multilib.osSuffix()).str();

if (getVFS().exists(Path))
--
2.35.3.windows.1

Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
From 3ef3a30e7b28d29f8e33150111d49503192f6d3e Mon Sep 17 00:00:00 2001
From 5d879a09f242e95f95b30d647597ea1e28024918 Mon Sep 17 00:00:00 2001
From: Nehal J Wani <nehaljw.kkd1@gmail.com>
Date: Sat, 25 Aug 2018 09:20:04 -0500
Subject: [PATCH 3/8] clang: add conda specific env var CONDA_BUILD_SYSROOT

---
clang/lib/Driver/Driver.cpp | 9 +++++++--
clang/lib/Driver/Driver.cpp | 5 +++++
clang/lib/Lex/InitHeaderSearch.cpp | 6 +++++-
2 files changed, 12 insertions(+), 3 deletions(-)
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 3bfddeefc7b2..6f06900ed18a 100644
index 3bfddeefc7..6078e2864c 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1208,8 +1208,13 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
@@ -1208,6 +1208,11 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
CompilerPath = Split.second;
}
}
- if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ))
- SysRoot = A->getValue();
+ if (Optional<std::string> CondaBuildSysrootValue =
+ llvm::sys::Process::GetEnv("CONDA_BUILD_SYSROOT")) {
+ SysRoot = *CondaBuildSysrootValue;
+ } else {
+ if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ))
+ SysRoot = A->getValue();
+ }
+ // Override CONDA_BUILD_SYSROOT and consume sysroot option
if (const Arg *A = Args.getLastArg(options::OPT__sysroot_EQ))
SysRoot = A->getValue();
if (const Arg *A = Args.getLastArg(options::OPT__dyld_prefix_EQ))
DyldPrefix = A->getValue();

diff --git a/clang/lib/Lex/InitHeaderSearch.cpp b/clang/lib/Lex/InitHeaderSearch.cpp
index ec7b1505c7bf..2996c41af5f0 100644
index ec7b1505c7..2996c41af5 100644
--- a/clang/lib/Lex/InitHeaderSearch.cpp
+++ b/clang/lib/Lex/InitHeaderSearch.cpp
@@ -25,6 +25,7 @@
Expand All @@ -52,6 +48,3 @@ index ec7b1505c7bf..2996c41af5f0 100644
break;
}
}
--
2.35.3.windows.1

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d7bff48e59f188aa592eda3b4e3a89ba1165039f Mon Sep 17 00:00:00 2001
From 13cbbc1615c09991610ca8305bd64f90f2bd60db Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 30 Aug 2017 20:01:49 +0100
Subject: [PATCH 4/8] Fix normalizeProgramName()'s handling of dots outside of
Expand All @@ -18,7 +18,7 @@ x86_64-apple-darwin13.4
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index d657d21bfcdb..581d59451040 100644
index d657d21bfc..581d594510 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -50,6 +50,7 @@ using namespace driver;
Expand Down Expand Up @@ -61,6 +61,3 @@ index d657d21bfcdb..581d59451040 100644
if (is_style_windows(llvm::sys::path::Style::native)) {
// Transform to lowercase for case insensitive file systems.
std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(),
--
2.35.3.windows.1

7 changes: 2 additions & 5 deletions recipe/patches/0005-Set-VERSION-in-osx-as-well.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From adbd7661047e4ce2d1a2ca1fa3cba755ec57d6cd Mon Sep 17 00:00:00 2001
From f82bccf998c5134653a33863551e699dabefc0b2 Mon Sep 17 00:00:00 2001
From: Isuru Fernando <isuruf@gmail.com>
Date: Sat, 27 Jul 2019 11:55:23 -0500
Subject: [PATCH 5/8] Set VERSION in osx as well
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH 5/8] Set VERSION in osx as well
1 file changed, 5 insertions(+)

diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index 4e0647971ab4..d5f9c43d5d14 100644
index 4e0647971a..d5f9c43d5d 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -154,6 +154,11 @@ if(ENABLE_SHARED)
Expand All @@ -23,6 +23,3 @@ index 4e0647971ab4..d5f9c43d5d14 100644
else()
set_target_properties(libclang
PROPERTIES
--
2.35.3.windows.1

Loading