Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c66f19c
Add initial script for creating MLTBX file
sgilmore10 Nov 8, 2023
18a0d78
Add basic `matlab` packging task to crossbow `tasks.yml` file.
kevingurney Nov 8, 2023
647f200
Configure ToolboxOptions for packaging
sgilmore10 Nov 8, 2023
89b79c5
Add MATLAB packaging crossbow GitHub Actions workflow.
kevingurney Nov 8, 2023
1d97302
Add MATLAB packaging workflow to workflows folder.
kevingurney Nov 8, 2023
249f0de
Remove Jinja2 macros.
kevingurney Nov 8, 2023
bf43c2f
Test
kevingurney Nov 8, 2023
6783d5a
Update workflow trigers.
kevingurney Nov 8, 2023
4ad761d
Update indentation.
kevingurney Nov 8, 2023
fffeebb
Add debug output
kevingurney Nov 9, 2023
2e0ffb8
Add post-release script to upload MATLAB interface MLTBX file to GitHub
kevingurney Nov 9, 2023
f081f38
Move MATLAB packging workflow to dev/tasks.
kevingurney Nov 9, 2023
9006511
Updated environment variables and added macros to MATLAB packging
kevingurney Nov 9, 2023
d23f6f2
Hard code version number.
kevingurney Nov 9, 2023
1f605fc
Remove workflow triggers.
kevingurney Nov 9, 2023
1f029c8
Remove WIP branch name check.
kevingurney Nov 9, 2023
eb37e37
Escape curly braces
kevingurney Nov 9, 2023
a8f5599
Escape curly braces
kevingurney Nov 9, 2023
75c3aee
Add artifacts for MATLAB packaging task.
kevingurney Nov 9, 2023
84ad395
Remove debug print statements.
kevingurney Nov 9, 2023
54f7715
Remove temp task file.
kevingurney Nov 9, 2023
e7e7337
Use literal curly brace characters.
kevingurney Nov 9, 2023
698385f
Fix typo
kevingurney Nov 9, 2023
02253b7
Modify indentation
kevingurney Nov 9, 2023
45db063
Remove ccache steps.
kevingurney Nov 9, 2023
481bc0c
Fix path to ci/scripts.
kevingurney Nov 9, 2023
1eb348a
Update MLTBX filename to include version.
kevingurney Nov 9, 2023
6f8246d
Use checkout macro.
kevingurney Nov 9, 2023
b100c5f
Fix path to Arrow source code.
kevingurney Nov 9, 2023
4f7365f
Fix paths to compress tarball files.
kevingurney Nov 9, 2023
2cff4db
Re-enable ccache.
kevingurney Nov 9, 2023
3559874
1. Add missing license header to packageMatlabInterface.
kevingurney Nov 9, 2023
fa6d1b2
Create output folder in packageMatlabInterface.
kevingurney Nov 9, 2023
3887846
Fix output MLTBX file name in packageMatlabInterface
sgilmore10 Nov 10, 2023
fd5743a
Use sccache instead of ccache
sgilmore10 Nov 10, 2023
2c7f85b
Add debug print statements to packageMatlabInterface
sgilmore10 Nov 10, 2023
0ef30fd
Update MLTBX output folder
sgilmore10 Nov 10, 2023
dc256ea
1. Call sudo apt-get update
sgilmore10 Nov 10, 2023
d19db71
Include sudo in apt-get update call
sgilmore10 Nov 10, 2023
0137b0b
Add debug print statements to packageMatlabInterfae
sgilmore10 Nov 10, 2023
0d46d16
Don't set ToolboxMatlabPath post construction
sgilmore10 Nov 10, 2023
079505c
Work on symbolic link issue
sgilmore10 Nov 13, 2023
2d04191
Fix packaging script to include missing shared library files
sgilmore10 Nov 13, 2023
d754fb4
Fix shared object wildcard pattern
sgilmore10 Nov 13, 2023
9d948b8
Update shared library install name
sgilmore10 Nov 14, 2023
98a655d
Update file path
sgilmore10 Nov 14, 2023
47dd3ab
Dynamically create library names
sgilmore10 Nov 14, 2023
c9a77e8
Use regexp to find the versioned libarrow symlink and the regular
sgilmore10 Nov 15, 2023
931f54e
Update needed shared library name in libarrowproxy.so
sgilmore10 Nov 15, 2023
706f7b5
Add missing filename to patchelf command
sgilmore10 Nov 15, 2023
d254e81
Change runs-on to ubuntu-20.04 from ubuntu-latest
sgilmore10 Nov 15, 2023
609bafb
Add ls command to find libstdc++
sgilmore10 Nov 15, 2023
d7f369d
Fix syntax error
sgilmore10 Nov 15, 2023
bb1de7b
Add debug print statements
sgilmore10 Nov 15, 2023
ee96e8c
Delete commented out code
sgilmore10 Nov 15, 2023
8291eee
Delete debug print statements in github workflow file
sgilmore10 Nov 15, 2023
83f1b0e
Set ubuntu-20.04 as the runner instead of ubuntu-latest
sgilmore10 Nov 15, 2023
9dc8940
Specify the MaximumMatlabRelease to R2023a
sgilmore10 Nov 15, 2023
6d057b3
Don't set LD_PRELOAD prior to starting up MATLAB
sgilmore10 Nov 15, 2023
64a13f6
Delete post-16-matlab.sh. This script will be added in a separate PR.
sgilmore10 Nov 15, 2023
e0f6339
Change MLTBX identifer to a UUID
sgilmore10 Nov 16, 2023
e08319c
1. Update MLTBX Toolbox Name to MATLAB Arrow Interface
sgilmore10 Nov 16, 2023
5d61b57
Update step names in dev/tasks/matlab/github.yml file
sgilmore10 Nov 16, 2023
834fd94
Simplify expressions setting SYMLINK_ARROW_LIB and REGULAR_ARROR_LIB …
sgilmore10 Nov 17, 2023
dfd1de3
Set Toolbox AuthorName to 'Apache Arrow' and AuthorEmail to 'dev@arro…
sgilmore10 Nov 17, 2023
45dafd1
Add comment explaining the intall_name_tool and patchelf commands
sgilmore10 Nov 17, 2023
ac1c36f
Add step to copy LICENSE.txt to toolbox root folder
sgilmore10 Nov 17, 2023
ce52a23
Fix comments in dev/tasks/matlab/github.yml file
sgilmore10 Nov 17, 2023
a9cfe64
Remove Download Timezone Database step from workflow
sgilmore10 Nov 17, 2023
385a524
Add pointer to mathworks/libmexclass to LICENSE.txt.
kevingurney Mar 13, 2024
f309dd0
Add note about software from The MathWorks, Inc. being included in th…
kevingurney Mar 13, 2024
7d3b429
Include LICENSE.txt and NOTICE.txt in the MLTBX file
sgilmore10 Mar 13, 2024
bb0ef54
Add comment to matlab.yml CI workflow explaining why it is useful to …
kevingurney Mar 13, 2024
9d67a24
Set the MLTBX's AuthorName to The Apache Software Foundation
sgilmore10 Mar 14, 2024
2c99406
Use latest version (v4) of actions/upload-artifacts
sgilmore10 Mar 14, 2024
9d5d01b
Update macOS job name to AMD64 macOS 12 MATLAB
sgilmore10 Mar 14, 2024
4aae606
Dynamically append required text to LICENSE.txt and NOTICE.txt when
sgilmore10 Mar 14, 2024
43d8278
Use version v4 for actions/download-artifact
sgilmore10 Mar 14, 2024
d3026b6
Remove unnecessary install step that copies libarrow.* to fsroot/+arrow
sgilmore10 Mar 29, 2024
4c4511b
Delete unnecessary comments in CMakeLists.txt
sgilmore10 Mar 29, 2024
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
28 changes: 18 additions & 10 deletions .github/workflows/matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,23 @@ jobs:

ubuntu:
name: AMD64 Ubuntu 20.04 MATLAB
runs-on: ubuntu-latest
# Explicitly pin the Ubuntu version to 20.04 for the time being because:
#
# 1. The version of GLIBCXX shipped with Ubuntu 22.04 is not binary compatible
# with the GLIBCXX bundled with MATLAB R2023a. This is a relatively common
# issue.
#
# For example, see:
#
# https://www.mathworks.com/matlabcentral/answers/1907290-how-to-manually-select-the-libstdc-library-to-use-to-resolve-a-version-glibcxx_-not-found
#
# 2. The version of GLIBCXX shipped with Ubuntu 22.04 is not binary compatible with
# the version of GLIBCXX shipped with Debian 11. Several of the Arrow community
# members who work on the MATLAB bindings use Debian 11 locally for qualification.
# Using Ubuntu 20.04 eases development workflows for these community members.
#
# In the future, we can investigate adding support for building against more Linux (e.g. `ubuntu-22.04`) and MATLAB versions (e.g. R2023b).
runs-on: ubuntu-20.04
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
steps:
- name: Check out repository
Expand Down Expand Up @@ -74,22 +90,14 @@ jobs:
run: ci/scripts/matlab_build.sh $(pwd)
- name: Run MATLAB Tests
env:
# libarrow.so requires a more recent version of libstdc++.so
# than is bundled with MATLAB under <matlabroot>/sys/os/glnxa64.
# Therefore, if a MEX function that depends on libarrow.so
# is executed within the MATLAB address space, runtime linking
# errors will occur. To work around this issue, we can explicitly
# force MATLAB to use the system libstdc++.so via LD_PRELOAD.
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libstdc++.so.6

# Add the installation directory to the MATLAB Search Path by
# setting the MATLABPATH environment variable.
MATLABPATH: matlab/install/arrow_matlab
uses: matlab-actions/run-tests@v1
with:
select-by-folder: matlab/test
macos:
name: AMD64 macOS 11 MATLAB
name: AMD64 macOS 12 MATLAB
runs-on: macos-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
steps:
Expand Down
162 changes: 162 additions & 0 deletions dev/tasks/matlab/github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

{% import 'macros.jinja' as macros with context %}

{{ macros.github_header() }}

jobs:

ubuntu:
name: AMD64 Ubuntu 20.04 MATLAB
runs-on: ubuntu-20.04
steps:
{{ macros.github_checkout_arrow()|indent }}
- name: Install ninja-build
run: sudo apt-get update && sudo apt-get install ninja-build
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2023a
- name: Build MATLAB Interface
env:
{{ macros.github_set_sccache_envvars()|indent(8) }}
run: arrow/ci/scripts/matlab_build.sh $(pwd)/arrow
- name: Change shared library dependency name
# MATLAB's programmatic packaging interface does not properly
# include symbolic link files in the package MLTBX - this is a
# bug. As a temporary workaround, change the expected name of the
# Arrow C++ library which libarrowproxy.so depends on. For example,
# change libarrow.so.1500 to libarrow.so.1500.0.0.
run: |
pushd arrow/matlab/install/arrow_matlab/+libmexclass/+proxy/
SYMLINK_ARROW_LIB="$(find . -name 'libarrow.so.*' -type l | xargs basename)"
REGULAR_ARROW_LIB="$(echo libarrow.so.*.*)"
echo "SYMLINK_ARROW_LIB = ${SYMLINK_ARROW_LIB}"
echo "REGULAR_ARROW_LIB = ${REGULAR_ARROW_LIB}"
patchelf --replace-needed $SYMLINK_ARROW_LIB $REGULAR_ARROW_LIB libarrowproxy.so
popd
- name: Compress into single artifact
run: tar -cvzf matlab-arrow-ubuntu.tar.gz arrow/matlab/install/arrow_matlab
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: matlab-arrow-ubuntu.tar.gz
path: matlab-arrow-ubuntu.tar.gz

macos:
name: AMD64 macOS 12 MATLAB
runs-on: macos-latest
steps:
{{ macros.github_checkout_arrow()|indent }}
- name: Install ninja-build
run: brew install ninja
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2023a
- name: Build MATLAB Interface
env:
{{ macros.github_set_sccache_envvars()|indent(8) }}
run: arrow/ci/scripts/matlab_build.sh $(pwd)/arrow
- name: Change shared library dependency name
# MATLAB's programmatic packaging interface does not properly
# include symbolic link files in the package MLTBX - this is a
# bug. As a temporary workaround, change the expected name of the
# Arrow C++ library which libarrowproxy.dylib depends on.
# For example, change libarrow.1500.dylib to libarrow.1500.0.0.dylib.
run: |
pushd arrow/matlab/install/arrow_matlab/+libmexclass/+proxy
SYMLINK_ARROW_LIB="$(find . -name 'libarrow.*.dylib' -type l | xargs basename)"
REGULAR_ARROW_LIB="$(echo libarrow.*.*.dylib)"
echo "SYMLINK_ARROW_LIB = ${SYMLINK_ARROW_LIB}"
echo "REGULAR_ARROW_LIB = ${REGULAR_ARROW_LIB}"
install_name_tool -change @rpath/$SYMLINK_ARROW_LIB @rpath/$REGULAR_ARROW_LIB libarrowproxy.dylib
popd
- name: Compress into single artifact
run: tar -cvzf matlab-arrow-macos.tar.gz arrow/matlab/install/arrow_matlab
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: matlab-arrow-macos.tar.gz
path: matlab-arrow-macos.tar.gz

windows:
name: AMD64 Windows 2022 MATLAB
runs-on: windows-2022
steps:
{{ macros.github_checkout_arrow()|indent }}
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2023a
- name: Install sccache
shell: bash
run: arrow/ci/scripts/install_sccache.sh pc-windows-msvc $(pwd)/sccache
- name: Build MATLAB Interface
shell: cmd
env:
{{ macros.github_set_sccache_envvars()|indent(8) }}
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
bash -c "arrow/ci/scripts/matlab_build.sh $(pwd)/arrow"
- name: Compress into single artifact
shell: bash
run: tar -cvzf matlab-arrow-windows.tar.gz arrow/matlab/install/arrow_matlab
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: matlab-arrow-windows.tar.gz
path: matlab-arrow-windows.tar.gz

package-mltbx:
name: Package MATLAB Toolbox (MLTBX) Files
runs-on: ubuntu-latest
needs:
- ubuntu
- macos
- windows
steps:
{{ macros.github_checkout_arrow(fetch_depth=0)|indent }}
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts-downloaded
- name: Decompress Artifacts
run: |
mv artifacts-downloaded/*/*.tar.gz .
tar -xzvf matlab-arrow-ubuntu.tar.gz
tar -xzvf matlab-arrow-macos.tar.gz
tar -xzvf matlab-arrow-windows.tar.gz
- name: Copy LICENSE.txt and NOTICE.txt for packaging
run: |
cp arrow/LICENSE.txt arrow/matlab/install/arrow_matlab/LICENSE.txt
cp arrow/NOTICE.txt arrow/matlab/install/arrow_matlab/NOTICE.txt
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2023a
- name: Run commands
env:
MATLABPATH: arrow/matlab/tools
ARROW_MATLAB_TOOLBOX_FOLDER: arrow/matlab/install/arrow_matlab
ARROW_MATLAB_TOOLBOX_OUTPUT_FOLDER: artifacts/matlab-dist
ARROW_MATLAB_TOOLBOX_VERSION: {{ arrow.no_rc_version }}
uses: matlab-actions/run-command@v1
with:
command: packageMatlabInterface
{{ macros.github_upload_releases(["artifacts/matlab-dist/*.mltbx"])|indent }}
9 changes: 9 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ groups:
- conan-*
- debian-*
- java-jars
- matlab
- nuget
- python-sdist
- r-binary-packages
Expand Down Expand Up @@ -769,6 +770,14 @@ tasks:
params:
formula: apache-arrow.rb

############################## MATLAB Packages ################################

matlab:
ci: github
template: matlab/github.yml
artifacts:
- matlab-arrow-{no_rc_version}.mltbx

############################## Arrow JAR's ##################################

java-jars:
Expand Down
17 changes: 0 additions & 17 deletions matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ get_filename_component(ARROW_SHARED_LIB_DIR ${ARROW_SHARED_LIB} DIRECTORY)
get_filename_component(ARROW_SHARED_LIB_FILENAME ${ARROW_SHARED_LIB} NAME_WE)

if(NOT Arrow_FOUND)
# If Arrow_FOUND is false, Arrow is built by the arrow_shared target and needs
# to be copied to CMAKE_PACKAGED_INSTALL_DIR.

if(APPLE)
# Install libarrow.dylib (symlink) and the real files it points to.
# on macOS, we need to match these files: libarrow.dylib
Expand All @@ -226,20 +223,6 @@ if(NOT Arrow_FOUND)
set(SHARED_LIBRARY_VERSION_REGEX
${ARROW_SHARED_LIB_FILENAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()

# The subfolders cmake and pkgconfig are excluded as they will be empty.
# Note: The following CMake Issue suggests enabling an option to exclude all
# folders that would be empty after installation:
# https://gitlab.kitware.com/cmake/cmake/-/issues/17122

set(CMAKE_PACKAGED_INSTALL_DIR "${CMAKE_INSTALL_DIR}/+arrow")

install(DIRECTORY "${ARROW_SHARED_LIB_DIR}/"
DESTINATION ${CMAKE_PACKAGED_INSTALL_DIR}
FILES_MATCHING
REGEX ${SHARED_LIBRARY_VERSION_REGEX}
PATTERN "cmake" EXCLUDE
PATTERN "pkgconfig" EXCLUDE)
endif()

# MATLAB_ADD_INSTALL_DIR_TO_STARTUP_FILE toggles whether an addpath command to add the install
Expand Down
84 changes: 84 additions & 0 deletions matlab/tools/packageMatlabInterface.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
% Licensed to the Apache Software Foundation (ASF) under one
% or more contributor license agreements. See the NOTICE file
% distributed with this work for additional information
% regarding copyright ownership. The ASF licenses this file
% to you 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.

toolboxFolder = string(getenv("ARROW_MATLAB_TOOLBOX_FOLDER"));
outputFolder = string(getenv("ARROW_MATLAB_TOOLBOX_OUTPUT_FOLDER"));
toolboxVersionRaw = string(getenv("ARROW_MATLAB_TOOLBOX_VERSION"));

appendLicenseText(fullfile(toolboxFolder, "LICENSE.txt"));
appendNoticeText(fullfile(toolboxFolder, "NOTICE.txt"));

% Output folder must exist.
mkdir(outputFolder);

disp("Toolbox Folder: " + toolboxFolder);
disp("Output Folder: " + outputFolder);
disp("Toolbox Version Raw: " + toolboxVersionRaw);


% Note: This string processing heuristic may not be robust to future
% changes in the Arrow versioning scheme.
dotIdx = strfind(toolboxVersionRaw, ".");
numDots = numel(dotIdx);
if numDots >= 3
toolboxVersion = extractBefore(toolboxVersionRaw, dotIdx(3));
else
toolboxVersion = toolboxVersionRaw;
end

disp("Toolbox Version:" + toolboxVersion);

identifier = "ad1d0fe6-22d1-4969-9e6f-0ab5d0f12ce3";
opts = matlab.addons.toolbox.ToolboxOptions(toolboxFolder, identifier);
Copy link
Member

Choose a reason for hiding this comment

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

Can we set Apache Arrow as AuthorName and dev@arrow.apache.org as AuthorEmail?

Can we set license information too?
It seems that License doesn't exist...:
https://jp.mathworks.com/help/matlab/ref/matlab.addons.toolbox.toolboxoptions.html

Copy link
Member

Choose a reason for hiding this comment

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

Hi @kou,

I'll update the script to set AuthorName to Apache Arrow and AuthorEmail to dev@arrow.apache.org.

Regarding including the license, the following repository lists best practices for MATLAB Toolboxes: mathworks/toolboxdesign. The recommendation is to put a License.txt file in the root directory of the toolbox. Should we include the top-level LICENSE.txt and NOTICE.txt files within the MLTBX file? We looked at the Python wheel(s) files for reference, and they seem to package both files.

Best,
Sarah

Copy link
Member

@kou kou Nov 17, 2023

Choose a reason for hiding this comment

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

Yes. We must add LICENSE.txt and NOTICE.txt into the MLTBX file.

See also:

Copy link
Member

Choose a reason for hiding this comment

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

Hi @kou,

Thanks for linking all of this information to us! We'll read through these documents and respond on the PR as soon as we can.

Best,
Sarah

Copy link
Member

@sgilmore10 sgilmore10 Nov 22, 2023

Choose a reason for hiding this comment

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

Hi @kou,

Just wanted to provide a quick status update on this. We've been working on trying to understand what we need to include in LICENSE.txt/NOTICE.txt from a MEX perspective. We know we need to include a pointer about libmexclass, but we're still evaluating if there is more we should be including relating to MEX build artifacts.

Note, we are approaching the holiday season in the US, so there may be a bit of a delay in moving this PR forward. Apologies for any inconvenience this delay causes. Thanks for helping us with this PR!

Copy link
Member

@sgilmore10 sgilmore10 Jan 16, 2024

Choose a reason for hiding this comment

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

Hi Everyone,

Thanks very much for patiently waiting on us to move this forward.

We realized that we need to ensure that the licenses of any MEX artifacts bundled with the released MLTBX file are compatible with the ASF 3rd Party License Policy.

After several rounds of discussion with some colleagues at MathWorks (unfortunately delayed due to the holiday season in the US), we came up with a license (attached to this comment) that we hope will allow us to ensure that we are abiding by the ASF's 3rd Party License Policy.

The attached license is a modified version of the standard MathWorks license that applies to MEX files. The intent of these modifications is to meet the requirements for inclusion as a "Category B" license according to the ASF 3rd Party License Policy.

Our goal is to make sure we are doing the right thing here, and we understand this may need further input from ASF Legal and the rest of the community. Please let us know what we can do to help move this forward. We sincerely appreciate everyone's support as we navigate these licensing requirements.

Link to proposed license: license.txt

Best,

Sarah and Kevin

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for sharing this!

Let's discuss this on dev@arrow.apache.org to get more attention. We should think about license carefully.

Copy link
Member

@sgilmore10 sgilmore10 Jan 17, 2024

Choose a reason for hiding this comment

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

I agree! I'll start a discussion on the mailing list. Thanks for the suggestion!

Copy link
Member

Choose a reason for hiding this comment

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

Just an fyi, we now have a path forward. We've determined that we can license MEX binaries and all contents included within the MLTBX file under the Apache V2 license. Here's a link to the mailing list discussion.

Now that we are unblocked, Kevin and I will start working on this pull request again. It took some time for us to work through the details with our colleagues at MathWorks and we appreciate everyone's patience.

Copy link
Member Author

@kevingurney kevingurney Mar 13, 2024

Choose a reason for hiding this comment

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

After reviewing the relevant sections from https://www.apache.org/legal/release-policy.html and https://infra.apache.org/licensing-howto.html, we updated the LICENSE.txt and NOTICE.txt files as detailed below:

  1. Added a "pointer" to mathworks/libmexclass at the bottom of LICENSE.txt.
  2. Added a note about the fact that the project includes software from The MathWorks, Inc. (i.e. all of the contents of the distributed MLTBX files, other than mathworks/libmexclass and libarrow) which MathWorks is granting the Apache Software Foundation the right to distribute under the standard Apache Version 2.0 license.

We believe these updates should be sufficient to address the bundling of the mathworks/libmexclass binaries and all other contents in the distributed MLTBX files. However, please let us know if there is anything else we should be including in the LICENSE.txt or NOTICE.txt files.

Thanks again for everyone's help!

opts.ToolboxName = "MATLAB Arrow Interface";
opts.ToolboxVersion = toolboxVersion;
opts.AuthorName = "The Apache Software Foundation";
opts.AuthorEmail = "dev@arrow.apache.org";

% Set the SupportedPlatforms
opts.SupportedPlatforms.Win64 = true;
opts.SupportedPlatforms.Maci64 = true;
opts.SupportedPlatforms.Glnxa64 = true;
opts.SupportedPlatforms.MatlabOnline = true;

% Interface is only qualified against R2023a at the moment
opts.MinimumMatlabRelease = "R2023a";
opts.MaximumMatlabRelease = "R2023a";

opts.OutputFile = fullfile(outputFolder, compose("matlab-arrow-%s.mltbx", toolboxVersionRaw));
disp("Output File: " + opts.OutputFile);
matlab.addons.toolbox.packageToolbox(opts);

function appendLicenseText(filename)
licenseText = [ ...
newline + "--------------------------------------------------------------------------------" + newline
"3rdparty dependency mathworks/libmexclass is redistributed as a dynamically"
"linked shared library in certain binary distributions, like the MATLAB"
"distribution." + newline
"Copyright: 2022-2024 The MathWorks, Inc. All rights reserved."
"Homepage: https://github.com/mathworks/libmexclass"
"License: 3-clause BSD" ];
writelines(licenseText, filename, WriteMode="append");
end

function appendNoticeText(filename)
noticeText = [ ...
newline + "---------------------------------------------------------------------------------" + newline
"This product includes software from The MathWorks, Inc. (Apache 2.0)"
" * Copyright (C) 2024 The MathWorks, Inc."];
writelines(noticeText, filename, WriteMode="append");
end