forked from google/xls
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUILD:env] Changes that seem to get Ubuntu 22.04 working.
* sysconfig module is no longer in distutils in Python 3.10 -- it was introduced in Python 3.2 so we can use it for all our platforms of interest. * Allow a version of scipy that supports Python 3.10 PiperOrigin-RevId: 452125866
- Loading branch information
1 parent
f9185fb
commit dec3462
Showing
6 changed files
with
111 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions | ||
# See also: https://github.com/marketplace/actions/bazel-action | ||
|
||
name: Nightly Ubuntu 22.04 | ||
on: | ||
schedule: | ||
# Nightly at midnight -- uses UTC, so 7am. | ||
- cron: '0 7 * * *' | ||
# This lets us trigger manually from the UI. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Nightly Ubuntu 22.04 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: "~/.cache/bazel" | ||
# Create/use a cache called bazel-cache-22_04-<commit hash> | ||
# and read the latest cache with prefix bazel-cache-22_04- | ||
# if it doesn't already exist. | ||
key: bazel-cache-22_04-${{ github.sha }} | ||
restore-keys: bazel-cache-22_04- | ||
- name: Install bazelisk | ||
run: | | ||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64" | ||
mkdir -p "${GITHUB_WORKSPACE}/bin/" | ||
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" | ||
chmod +x "${GITHUB_WORKSPACE}/bin/bazel" | ||
# Note: xlscc is excluded because it builds Clang, and that can make | ||
# builds time out. | ||
- name: Bazel Test All (opt) | ||
run: | | ||
"${GITHUB_WORKSPACE}/bin/bazel" test -c opt -- //xls/... -//xls/contrib/xlscc/... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2022 The XLS Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Needed to make this a package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git python_configure.bzl python_configure.bzl | ||
index 1f5bffa..4225255 100644 | ||
--- python_configure.bzl | ||
+++ python_configure.bzl | ||
@@ -252,8 +252,8 @@ def _get_python_include(repository_ctx, python_bin): | ||
python_bin, | ||
"-c", | ||
"from __future__ import print_function;" + | ||
- "from distutils import sysconfig;" + | ||
- "print(sysconfig.get_python_inc())", | ||
+ "import sysconfig; import os; " + | ||
+ "print(os.path.dirname(sysconfig.get_config_h_filename()))", | ||
], | ||
error_msg = "Problem getting python include path.", | ||
error_details = ("Is the Python binary path set up right? " + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# NOTE: We try to support Ubuntu 22.04 environment as it is the latest Ubuntu | ||
LTS release. | ||
|
||
# Download base image ubuntu 22.04 | ||
FROM ubuntu:22.04 | ||
|
||
# LABEL about the custom image | ||
LABEL version="0.1" | ||
LABEL description="Docker Image for Building/Testing XLS on Ubuntu 22.04 x86-64" | ||
|
||
# Update package info | ||
RUN apt-get update -y | ||
|
||
# Install Bazel | ||
RUN apt-get install -y curl gnupg && \ | ||
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg && \ | ||
mv bazel.gpg /etc/apt/trusted.gpg.d/ && \ | ||
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \ | ||
apt-get update -y && apt-get install -y bazel | ||
|
||
# Install dependencies | ||
RUN apt-get -y install python3-distutils python3-dev python-is-python3 libtinfo5 build-essential liblapack-dev libblas-dev gfortran | ||
|
||
# Install development tools | ||
RUN apt-get install -y git vim | ||
|
||
RUN useradd -m xls-developer | ||
USER xls-developer | ||
|
||
# Map the project contents in. | ||
ADD --chown=xls-developer . /home/xls-developer/xls/ | ||
WORKDIR /home/xls-developer/xls/ | ||
|
||
|
||
# Test everything (opt), exclude xlscc for now due to increased build time when | ||
# we add Clang. | ||
RUN bazel test -c opt -- //xls/... -//xls/contrib/xlscc/... |