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

copyright headers #1

Merged
merged 2 commits into from
Jan 22, 2025
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
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: 🐛 Bug Report
description: Create a report to help us reproduce and fix the bug
title: "🐛[Bug Report]: "
labels: ["bug"]

body:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Feature Request
name: 🚀 Feature Request
description: Request new or improved functionality
title: "🚀[Feature Request]: "
labels: ["enhancement"]
Expand Down
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

[package]
name = "gni"
version = "0.1.0"
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

BUILD_MODE ?= debug

ifeq ($(BUILD_MODE), release)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ GNI offers the same core functionality for each supported language, provides bin

> Note: If you’d like support for another language, please open an issue or submit a pull request!

## Contributing
### Contributing

Read our contributing guide to learn about our development process, how to propose bugfixes and feature requests, and how to build your changes.

### [Code of Conduct](https://code.fb.com/codeofconduct)

Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

[build-system]
requires = ["maturin>=1.0"]
build-backend = "maturin"
Expand Down
6 changes: 6 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

fn main() {
if std::env::var("CARGO_FEATURE_CPP").is_ok() {
// C++ build
Expand Down
6 changes: 6 additions & 0 deletions src/c/GNI.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#include "GNI.h"
#include <stdlib.h>
#include <string.h>
Expand Down
6 changes: 6 additions & 0 deletions src/c/GNI.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#pragma once

#ifdef __cplusplus
Expand Down
5 changes: 5 additions & 0 deletions src/c/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

.PHONY: all libGNI.a clean

Expand Down
6 changes: 6 additions & 0 deletions src/c/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#include <stdio.h>

extern char* c_get_gpu_node_id();
Expand Down
6 changes: 6 additions & 0 deletions src/c/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

use std::ffi::CString;
use std::os::raw::c_char;

Expand Down
6 changes: 6 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

pub const DEFAULT_CACHE_FILEPATH: &str = "/tmp/gni";
6 changes: 6 additions & 0 deletions src/cpp/GNI.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#include "mod.rs.h"
#include "GNI.h"

Expand Down
6 changes: 6 additions & 0 deletions src/cpp/GNI.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#pragma once

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gni - cpp
# GNI - cpp

We're using [cxx](https://cxx.rs/#cxx--safe-interop-between-rust-and-c) to
expose cpp bindings.
Expand Down
6 changes: 6 additions & 0 deletions src/cpp/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#include <iostream>
#include "GNI.h"

Expand Down
6 changes: 6 additions & 0 deletions src/cpp/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

#[cxx::bridge]
mod ffi {
// Expose functions to cpp
Expand Down
2 changes: 1 addition & 1 deletion src/go/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gni - go
# GNI - go

GNI for Go uses a C library via cgo to bridge Rust functionality into Go.

Expand Down
6 changes: 6 additions & 0 deletions src/go/cgo/cgo.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

package cgo

/*
Expand Down
6 changes: 6 additions & 0 deletions src/go/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

package main

import (
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

use anyhow::{anyhow, Context, Result};
use std::fs;
use std::path::Path;
Expand Down
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

use anyhow::Context;
use clap::Parser;
use std::path::PathBuf;
Expand Down
2 changes: 1 addition & 1 deletion src/python/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gni - Python pkg
# GNI - Python pkg

GNI uses [pyo3](https://pyo3.rs/main/getting-started.html?#installation) to
write a native python library, and
Expand Down
6 changes: 6 additions & 0 deletions src/python/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

import gni_lib

def main():
Expand Down
6 changes: 6 additions & 0 deletions src/python/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright (c) Meta Platforms, Inc. and affiliates.
// All rights reserved.

// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.

use std::path::PathBuf;

use pyo3::prelude::*;
Expand Down
6 changes: 6 additions & 0 deletions src/python/python_py_ext.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.

# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

from typing import Optional

def get_gpu_node_id(cache_file_path: Optional[str]) -> str: ...
Loading